trying to use wmi with asp

Z

zerbie45

Hi guys,

I have the following vbscript that works just fine but when I try to
run it using asp (just by adding the <% and %> signs and replacing
wscript.echo with write.response) it doesn't work.

Is there anything else I need to do to run this script using an ASP
page ?

Thanks in advance!

<%
Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strList

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")

Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process")

For Each objProcess in colProcess
strList = strList & vbCr & _
objProcess.Name
Next

response.write strList
' End of List Process Example VBScript

%>
 
B

Bob Lehmann

First of all, "it doesn't work" is not at all helpful. My razor doesn't
work; What's wrong?

Your problems are likely due to the fact that your .vbs scripts run under
your user account, while asp scripts run under the IUSR_xxxx account, which
has limited permissions.

Bob Lehmann
 
Z

zerbie45

Thank you bob for your reply, this will help. Take it easy, I'm not a
f*****g smart ass as you are. Be patient with beginners.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top