
怎么用vbs判断进程如果中存在 123.exe 就执行第一个文件 c:\1.BAT . 如果不存在则执行 c:\2.exe
运行1。BAT是可以,但是如果把123.exe进程关了,再运行本来应该是运行2。bat。但是却说错误,系统找不到指定的文件。...
运行1。BAT是可以 ,但是如果把123.exe进程关了,再运行本来应该是运行2。bat 。 但是却说错误,系统找不到指定的文件。
展开
展开全部
摆脱,根据自己的需要更爱代码中启动文件的路径.不用我告诉你你的电脑里文件在哪吧!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
set pro = getobject("winmgmts:\\.").instancesof("Win32_Process")
boo = 0
for each ps in pro
if ps.name = "123.exe" then boo = 1
next
if boo = 1 then createobject("wscript.shell").run "c:\1.bat" else createobject("wscript.shell").run "c:\2.exe"
set pro = getobject("winmgmts:\\.").instancesof("Win32_Process")
boo = 0
for each ps in pro
if ps.name = "123.exe" then boo = 1
next
if boo = 1 then createobject("wscript.shell").run "c:\1.bat" else createobject("wscript.shell").run "c:\2.exe"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询