OK, I am trying to use SCHTASKS in a vbScript. However, I need to use spaces
in my path to launch the app, since JohnDo~1 may refer to "John Doe" or "John
Doeboy", depending which was installed first. How would I setup this line?
The /norun below would signify command-line arguments. The double-quote
thing never works and I tried triple-quotes but that didn't run either.

*********************************************

LaunchCommand = "SchTasks /create /tn ""Comment"" /tr ""C:\Program
Files\App.Exe /norun"" /sc once /st " & NewTime & " /sd " & NewDate & " /ru "
& InstallAccount & " /rp " & InstallPassword
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec(LaunchCommand)

*********************************************

Any help would be appreciated.

THANKS!

Re: SchTasks help by tlviewer

tlviewer
Fri May 12 01:24:26 CDT 2006

Hello UCG,

see inline for an edit that inserts quotes.

"UnderCoverGuy" <UnderCoverGuy@discussions.microsoft.com> wrote in message
news:F7DE2588-A9EE-49AE-BE5E-D0824CA51563@microsoft.com...
> OK, I am trying to use SCHTASKS in a vbScript. However, I need to use
spaces
> in my path to launch the app, since JohnDo~1 may refer to "John Doe" or
"John
> Doeboy", depending which was installed first. How would I setup this
line?
> The /norun below would signify command-line arguments. The double-quote
> thing never works and I tried triple-quotes but that didn't run either.
>
> *********************************************
>
> LaunchCommand = "SchTasks /create /tn ""Comment"" /tr ""C:\Program
> Files\App.Exe /norun"" /sc once /st " & NewTime & " /sd " & NewDate & "
/ru "
> & InstallAccount & " /rp " & InstallPassword

LaunchCommand = "SchTasks /create /tn ""Comment"" /tr ""\""C:\Program
Files\App.Exe\"" /norun""
/sc once /st " & NewTime & " /sd " & NewDate & "/ru " &
InstallAccount & " /rp " & InstallPassword

> Set WshShell = CreateObject("WScript.Shell")
> Set oExec = WshShell.Exec(LaunchCommand)
>

good luck,
tlviewer




Re: SchTasks help by UnderCoverGuy

UnderCoverGuy
Sun May 14 19:18:02 CDT 2006

Worked great. Thanks a million


"tlviewer" wrote:

> Hello UCG,
>
> see inline for an edit that inserts quotes.
>
> "UnderCoverGuy" <UnderCoverGuy@discussions.microsoft.com> wrote in message
> news:F7DE2588-A9EE-49AE-BE5E-D0824CA51563@microsoft.com...
> > OK, I am trying to use SCHTASKS in a vbScript. However, I need to use
> spaces
> > in my path to launch the app, since JohnDo~1 may refer to "John Doe" or
> "John
> > Doeboy", depending which was installed first. How would I setup this
> line?
> > The /norun below would signify command-line arguments. The double-quote
> > thing never works and I tried triple-quotes but that didn't run either.
> >
> > *********************************************
> >
> > LaunchCommand = "SchTasks /create /tn ""Comment"" /tr ""C:\Program
> > Files\App.Exe /norun"" /sc once /st " & NewTime & " /sd " & NewDate & "
> /ru "
> > & InstallAccount & " /rp " & InstallPassword
>
> LaunchCommand = "SchTasks /create /tn ""Comment"" /tr ""\""C:\Program
> Files\App.Exe\"" /norun""
> /sc once /st " & NewTime & " /sd " & NewDate & "/ru " &
> InstallAccount & " /rp " & InstallPassword
>
> > Set WshShell = CreateObject("WScript.Shell")
> > Set oExec = WshShell.Exec(LaunchCommand)
> >
>
> good luck,
> tlviewer
>
>
>
>