Link to home
Create AccountLog in
Avatar of alfatec
alfatec

asked on

Automatic login to domain Windows 7 computers

I currently use the following to autologin my workstations as an administrator.I call a batch file at the command prompt using the For command and a list of PC names that enables autologin and reboots:

For /f %i in (pc.txt) do call do.bat %i

DO.BAT
reg add "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f
reg add "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName /t REG_SZ /d YOURDOMAIN /f
reg add "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d YOURUSERNAME /f
reg add "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d YOURPASSWORD /f
shutdown /r /m "\\%1" /t 1 /f


When I am done  I do this to disable the autologin and reboot:

For /f %i in (pc.txt) do call undo.bat %i

UNDO.BAT
reg add "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 0 /f
reg delete "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /f
reg delete "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /f
shutdown /r /m "\\%1" /t 1 /f

Now this all works fine for Windows XP workstations but when I have applied this to
Windows 7 workstations I get an error stating 'The network path cannot be found'. As soon
as I send it to an XP workstation it is fine. Any help would be appreciated.
Avatar of Alan_White
Alan_White
Flag of United Kingdom of Great Britain and Northern Ireland image

Can you try each bit of the batch file and see when the error first throws?

Could be a firewall on the Win7 PCs?
Avatar of alfatec
alfatec

ASKER

It throws it on the first line. The firewall is disabled on all workstations.
ASKER CERTIFIED SOLUTION
Avatar of Alan_White
Alan_White
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of alfatec

ASKER

Many thanks for that Alan. The remote registry setting was set to manual in group policy. All works fine now.