bhardage Posted June 25, 2009 Report Share Posted June 25, 2009 I don't know if this is really a general user question, but I'm having a little trouble with creating a scheduled task from the command line.My command looks like this:schtasks /create /ru "System" /d THU /st 16:32:00 /sc WEEKLY /tn FileMove9 /tr "C:\Progra~1\Apache~1\Tomcat~1.0\webapps\backup\WEB-INF\batch\run.cmd C:\Progra~1\Apache~1\Tomcat~1.0\webapps\backup\WEB-INF\tasks\FileMove9.txt"The contents of run.cmd are:cd "C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\backup\WEB-INF\classes"javaw main.FileMove "%~f1"Now I know what you're thinking. The problem must lie in the main.FileMove class.However, copying and pasting the line "C:\Progra~1\Apache~1\Tomcat~1.0\webapps\backup\WEB-INF\batch\run.cmd C:\Progra~1\Apache~1\Tomcat~1.0\webapps\backup\WEB-INF\tasks\FileMove9.txt" onto a command prompt actually runs and generates the desired results.I'm not sure what the problem could be; I used all the short names of the directories so that there wouldn't need to be any quotes inside (originally I had a lot of problems with quotes).Any suggestions would be helpful.Thanks,B.J. Quote Link to comment Share on other sites More sharing options...
bhardage Posted June 26, 2009 Author Report Share Posted June 26, 2009 As a side note, the task does start; the status field says that the task is running, indefinitely Quote Link to comment Share on other sites More sharing options...
bhardage Posted June 26, 2009 Author Report Share Posted June 26, 2009 Upon further examination, the problem seems to be with the "Run As" field. I can create the exact same task, placing my local account and password in, and that works.I'm using Windows Server 2003. Anyone know why using "NT AUTHORITY\SYSTEM" might not work? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.