Member Avatar for TKSS
TKSS

I need to add registry keys and replace registry keys inside a vbs script...I started one...and it executes fine. However, I want to append "M:\MLS\bin" portion to the end of the existing key...as you may guess, I don't want to overwrite all my PATH environmental variables...but that is what is happening here:

Dim WSHShell
On Error Resume Next
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters\EnableOpLocks", 0, "REG_DWORD"
WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters\EnableOpLockForceClose", 1, "REG_DWORD"
WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MRxSmb\Parameters\OpLocksDisabled", 1, "REG_DWORD"
WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path", "M:\MLS\bin" , "REG_EXPAND_SZ"
WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\STATION", 70, "REG_DWORD"
WScript.Quit

So, how does one append to the existing key in this script? Please understand that this is at the very end of a longer vbs script. If this is posted in the wrong forum, please let me known.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.