title: Windows Registry doesn't save changes after reboot
body: <p>I'm using a batch script to activate Auto logon on a computer that's a member of doamin.</p>
  
  <pre><code>@echo off
  REM Set variables
  set /p username= What is the username?
  set /p domain= What is the domain name?
  set /p password= What is the password?
  
  REM Enable Auto Logon
  reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1
  
  REM Set Username for logon
  reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d %username%
  
  REM Set Domain
  reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName /t REG_SZ /d %domain%
  
  REM Set Password
  reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d %password%
  
  REM Set number of times to auto logon (0 for infinite)
  reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoLogonCount /t REG_DWORD /d 0
  </code></pre>
  
  <p>Everything works fine after I execute the script, but once I reboot the computer I noticed that the DefaultPassword and AutoAdminLogon values are not saving. I changed the permission but still no luck.</p>
  
  <p>Can you please tell me what am I doing wrong.</p>