windows - 使用批处理文件更改 REG_SZ 注册值

windows - change REG_SZ reg value with batch file

我正在尝试使用批处理文件更改 "CommonFilesDir" 值。但它不起作用。我究竟做错了什么 ?还是无法更改 REG_SZ 值?

reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion" /v CommonFilesDir /d "A:\Program Files\Common Files" /t REG_SZ /f

它只是执行,显然没有错误,但它的值并没有改变。我也试过只用 reg add.. 并且我得到了相同的

格式如下:

reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion" /f /v CommonFilesDir /t REG_SZ /d "A:\Program Files\Common Files"

(务必运行作为管理员。)