ehpjr
10-17-2003, 06:59 PM
I am trying to use the following to see if cdplayer is running
AppToCheck = "cdplayer.exe"
list = 0
For Each Process In GetObject("winmgmts:").InstancesOf("win32_process")
If Process.Name = AppToCheck Then
list = list + 1
pName = Process.Name
End If
Next
wscript.echo "there are " & list & " copies of " & pName & " running"
This works just fine in 2000 but in 98 I get an error referring to the GetObject line that says "Library not Registered"
Help
AppToCheck = "cdplayer.exe"
list = 0
For Each Process In GetObject("winmgmts:").InstancesOf("win32_process")
If Process.Name = AppToCheck Then
list = list + 1
pName = Process.Name
End If
Next
wscript.echo "there are " & list & " copies of " & pName & " running"
This works just fine in 2000 but in 98 I get an error referring to the GetObject line that says "Library not Registered"
Help