DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Windows NT / 2000 / XP (http://www.daniweb.com/forums/forum10.html)
-   -   scheduled tasks puzzle (http://www.daniweb.com/forums/thread169057.html)

knowledgehog Jan 17th, 2009 6:17 pm
scheduled tasks puzzle
 
When I type
c:\windows\system32\taskkill.exe /im somename.exe /t
in the run box of the scheduled tasks wizard,the job completes successfully,but if I used the windows command prompt instead and I typed the following:

schtasks /create /sc once /sd 01/01/2009 /st 16:16:16 /ru confused /rp bigheadache /tn sametask /tr c:\windows\system32\taskkill.exe /im somename.exe /t

I run into all sorts of syntax errors.It is very cofusing indeed! The path to the executable doesn't contain spaces.There is that mandatory space between the parameters and the executable,and I have tried quotes in all sorts of combinations but to no avail. Why is the CLI playing up?

The check box "only if I am logged on" is useless because even if it is not checked and you log out after setting the task the GUI s for the applications[that are in the schtasks list] would be invisible to you when you log in! Is there a work around for this annoyance?

knowledgehog Jan 20th, 2009 9:17 pm
Re: scheduled tasks puzzle
 
schtasks /create /sc once /sd 01/01/2009 /st 16:16:16 /ru confused /rp bigheadache /tn sametask /tr c:\windows\system32\taskkill.exe /im somename.exe /t should be typed as:

Quote:

schtasks /create /sc once /sd 01/01/2009 /st 16:16:16 /ru confused /rp bigheadache /tn sametask /tr "c:\windows\system32\taskkill.exe /im somename.exe /t"
because whatever comes after /tr has to be a string and by using quotes we are telling the processor the whole expression is a string!


All times are GMT -4. The time now is 12:37 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC