C++ and STL
  Common Issues
  Destructor
  regex
  string
 MFC
  CButton
  CDialog
  CEdit
  CInternetSession
  CWinThread
  CWnd
 MS VS FAQ
  Compiling, building
  Debugging
  Editor
  Settings
 Win32, API
  Console
  File System
  Graphics
  Internet functions
  Kernel objects
  Security
  Sound
  Thread, process
  Window
 Windows NT/2K*
  Logon, logoff...
  Networking
  Service Packs
 | About
  About
  Links & Freeware

Powered by
CoderTown



Autologon

The procedure is straightforward: under the key
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\
create or change the following parameters (all are of REG_SZ type - a string):

AutoAdminLogon = 1
DefaultUserName = UserName
DefaultPassword = Password
DefaultDomainName = DomainName

The DefaultDomainName is optional and you may leave it as it is.

Once you change these settings, system will try to logon automatically with these credentials every reboot.

Moreover, if it is Windows NT, even after the logoff, the system will logon back again as UserName. To prevent it do logoff/logon with Shift key pressed. If it is Windows 2000, then after the logoff, the system will not autologon automatically as NT does. If you need the same behaviour, you will require one more parameter under the same key (string type too):

ForceAutoLogon = 1

I've met one more interesting parameter to control this process:

AutoLogonCount = N

The parameter is decremented by the system every logon. Could be useful if you need the feature to work only N times. Then AutoAdminLogon will be set to 0, and AutoLogonCount will be deleted.

Recommended links: www.winguides.com, support.microsoft.com

Created: 2003-06-06
Updated: 2003-06-06

Google
 
Web visualcpp.net
msdn.microsoft.com codeguru.com