2016年7月20日 星期三
VBS parameter space especialy using path
Solution:
Using the chr(34) and eval to run the command like linux eval run raw command
Example:
strCommand =
"%comspec% /c move %USERPROFILE%\IE11Doc.bat %USERPROFILE%\" & chr(34) & "A BC" & chr(34)
#comspec is the exec, /c is close message, chr(34) mean qute
Wscript.Echo strCommand
# the content will be presented %comspec% /c move %userprofile%\IE11Doc.bat %userprofile%\"A BC"
oShell.Run strCommand, 0, True
# equal eval and runit, notice not using the run(...) no ( )
Noteice:
' K and run osrun/1 is show content for debug, convesty is /c and 0 is no message
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言