ASP & WMI

Yeah. . . old news :-).

This topic was started by ,


data/avatar/default/avatar02.webp

139 Posts
Location -
Joined 2003-01-19
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

Participate on our website and join the conversation

You have already an account on our website? Use the link below to login.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This topic is archived. New comments cannot be posted and votes cannot be cast.