Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to modify a registry entry via a .bat/.cmd script?

Is it possible to modify a registry value (whether string or DWORD) via a .bat/.cmd script?

like image 998
Brian R. Bondy Avatar asked Sep 24 '08 21:09

Brian R. Bondy


People also ask

Can you edit registry from command prompt?

To open the Command Prompt as an admin, type “cmd” in the Windows search bar. Next, right-click the “Command Prompt” app in the search results, and select “Run As Administrator” from the menu. Command Prompt will now open in admin mode, and we can begin editing the Windows registry.

How would you modify registry entries?

Click Start, click Run, type regedit in the Open box, and then click OK. Locate and then click the subkey that holds the registry item or items that you want to change. Click File, and then click Export. This step backs up the subkey before you make any changes.


1 Answers

@Franci Penov - modify is possible in the sense of overwrite with /f, eg

reg add "HKCU\Software\etc\etc" /f /v "value" /t REG_SZ /d "Yes" 
like image 73
nray Avatar answered Oct 07 '22 17:10

nray