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
%>
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
%>