Avatar of 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

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

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.
Windows Server 2003Networking ProtocolsWindows Networking

Avatar of undefined
Last Comment

8/22/2022 - Mon

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

Could be a firewall on the Win7 PCs?

It throws it on the first line. The firewall is disabled on all workstations.

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Many thanks for that Alan. The remote registry setting was set to manual in group policy. All works fine now.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy