lwfwind 发表于 2006-8-2 20:33:46

Robot 为什么不支持for each .... next

‘通过进程名终止进程

dim strComputer as string
dim objWMIService as object
dim colProcessList as object
dim objProcess as object
strComputer = "."
Set objWMIService = GetObject _
    ("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = 'Notepad.exe'")
For Each objProcess in colProcessList
    objProcess.Terminate()
Next

编译时提示For语句错误,是不是Robot 2003不支持For each.......next?
该如何解决?
页: [1]
查看完整版本: Robot 为什么不支持for each .... next