All Forums >> [Scripting] >> WSH & Client Side VBScript >> Access Remote Worksation Registry Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
I create a script to access my local registry and display the value of the registry key. Is it possible to access remote workstation to do the same thing?
DIM WshShell, bKey Set WshShell = WScript.CreateObject("WScript.Shell") bKey = WshShell.RegRead ("HKLM\SOFTWARE\ComputerAssociates\HostUUID\HOSTUUID") REM WScript.Echo WshShell.RegRead ("HKLM\SOFTWARE\ComputerAssociates\HostUUID\HOSTUUID" WScript.Echo bKey
I have tried using the code format for my process. I put a workstation name in the "strComputer =" and rem out the "For" statement. Just trying to test the script to move to the next step.
And finally I am trying to show the value of the registr key...
const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "computername" Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") strKeyPath ="SOFTWARE\ComputerAssociates\HostUUID\HOSTUUID" rem objReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, arrValues objReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath rem For x=0 To UBound(arrValues)-1 rem WScript.Echo arrValues(x) rem next WScript.Echo ?
I tried to echo different varibles and could not get the actal value. The "HOSTUUID" is the key that has the value I have been trying to get displayed.