How to set the value in the registry through a batch file in Windows?

I am going to set the value for the Windows registry. I want to set the shit variable for StupidMS in the registry, but the result is incorrect. Below is my code.

 set stupidMS=shit echo %stupidMS% reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v "StupidMS" /t REG_SZ /d ^%stupidMS^% 

I think the problem is ^% stupidMS ^% , but I have absolutely no idea how to fix it.

+6
source share
1 answer
 reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v "StupidMS" /t REG_SZ /d "%stupidMS%" 
+4
source

Source: https://habr.com/ru/post/949707/


All Articles