/build/static/layout/Breadcrumb_cap_w.png

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"

0 Comments   [ + ] Show comments

Answers (4)

Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
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:

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
Senior Purple Belt
0
Thanks Brent!

The given example creates a key what about just changing a value, i.e. the XXXXX listed in my previous? I looked on the site but couldn't find what I was after.

Can you help?
Posted by: Naffcat 19 years ago
Senior Purple Belt
0
Thanks got it working now.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ