Re: Reading Registry
- From: "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 May 2007 13:30:00 -0500
"Gaurav" <gaurav081@xxxxxxxxx> wrote in message
news:1180545201.802600.215610@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thanks Richard,
What I am still confused about is" Why do i still get the some blank
outputs(quite a few)?"
If winmgmts is case sensitive ..i should get a common output
reagrdless of using it correctly or not.
Thanks
Gaurav
You are right that if "winmgmts" were case sensitive, it would always raise
an error. The monikers "LDAP" and "WinNT" are case sensitive, so I assumed
"winmgmts" was as well. Testing reveals I was wrong, "winmgmts" is case
insensitive.
One problem is that compname() is not defined in the snippet you provided.
The program seems to work for me if I substitute strComputer for compname(),
and assign my computer name to strComputer (rather than "."). I also
substituted valid values for xxxx and yyy
If an error is raised, it will not be revealed in the text file created by
the script. If "On Error Resume Next" is used and an error is raised, the
file is not created. I cannot think of a scenario where the file will be
created with no string written to it.
If this is run as a logon script, you can retrieve the computer name from
the wshNetwork object:
Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName
Does the script work on the machines where it failed if you run the script
manually at a command prompt after logon? Is there something in common about
the computers where the script fails, like the OS? When it fails, is the
text file created with nothing, or is no file created?
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--
.
- Follow-Ups:
- Re: Reading Registry
- From: Gaurav
- Re: Reading Registry
- References:
- Reading Registry
- From: Gaurav
- Re: Reading Registry
- From: Richard Mueller [MVP]
- Re: Reading Registry
- From: Gaurav
- Reading Registry
- Prev by Date: Re: Reading Registry
- Next by Date: Re: Deleting users from an OU
- Previous by thread: Re: Reading Registry
- Next by thread: Re: Reading Registry
- Index(es):
Relevant Pages
|