Is it possible to read "volatile environment" regkey in HMCU? I need to
get the LOGONSERVER off of a remote machine and I cant get Microsofts
example WMI script to work, so I figured I would try and read it from
the registry. I can seem to get that to work either though, returns
nothing. I can read other stuff in HMCU, just not out of the "volatile
environment" portion of the registy.

Re: is it possible to read "volatile environment" regkey in HMCU? by McKirahan

McKirahan
Thu Jan 27 12:49:08 CST 2005

<emebohw@netscape.net> wrote in message
news:1106847378.390296.83220@c13g2000cwb.googlegroups.com...
> Is it possible to read "volatile environment" regkey in HMCU? I need to
> get the LOGONSERVER off of a remote machine and I cant get Microsofts
> example WMI script to work, so I figured I would try and read it from
> the registry. I can seem to get that to work either though, returns
> nothing. I can read other stuff in HMCU, just not out of the "volatile
> environment" portion of the registy.
>

Will this help?

Const cENV = "LOGONSERVER"
Dim objWSS
Set objWSS = CreateObject("WScript.Shell")
Dim objENV
Set objENV = objWSS.Environment("Volatile")
WScript.Echo cENV & " = " &objENV(cENV)
Set objENV = Nothing
Set objWSS = Nothing



Re: is it possible to read "volatile environment" regkey in HMCU? by Torgeir

Torgeir
Thu Jan 27 12:52:03 CST 2005

McKirahan wrote:

> <emebohw@netscape.net> wrote in message
> news:1106847378.390296.83220@c13g2000cwb.googlegroups.com...
>
>>Is it possible to read "volatile environment" regkey in HMCU? I need to
>>get the LOGONSERVER off of a remote machine and I cant get Microsofts
>>example WMI script to work, so I figured I would try and read it from
>>the registry. I can seem to get that to work either though, returns
>>nothing. I can read other stuff in HMCU, just not out of the "volatile
>>environment" portion of the registy.
>>
>
>
> Will this help?
>
> Const cENV = "LOGONSERVER"
> Dim objWSS
> Set objWSS = CreateObject("WScript.Shell")
> Dim objENV
> Set objENV = objWSS.Environment("Volatile")
> WScript.Echo cENV & " = " &objENV(cENV)
> Set objENV = Nothing
> Set objWSS = Nothing
Hi

Note the "remote machine" part in the original post...



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Re: is it possible to read "volatile environment" regkey in HMCU? by emebohw

emebohw
Fri Jan 28 17:11:31 CST 2005

Got it...dont know why MS example does not work, but this does the job.

x------ start
strcomputer = "."
Const HKLM = &H80000001 'HKEY_LOCAL_MACHINE
Set objReg = GetObject("winmgmts://" & strComputer &
"/root/default:StdRegProv")
strKeyPath = "Volatile Environment\"
strValueName = "LOGONSERVER"
objReg.GetStringValue HKLM, strkeyPath, strValueName, strValue
Wscript.echo strValue & " "
x------ end