schtasks - how to?

May 09th, 2006 - 07:29 pm ET by Shawn Crane | Report spam
I am trying to run the following:
schtasks /CREATE /Tn "Startup Tasks" /Tr "cmd /V:on /C
\"C:\startup\StartupTasks.cmd \" AUTO" /SC ONLOGON

However I need the start in folder to be 'startup' not 'cmd' as it seems to
always be set to. I know you can change it with the gui, but I really would
much prefer to do at the command prompt. Is it possible?

btw the reason I am using the cmd is so I can set /V:on - I don't want to
have to do this in the registery.

Cheers,
email Follow the discussionReplies 2 repliesReplies Make a reply

Similar topics

Replies

#1 tlviewer
May 10th, 2006 - 03:13 pm ET | Report spam
"Shawn Crane" wrote in message news:
I am trying to run the following:
schtasks /CREATE /Tn "Startup Tasks" /Tr "cmd /V:on /C
\"C:\startup\StartupTasks.cmd \" AUTO" /SC ONLOGON

However I need the start in folder to be 'startup' not 'cmd' as it seems to
always be set to. I know you can change it with the gui, but I really would
much prefer to do at the command prompt. Is it possible?

btw the reason I am using the cmd is so I can set /V:on - I don't want to
have to do this in the registery.

Cheers,



Shawn,

I first glance I don't see how to fix this for your command line, but if you were trying to schedule a VBScript, here's what I'd do:

create a launching BAT file
launch.bat
@echo off
Cscript.exe "%1"
cls

put the above file into your desired path, say c:\scripts

then write the creation command
schtasks /create /tn TaskName /ru "SYSTEM" /tr "c:\\scripts.bat MyScript.vbs" /sc once /st 13:03:00

then you will see that the working directory will be as desired (c:\scripts)

hth,
tlviewer
Replies Reply to this message
#2 tlviewer
May 10th, 2006 - 03:16 pm ET | Report spam
"tlviewer" wrote in message news:

"Shawn Crane" wrote in message news:
I am trying to run the following:
schtasks /CREATE /Tn "Startup Tasks" /Tr "cmd /V:on /C
\"C:\startup\StartupTasks.cmd \" AUTO" /SC ONLOGON

However I need the start in folder to be 'startup' not 'cmd' as it seems to
always be set to. I know you can change it with the gui, but I really would
much prefer to do at the command prompt. Is it possible?

btw the reason I am using the cmd is so I can set /V:on - I don't want to
have to do this in the registery.

Cheers,



(correction)
Shawn,

I first glance I don't see how to fix this for your command line, but if you were trying to schedule a VBScript, here's what I'd do:

create a launching BAT file
launch.bat
@echo off
Cscript.exe "%1"
cls

put the above file into your desired path, say c:\scripts

then write the creation command
schtasks /create /tn TaskName /ru "SYSTEM" /tr "c:\\scripts\\launch.bat MyScript.vbs" /sc once /st 13:03:00

then you will see that the working directory will be as desired (c:\scripts)

hth,
tlviewer
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search