Trying to edit the registry in Windows with a batch file

后端 未结 2 1299
一向
一向 2021-02-08 23:03

I am supporting a few offices across the country running Windows XP. They are stand alone, no Windows Server or Active Directory, anything like that. I just switched them over t

相关标签:
2条回答
  • 2021-02-08 23:36

    Export the registry key that you manually added and compare the .reg file to the one you imported via regedit.

    0 讨论(0)
  • 2021-02-08 23:45

    Looks to me like you have the Registry value name and data swapped. According to the kb article, the REG_SZ value(s) should be named numerically starting with "1", and the included data would be the executable name ("msnmsgr.exe"). Thus, your .REG file should look like this:

    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun]
    "1"="msnmsgr.exe"
    

    Also, I would recommend that you use the REG.EXE program for simple edits like this, rather than importing a .REG file. For the change you wanted, your REG.EXE command would look like this:

    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v "1" /t REG_SZ /d "msnmsgr.exe" /f
    
    0 讨论(0)
提交回复
热议问题