Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

VB Script error - when try to execute a command on windows shell

$
0
0

Hi ,

I had to create a scheduled task on a specific date - I tried using schtasks It worked well!.

SCHTASKS /create /tn "Mytask" /tr "cscript "C:\Remove.vbs"" /sc ONCE /sd 08/02/2014 /st 14:25 /RL HIGHEST /RU SYSTEM

But when I try to embed this in VBscript it throws me below error.

Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "cmd.exe /C SCHTASKS /create /tn "Mytask1" /tr "cscript "C:\Remove.vbs"" /sc ONCE /sd 12/04/2015 /st 12:00 /RL HIGHEST /RU SYSTEM

samp.vbs(6, 72) Microsoft VBScript compilation error: Expected end of statement

Can you please help.


Sai Krishna


Viewing all articles
Browse latest Browse all 15028

Trending Articles