vbscript - Run Command Line & Command From VBS -
i need run command copy file 1 location through command prompt using vbs file. have keeps throwing error @ me.
'dim oshell set oshell = wscript.createobject ("wscript.shell") oshell.run "cmd.exe /c copy "s:claims\sound.wav" "c:\windows\media\sound.wav" set oshell = nothing' the error is:
'script: c:\******\command.vbs char: 30 error: expected end of statement code: 80040401 source: microsoft vbscript compilation error'
please :)
the problem on line:
oshell.run "cmd.exe /c copy "s:claims\sound.wav" "c:\windows\media\sound.wav" your first quote next "s:claims" ends string; need escape quotes around files second quote, this:
oshell.run "cmd.exe /c copy ""s:\claims\sound.wav"" ""c:\windows\media\sound.wav"" " you have typo in s:claims\sound.wav, should s:\claims\sound.wav.
i assume apostrophe before dim oshell , after set oshell = nothing typos well.
Comments
Post a Comment