.Batch file to edit Registry value?

FirefIy

Reputable
Jul 23, 2014
38
0
4,530
I'm trying to edit the Registry value using a batch file, this is what I currently have:

@echo off
Code:
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer" /v "1" /t REG_SZ /d "DisableThumbsDBOnNetworkFolders" /f

pause


This is what I'm trying to edit:
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\ Explorer]

Code:
   DisableThumbsDBOnNetworkFolders   REG_DWORD    0x00000001

I want to set the value to 1 (0x00000001) (By default it's 0x00000000) But my cmd file creates another value named DisableThumbsDBOnNetworkFolders . What did I do wrong?
 
Solution
Use a .reg file instead.
Export the current value from the registry as a template and edit the file produced.
You can run the .reg file from a batch file if necessary.