I switched to PowerShell using this script:
$TheUser = Read-Host "What is the username?"
$ThePassword = Read-Host "What is the password?" -AsSecureString
$TheDomain = Read-Host "What is the domain?"
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name AutoAdminLogon -Value 1
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name DefaultUserName -Value "$TheUser"
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name DefaultPassword -Value $ThePassword
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name DefautDomainName -value $TheDomain
But each time I execute the script I get this error message:
New-ItemProperty : The property already exists At
C:\Users\Administrator\Desktop\Autologon.ps1:4 char:17 +
New-ItemProperty <<<< -Path 'HKLM:\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon' -Name AutoAdminLogon -Value 1 +
CategoryInfo : ResourceExists:
(HKEY_LOCAL_MACH...ersion\Winlogon:String) [New-ItemProperty],
IOException + FullyQualifiedErrorId :
System.IO.IOException,Microsoft.PowerShell.Commands.NewItemPropertyCommand
New-ItemProperty : The property already exists At
C:\Users\Administrator\Desktop\Autologon.ps1:5 char:17 +
New-ItemProperty <<<< -Path 'HKLM:\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon' -Name DefaultUserName -Value "$TheUser" +
CategoryInfo : ResourceExists:
(HKEY_LOCAL_MACH...ersion\Winlogon:String) [New-ItemProperty],
IOException + FullyQualifiedErrorId :
System.IO.IOException,Microsoft.PowerShell.Commands.NewItemPropertyCommand
New-ItemProperty : The property already exists At
C:\Users\Administrator\Desktop\Autologon.ps1:6 char:17 +
New-ItemProperty <<<< -Path 'HKLM:\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon' -Name DefaultPassword -Value $ThePassword
+ CategoryInfo : ResourceExists: (HKEY_LOCAL_MACH...ersion\Winlog on:String) [New-ItemProperty], IOException + FullyQualifiedErrorId :
System.IO.IOException,Microsoft.PowerShell.Commands.NewItemPropertyCommand
New-ItemProperty : The property already exists At
C:\Users\Administrator\Desktop\Autologon.ps1:7 char:17 +
New-ItemProperty <<<< -Path 'HKLM:\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon' -Name DefautDomainName -value $TheDomain +
CategoryInfo : ResourceExists:
(HKEY_LOCAL_MACH...ersion\Winlogon:String) [New-ItemProperty],
IOException + FullyQualifiedErrorId :
System.IO.IOException,Microsoft.PowerShell.Commands.NewItemPropertyCommand
Not sure how I can fix this and I'd really appreciate your help.