Re: Win32_Process CommandLine returning Null



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


.



Relevant Pages

  • Re: exempt a machine from a group policy
    ... The computer name in an ACL normally only gets used when there is an attempt ... implicity authorize Modify access by the machine account. ... the script is NOT executed *by* a machine. ...
    (microsoft.public.windows.group_policy)
  • Re: Populate email attribute in AD
    ... I have other OUs where I would like to use this script as well so ... it would be preferable to pass the OU LDAP path as a command line argument. ... >> I do not have to use the CSV file. ... >> If the script encounters a blank username field it will skip that account, ...
    (microsoft.public.windows.server.scripting)
  • Re: problem with login
    ... login session" after I create their account. ... If your script is using the mkuser command, ...
    (comp.unix.aix)
  • Re: su Command from a script with Password?
    ... > I need to use the su command from a script with a known password. ... > origen account is not root, but the password to the destination ... > account inside a script unless I am no the root account. ...
    (comp.unix.programmer)
  • Re: local exploit for "/ect/shadow"
    ... post the results of running your command. ... can't post the results without sanitizing. ... script will say error every time. ... If attacker delete regular account root and s/he append r00t ...
    (comp.os.linux.security)

Loading