Re: trying to use wmi with asp
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
<zerbie45@gmail.com> wrote in message
news:1140901993.895216.312580@j33g2000cwa.googlegr oups.com...[color=blue]
> 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
>
> %>
>[/color]
|