Re: Win32_Process CommandLine returning Null
- From: "Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 27 May 2005 09:27:24 +0100
Thanks for the reply Michael. It seems to be a permissions issue. Several
properties come back as Null if the process is running under an account
other than the current user's or SYSTEM.
I noticed that the MSFT iisapp.vbs script asserts the '(debug)' privilege
when doing something similar with WMI. I did this in my application and the
problem went away. Interesting! I can't find any documentation that suggests
this is necessary, or even precisely what it does.
Tony Proctor
"Michael Harris (MVP)" <mikhar at mvps dot org> wrote in message
news:#wQi6lmYFHA.2664@xxxxxxxxxxxxxxxxxxxxxxx
> > For instance, the following command correctly shows me the w3wp
> > processes and their command lines:
> >
> > c\:> WMIC PROCESS WHERE "Name='w3wp.exe'" get Caption,CommandLine
> >
> > whereas this simple bit of script (executed via WScript) fails
> > because the CommandLine property is Null.
> >
> > for each s in GetObject("winmgmts:").ExecQuery("select * from
> > win32_Process where Name='w3wp.exe'")
> > WScript.Echo s.Caption & " " & IsNull(s.CommandLine)
> > next
>
> The WMIC command line version and WSH hosted equivalent (both copy/pasted
> from your post) both work for me on Xp Pro sp2...
>
> --
> Michael Harris
> Microsoft MVP Scripting
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Please ask follow-up questions via the original newsgroup thread.
>
>
>
.
- References:
- Win32_Process CommandLine returning Null
- From: Tony Proctor
- Re: Win32_Process CommandLine returning Null
- From: Michael Harris \(MVP\)
- Win32_Process CommandLine returning Null
- Prev by Date: Re: Get current screen resolution?
- Next by Date: Re: How to get physical drive from "\Device\HarddiskVolume1"?
- Previous by thread: Re: Win32_Process CommandLine returning Null
- Next by thread: Not sure where the problem is...
- Index(es):
Relevant Pages
|
Loading