User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 456,434 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,616 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 2127 | Replies: 0
Reply
Join Date: Jan 2004
Location: VA, USA
Posts: 459
Reputation: TKS will become famous soon enough TKS will become famous soon enough 
Rep Power: 6
Solved Threads: 17
TKS's Avatar
TKS TKS is offline Offline
Posting Pro in Training

Editing Registry with VBS

  #1  
May 3rd, 2007
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.
Last edited by TKS : May 3rd, 2007 at 5:13 pm. Reason: changed code
My Home Away from Home: Yet Another Linux Blog
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 1:34 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC