我有一个可执行文件EMC_WS.EXE
,我想使用命令
WshShell.Run "EMC_WS.EXE", 1, False
可执行文件正确运行,但命令窗口没有出现。我使用mingwstudio生成EMC_WS.EXE
。
Dim pathString, UserPath
Dim position
Dim WshShell, Shell
Set WshShell = WScript.CreateObject("WScript.Shell")
Set Shell = WshShell.Environment("User")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'EMC_WS.EXE'")
For Each objProcess In colProcessList
objProcess.Terminate()
Next
WshShell.Run "EMC_WS.EXE", 1, False
Set WshShell = Nothing
WScript.Quit(0)