标题: VBS如何向批处理传递命令行参数 [打印本页]
作者: spfnug 时间: 2009-11-30 20:25 标题: VBS如何向批处理传递命令行参数
如题,如何将参数传递给check.bat,即执行"check %1"
-
- strComputer = "."
- set objectShell=wscript.createObject("wscript.shell")
- Set objWMIService = GetObject("winmgmts:" _
- & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
- Set colMonitoredProcesses = objWMIService. _
- ExecNotificationQuery("select * from __instancecreationevent " _
- & " within 1 where TargetInstance isa 'win32_process'")
- i = 0
- Do While i = 0
- Set objLatestProcess = colMonitoredProcesses.NextEvent
- objectShell.Run "check.bat %1", 1, TRUE
- Loop
复制代码
作者: zqz0012005 时间: 2009-11-30 20:58
objectShell.Run "check.bat " & objLatestProcess.TargetInstance.Name, 1, TRUE
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |