WinBatch Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: geauga on November 25, 2016, 11:33:04 am

Title: Setting Value of Registry Key
Post by: geauga on November 25, 2016, 11:33:04 am
I am trying to set some values of Registry entries to control showing the "My Computer" on my desktop.  When I do a RegSetDword instead of adding the value it creates a sub-key.  What am I doing wrong?

 
Code: Winbatch
rkey = RegCreateKey(@REGCURRENT, "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel")
RegSetDword(rkey, "{20D04FE0-3AEA-1069-A2D8-08002B30309D}","0")
 
Title: Re: Setting Value of Registry Key
Post by: td on November 25, 2016, 02:09:01 pm
You need square brackets around registry value names.  From the Consolidated WIL Help file:

"Note: Named data entries as found in Windows are specified by enclosing the "data item name" in square brackets at the end of the key string. For Example:

RegSetValue( @REGMACHINE,"SOFTWARE\Wilson WindowWare\Settings\WWWBATCH\MAIN[SOUNDS]",1)"