Re: schtasks - how to? by tlviewer
tlviewer
Wed May 10 14:13:09 CDT 2006
"Shawn Crane" <ShawnCrane@discussions.microsoft.com> wrote in message =
news:3FB1A58F-6DDF-40EA-AC87-D4EF5190E91D@microsoft.com...
> I am trying to run the following:
> schtasks /CREATE /Tn "Startup Tasks" /Tr "cmd /V:on /C=20
> \"C:\startup\StartupTasks.cmd \" AUTO" /SC ONLOGON
>=20
> However I need the start in folder to be 'startup' not 'cmd' as it =
seems to=20
> always be set to. I know you can change it with the gui, but I really =
would=20
> much prefer to do at the command prompt. Is it possible?
>=20
> btw the reason I am using the cmd is so I can set /V:on - I don't want =
to=20
> have to do this in the registery.
>=20
> 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
-------------- unsnip -------------
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