Re: Reading Registry
- From: Gaurav <gaurav081@xxxxxxxxx>
- Date: 30 May 2007 12:40:40 -0700
On May 30, 1:30 pm, "Richard Mueller [MVP]" <rlmueller-
nos...@xxxxxxxxxxxxxxxxxxxx> wrote:
"Gaurav" <gaurav...@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
--
Yes, that is a part of login script. Login script captures a lot more
data like OS, machine name, logged on user etc and writes to
individual text files which are comma delimeted. So the text file is
always created even if LNVer() doesn't work.
I will have to find out the location of the computers it is failing
on. I will investigate further and post my findings.
Thanks again
Gaurav
.
- References:
- Reading Registry
- From: Gaurav
- Re: Reading Registry
- From: Richard Mueller [MVP]
- Re: Reading Registry
- From: Gaurav
- Re: Reading Registry
- From: Richard Mueller [MVP]
- Reading Registry
- Prev by Date: Re: Replace Lines between 2 lines
- Next by Date: Re: Script the creation of a Windows XP VPN connection
- Previous by thread: Re: Reading Registry
- Next by thread: Re: Deleting users from an OU
- Index(es):
Relevant Pages
|