今天不知道什么原因,就研究了一下在cmd命令行中执行vbs或者js代码,这里算是一种思路吧
执行VBS代码,再由vbs执行bat程序
:: mshta vbscript:createobject("wscript.shell").run("RunWebService.bat D:PublishTestWebTestShareFile",vbhide)(window.close)
:: mshta vbscript:createobject("wscript.shell").run("C: 1RunWebService.bat D:PublishTestWebTestShareFile",0)(window.close)
执行JS代码,再由js执行bat程序
::mshta javascript:new ActiveXObject("WScript.Shell").Run("cmd /c C: 1RunWebService.bat D:PublishTestWebTestShareFile",0);window.close()
::mshta javascript:(new ActiveXObject('WScript.Shell')).Run('cmd /c C: 1RunWebService.bat D:PublishTestWebTestShareFile',0);window.close();
::mshta "javascript: new ActiveXObject('WScript.Shell').Run('cmd /c C: 1RunWebService.bat D:PublishTestWebTestShareFile',0);window.close()"
::mshta javascript: new ActiveXObject("WScript.Shell").Run("cmd /c C: 1RunWebService.bat D:PublishTestWebTestShareFile",0);window.close()
执行 powershell 代码
powershell "if(1 -gt 0){echo 1111} else {echo 000}"
具体的可以参考我上一篇文章:运行bat时隐藏cmd窗口
==================================================================
另外,再给个命令,我自己还没有研究这个命令,先记录下;
示例功能:从指定url下载内容并保存
cscript //NoLogo /e:vbscript web_Download.vbs "http://xxx.ddd.com/abc.html" "c: mp123.txt"