开发者

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:

  1. Click Start, and then click Run.
  2. In the Open box, type Regedt32.exe, and then press ENTER.
  3. Locate the following subkey in the registry:
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
  4. Double-click the DefaultUserName entry, type your user name, and then click OK.
  5. 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:

    1. On the Edit menu, click New, and then point to String Value.
    2. Type DefaultPassword, and then press ENTER.
    3. Double-click DefaultPassword.
    4. 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.
  6. On the Edit menu, click New, and then point to String Value.

  7. Type AutoAdminLogon, and then press ENTER.
  8. Double-click AutoAdminLogon.
  9. In the Edit String dialog box, type 1 and then click OK.
  10. Quit Registry Editor.
  11. Click Start, click Shutdown, and then type a reason in the Comment text box.
  12. Click OK to turn off your computer.
  13. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜