technicalman
asked on
vbscript select * using a variable in a select statement
In the vbscript below, i'm trying to see if I can substitute a variable in the select statement below. I haven't been able to make it work. Does anyone know a way?
Thanks
Randy
--------------------------
strComputer = "."
Dim myprogram
MYPROGRAM = "outlook.exe" <<<<<<<THIS
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=imper
Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = MYPROGRAM") <<<<<<<THIS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Shouldn't have typed "should do it..."
:^ )
:^ )
yeah, too slow :-)
ASKER
You guys are Great! Thanks!
("Select * from Win32_Process Where Name = '" & MYPROGRAM & "'")
should do it...