I'm trying to create a registry key with a batch file. I really need to be able to do this via a batch rather than a VBscript or .reg file.

So far by using this guide, I've come up with this. but whenever I try to run it, I don't see it in the registry. (No errors, running as Admin) What am I doing wrong?

REG ADD HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList /v "MyCustomWorkgroupUsername" /t REG_DWORD /d 0
  • are you able to add the value manually, through regedit? or else, you might not have permission to do so.. Jun 18 '12 at 6:56
  • Yes, I've been able to create reg. values using everything but a batch file.
    – Usta
    Jun 18 '12 at 20:46
  • Found the issue. Because there was a space in the subkey 'Windows NT', it was treating everything after that as parameters. Added quotations around my key fixed it.
    – Usta
    Jun 18 '12 at 20:56

Add quotation marks around the subkey

REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v "MyCustomWorkgroupUsername" /t REG_DWORD /d 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.