Eu mudei para o PowerShell usando este 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
Mas toda vez que executo o script, recebo esta mensagem de erro:
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
Não sei como posso consertar isso e agradeço sua ajuda.