Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
Thomas Seaford
3 discussion posts
I am trying to use scheduled tasks to send a notification after certain tasks have run on a few winXP workstations we have. (I use a batch file to set the schedules on all the machines.) When the batch file tries to set the task related to shellsend, I get the following error:

Code

ERROR: Invalid Argument/Option - 'ran '.
Type "SchTasks /CREATE /?" for usage.


Here is the corresponding line in the batch file:

Code

SchTasks /Create /RU "SYSTEM" /SC DAILY /TN "Notify Admin: Schedule Ran" /TR "C:\Program Files\ShellSend\shellsend.exe "(email)@(domain).com" "(email)@(domain).com" "mail.(domain).com" 26 0 "(email)@(domain).com" "(password)" "ScheduleRan" "C:/program files/shellsend/shellsend.txt" /ST 03:30:00


Note that some information has been removed for privacy. All modifications have been outlined with (). The command will run from the command line and email fine.
Mar 31, 2014  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
There were a couple of issues that I found with your command. The "Notify Admin: Schedule Ran" was tripping it up because of the colon, and you had forward slashes in the shellsend.txt path. Also, the quotation marks inside the SchTasks arguments need to be escaped. After fixing those up, it should work. Here's the command I used:

Code

SchTasks /Create /RU "SYSTEM" /SC DAILY /TN "Notify Admin Schedule Ran" /TR "\"C:\Program Files\ShellSend\shellsend.exe\" \"(email)@(domain).com\" \"(email)@(domain).com\" \"mail.(domain).com\" 26 0 \"(email)@(domain).com\" \"(password)\" \"ScheduleRan\" \"C:\Program Files\shellsend\shellsend.txt\"" /ST 03:30:00


Hope that helps!
Mar 31, 2014 (modified Apr 1, 2014)  • #2
User Image
Thomas Seaford
3 discussion posts
Thanks Keith! I appreciate your help! That got the batch file working properly. The only problem I'm running into now is that the task fails to run. I get a status code of 0xffffffff. Does that mean anything to you?
Mar 31, 2014  • #3
User Image
Thomas Seaford
3 discussion posts
Hey Keith! I just figured it out. I had not noticed but there was a small error in the path for the text file.

Code

\"C:\shellsend\shellsend.txt\"


Should have been

Code

\"C:\program files\shellsend\shellsend.txt\"


That fixed the problem. Thanks again for your help!
Mar 31, 2014  • #4
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ah yes, sorry about that, I had modified it when I was testing, forgot to change it back. Glad to hear it's all good now!
Apr 1, 2014  • #5
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)