
批處理調用vbs的語法問題執行快捷方式模擬按鍵大家好,我想生成一個執行按鍵模擬收入的快捷方式,即執行快捷方式后會模擬按鍵快捷方式目標為mshta.exe VBscript:CreateObject(Wscript.Shell).SendKeys(^%{LEFT})(window.close)用vbs寫的為Set a=Wscript.CreateObject(Wscript.Shell)set b=a.CreateShortcut(a.CurrentDirectory & 上首.lnk)b.TargetPath=mshta.exeb.Arguments=VBscript:CreateObject(Wscript.Shell).SendKeys(^{LEFT})(window.close)b.IconLocation=a.CurrentDirectory & Pintf.exe,3b.WorkingDirectory=a.CurrentDirectoryb.Save但因為我還要執行后續的操作,需要把vbs轉批處理mshta VBscript:Execute(Set a=CreateObject(Wscript.Shell):set b=a.CreateShortcut(a.SpecialFolders(Desktop) & 上首.lnk):b.TargetPath=mshta.exe:b.IconLocation=%~dp0Pintf.exe,3:b.Save:close)mshta VBscript:Execute(Set a=CreateObject(Wscript.Shell):set b=a.CreateShortcut(a.SpecialFolders(Desktop) & 上首.lnk):b.Arguments=VBscript:CreateObject(Wscript.Shell).SendKeys(^{LEFT})(window.close):b.Save:close)批處理中,VBscript:CreateObject(Wscript.Shell).SendKeys(^%{RIGHT})(window.close) 直接這樣寫會報錯,估計是語法格式問題,請高手幫忙修改下,讓批處理執行會可以創建快捷方式,且目標為C:Windowssystem32mshta.exe VBscript:CreateObject(Wscript.Shell).SendKeys(^{LEFT})(window.close)nload="thumbImg(this)" alt="" />注意:我是需要是批處理

