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

WIndow 自動啟動程式地方

Position 
1. 
C:\Users\使用者帳號\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup


2. 
上圖為 Windows 7 左下角「開始」鍵打開後的搜尋框,請直接輸入「msconfig」並按下 ENTER 即可。




REF