Author Topic: Setting Value of Registry Key  (Read 2038 times)


  • Newbie
  • *
  • Posts: 29
Setting Value of Registry Key
« 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")


  • Tech Support
  • *****
  • Posts: 4444
    • WinBatch
Re: Setting Value of Registry Key
« Reply #1 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)"


"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade