Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script to modify registry values

Status
Not open for further replies.

ranadhir

Programmer
Nov 4, 2003
54
IN
We need to modify the 'Interact with desktop' setting of a windows service through the registry.One of the options is to do this through a bat file invoking regedit.
Is there any other option through which registry entries can be manipulated through batch scripts?
 
You can use the Windows Resource kit tool REG.EXE which will allow you to make registry mods using a batch file instead of REGEDIT which requires a source file (.reg) in order to work. Hope this helps
 
Couple of other options in this thread.

thread931-1298661





When you are the IT director, it's your job to make sure the IT works. If it does work they know already and if it doesn't, they don't want to hear your pathetic excuses.
 
Here's the VBScript code that you'll need. I posted this earlier for a similar post. I demonstrate with the HKLM hive, but this can apply to other hives as well.

'begin script
Dim objShell
On error resume next
''''''''''''''
' Registry key
''''''''''''''
strRegLoc = "HKEY_LOCAL_MACHINE\SOFTWARE\<path>"
strKey = "<keyname>" 'key you'll be creating
strValue = "<value>" 'value within new key
''''''''''''''''''''''''
'write new key and value
''''''''''''''''''''''''
Set objShell = CreateObject("WScript.Shell")
objShell.RegWrite strRegLoc & strKey, 1, "REG_SZ"
objShell.RegWrite strRegLoc & strKey,_
strValueLocal, "REG_SZ"
'end script

You'll need to enter your key name and value into the given script.

Then, create a new GPO, remove all administrative templates for faster policy processing. Go to the scripts section under the desired node (user or machine). Add this new logon or startup script. You'll need to place the .vbs file into its respective GPO directory.

Hope This Helps,

Good Luck!
 
Hi monsterjta i was referencing your above post with the above link :)





When you are the IT director, it's your job to make sure the IT works. If it does work they know already and if it doesn't, they don't want to hear your pathetic excuses.
 
Oh! Thank porkchopexpress...I guess I didn't look into it. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top