Remote machine
I would like to change the below value on a remote machine, please could someone advise how I would do this in VBscript?
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters\srvcomment: "XXXXXX"
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters\srvcomment: "XXXXXX"
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
brenthunter2005
19 years ago
Yo Yo Naffcat!
To modify the registry remotely you can use the StdRegProv provider in WMI: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/stdregprov.asp
Here is an example to modify the registry on a remote computer from the MSDN website:
PS: Obviously you will need to have the neccessary permissions to the remote computer to make these changes...
To modify the registry remotely you can use the StdRegProv provider in WMI: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/stdregprov.asp
Here is an example to modify the registry on a remote computer from the MSDN website:
HKEY_LOCAL_MACHINE = &H80000002
strRemoteComputer = "atl-ws-001"
Set ObjRegistry = _
GetObject("winmgmts:{impersonationLevel = impersonate}!\\" & strRemoteComputer & "\root\default:StdRegProv")
strPath = "SOFTWARE\MyKey\MySubKey"
Return = objRegistry.CreateKey(HKEY_LOCAL_MACHINE, strPath)
If Return <> 0 Then
WScript.Echo "The operation failed." & Err.Number
WScript.Quit
Else
wScript.Echo "New registry subkey created" & VBCRLF & "HKLM\SOFTWARE\MYKey\"
End If
PS: Obviously you will need to have the neccessary permissions to the remote computer to make these changes...
Posted by:
Naffcat
19 years ago
Posted by:
brenthunter2005
19 years ago
You'll want to use the SetStringValue method then.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/setstringvalue_method_in_class_stdregprov.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/setstringvalue_method_in_class_stdregprov.asp
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.