Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an executable JAR file that runs fine under a normal user account. I am trying to schedule this JAR file to run as a System task using Schtasks.exe in Windows Server 2003. The following works just fine to schedule my task:

schtasks /create /tn QCLogger /tr C:\QC_LOGGER\runQCLogger.bat /sc ONSTART /ru System

The task is created correctly and runs. The problem is that the program itself doesn't see the network. When this program is run from a user account, the following directory reference works just fine:

\\casndfgdrtra10\Casdfg10Logs\

When this program is run under a System account, it does not seem to see the network, and thus a call to the directory listed above yields no file results.

Does anyone know how I can fix this? I am open for either a server or coding solution. Please let me know what ideas or questions you have.

Thanks!


UPDATE:

This is in response to the first answer posted, and my attempts:

I am having trouble using the /u and /p in conjunction with the /ru. Here is what I am trying to do (passwords and such have been changed):

schtasks /create /tn QCLogger /tr C:\QC_LOGGER\runQCLogger.bat /sc ONSTART /u ITSERVICES\bv1sfd /p awerwer /ru System

OR

schtasks /create /tn QCLogger /tr C:\QC_LOGGER\runQCLogger.bat /sc ONSTART /u bv1sfd /p awerwer /ru System

Both of those return a syntax error that states: Cannot specify user name without specifying system name. Does anyone know what that means? And how to fix it so that I can run this as a system task while authenticating to the network with these credintials?

share|improve this question
    
I deleted the question from SO. Thanks, I didn't even know about ServerFault –  IcyBlueRose Oct 4 '10 at 16:50
    
I've deleted my answer because I don't think I'm helping. A brief glance at the schtask docs (msdn.microsoft.com/en-us/library/bb736357%28VS.85%29.aspx) suggests you should be able to do this with /ru and without /u / /p, but I've never used schtask so can't really help. With your original command line, you might check to make sure that the system account has access to the network resource. My guess is that it doesn't. If you end up having to use /u / /p, apparently (from the error message) you'll need to use /s as well. –  T.J. Crowder Oct 4 '10 at 16:58
    
All right, thank you –  IcyBlueRose Oct 4 '10 at 17:00
add comment

1 Answer

I solved a similar issue by switching under which user the task was running; the default user didn't have network access rights. Worth a try, at least. Double-check and software firewalls you're using, as well; I know Windows Defender has given us similar headaches.

share|improve this answer
    
Okay. This already works for me when I schedule it under different users, but when a user gets logged out, my task goes away. I can't have that, which is why I need it to run as a System task. Do you know if there's somewhere I need to modify the System user to allow network connections? –  IcyBlueRose Oct 4 '10 at 17:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.