ASP & WMI
Yeah. . . old news :-).
This topic was started by janus,
I would like to make 2 vbscript functions to put on an ASP page
1) I would like help with a function to display whether a certain process is running
2) I would somehow like to obtain the currently playing winamp song (perhaps a spinoff of #1, wherein the title of winamp is parsed and the song name extracted if that process is running)
I have code that works with windows scripting (ie as a .vbs file) for #1 but not with ASP server side scripting, please help
Set wbemObjectSet = _
GetObject("winmgmts://").InstancesOf("Win32_Process")
For Each wbemObject In wbemObjectSet
If LCase(wbemObject.Name) = "wmenc.exe" Then IsRunning=TRUE
Next
If IsRunning = "" Then IsRunning = FALSE
with WScript it works, when i throw it in an asp file I get an error
1) I would like help with a function to display whether a certain process is running
2) I would somehow like to obtain the currently playing winamp song (perhaps a spinoff of #1, wherein the title of winamp is parsed and the song name extracted if that process is running)
I have code that works with windows scripting (ie as a .vbs file) for #1 but not with ASP server side scripting, please help
Set wbemObjectSet = _
GetObject("winmgmts://").InstancesOf("Win32_Process")
For Each wbemObject In wbemObjectSet
If LCase(wbemObject.Name) = "wmenc.exe" Then IsRunning=TRUE
Next
If IsRunning = "" Then IsRunning = FALSE
with WScript it works, when i throw it in an asp file I get an error
Participate on our website and join the conversation
This topic is archived. New comments cannot be posted and votes cannot be cast.