Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
are you able to add the value manually, through regedit? or else, you might not have permission to do so.. – tumchaaditya 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
up vote 4 down vote accepted

Add quotation marks around the subkey

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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