How to auto login to windows account?
I am researching ways to auto login to a windows server, so appli开发者_JS百科cations can be restarted on reboot if the server crashes. Do windows services load before or after a user logs in? Can a windows service be used to login to an account?
If not, is there any way to use some sort of login script to facilitate automatically loggin in?
For auto login. Here is one of them:
To use Registry Editor (Regedt32.exe) to turn on automatic logon, follow these steps:
- Click Start, and then click Run.
- In the Open box, type Regedt32.exe, and then press ENTER.
- Locate the following subkey in the registry:
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
- Double-click the DefaultUserName entry, type your user name, and then click OK.
Double-click the DefaultPassword entry, type your password, and then click OK.NOTE: If the DefaultPassword value does not exist, it must be added. To add the value, follow these steps:
- On the Edit menu, click New, and then point to String Value.
- Type DefaultPassword, and then press ENTER.
- Double-click DefaultPassword.
- In the Edit String dialog, type your password and then click OK.
- NOTE: If no DefaultPassword string is specified, Windows automatically changes the value of the AutoAdminLogon key from 1 (true) to 0 (false), disabling the AutoAdminLogon feature.
On the Edit menu, click New, and then point to String Value.
- Type AutoAdminLogon, and then press ENTER.
- Double-click AutoAdminLogon.
- In the Edit String dialog box, type 1 and then click OK.
- Quit Registry Editor.
- Click Start, click Shutdown, and then type a reason in the Comment text box.
- Click OK to turn off your computer.
- Restart your computer. You can now log on automatically.
Taken from: http://support.microsoft.com/kb/324737
Services run regardless of whether a user logs on. If you need an application to run all the time, have you considered converting it to a service? Auto-logon is a security risk.
Windows Services do load before user logins. A Windows service cannot be used to login to an account, but you can specify the account to run the service under. You can setup automatic login in the registry under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon.
AutoAdminLogon, DefaultUserName, DefaultPassword, DefaultDomainName, and ForceAutoLogon are the keys you will need to set. They are all strings.
P.S. This is more a Server Fault \ Super User question.
Services start before login. And rather than using a service to log into an account, why not just set the account to auto log in? http://www.expta.com/2008/03/how-to-enable-autologon-in-windows.html.
*edit*Beaten to it*
I have tested it on:
- WIN10 updated Jan-2016
- WIN7 updated Jan-2016
And it works!
I use this .REG file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"AutoAdminLogon"="1"
"DefaultDomainName"="DOMAINNAME"
"DefaultUserName"="USERNAME"
"DefaultPassword"="PASSWORD"
Extracted from: http://www.sysadmit.com/2016/01/windows-configurar-autologin.html
Maybe systinternals/autologon.exe should be mentioned here.
It has a very simple gui and can also be used by command line only.
I guess it does the registry entry in the background.
精彩评论