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:
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.
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
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?