When MacOS boots up and the users is prompted to select the account (s)he wants to login into, the users can either click the name / icon of the account with the mouse or just type in the name of the account.

I want to do the same at the login screen of Windows7: Login screen pops up, I start to type my account name, I select the account with enter and then I type the password and enter again. No usage of the mouse involved.

(I am aware of tab-cycling and hard-to-follow-the-almost-invisible-marker-of-where-the-focus-is-right-now)

  • 3
    Microsoft hasn't thought about this. Seems there is absolutely no solution :). Except for going classic login, which makes you type your WHOLE login.
    – sinni800
    Jan 26, 2011 at 14:43
  • @sinni800: thats what the bounty is for, if it would be easy i would have found the solution myself :)
    – akira
    Jan 26, 2011 at 14:46
  • Should I feel challenged to program a new login screen now?
    – sinni800
    Jan 26, 2011 at 14:48
  • 2
    Only thing is that I can't do it. Maybe Mark Russinovich, the Windows and Windows Api Guru, could :)
    – sinni800
    Jan 26, 2011 at 15:18
  • 1
    @akira: Source of above: stackoverflow.com/a/3143055/47064 Mar 26, 2012 at 15:24

3 Answers 3


You are looking to writing a specialized Credential Provider. I an not going to write one for you, not even for 5000 reps, but I can point you in the right direction.

The article Create Custom Login Experiences With Credential Providers For Windows Vista explains the basics of Microsoft's move away from the earlier GINA model. It develops a sample which demonstrates the new features via a hybrid credential provider that allows a user name, password, and domain name to be stored on a smart card, so that upon insertion of the card, the user is automatically logged on.

Microsoft also provides for download Credential Provider Samples, which include an overview document describing how to build them.

If you do intend to develop your Credential Provider, I suggest strongly to debug it inside a virtual machine, for obvious reasons.

  • 4
    I'd consider it for 5000 rep ;)
    – th3dude
    Jan 26, 2011 at 15:35
  • finally someone with the right pointers.
    – akira
    Jan 26, 2011 at 15:39
  • You could read this article too: paralint.com/blog/2009/02/24/…
    – Joe Taylor
    Jan 26, 2011 at 16:33
  • Suggesting credential providers is a good idea. It would be one heck of a lot of work, but would be nifty if somebody did make one which worked like this.
    – nhinkle
    Jan 27, 2011 at 7:53
  • 1
    @akira: Yes, you had to click on the Bounty button. This is buried somewhere in the FAQ.
    – harrymc
    Feb 2, 2011 at 19:57

Thinking about this again, there are much easier ways to accomplish this:

  1. Option one (Confirmed): A good old trick to get a program to run on the login screen. :-)

  2. Take ownership of and replace %WINDIR%\System32\osk.exe by the program from step 4.

  3. Go to the Ease of Access Center, Use the computer without a mouse or keyboard.

  4. Enable Use On-Screen Keyboard.

  5. Save and go back, at the left side click Change administrative settings.

  6. Click to apply the settings to the logon desktop and save.

  7. Option two (Should work): Services always run, so they can start programs on the login screen.

  8. Write a service C / C# that starts early, perhaps set it's start type to boot in the registry.

  9. Let the service detect C / C# when winlogon.exe is started, after which it starts our program.

  10. Option three (Doesn't seem to work): The Task Scheduler provides options for it, I have tried started based on "Startup" and on the "Winlogon WGA Event" but both didn't succeed, perhaps I need to set another user than "System" for this to work... Alternative: Winlogon Notification DLL

  11. This allows us to run our own written program at the login screen!

    • Using SetWindowsHookEx you could create a WH_KEYBOARD hook to handle input.

      • Alternative: Create a GUI window and give that window focus.
      • Alternative 2: If you hide the users you can track the username box, see AutoItX below.
    • Using WMI you could enumerate all the local users.

    • Calling AutoItX functions allows you to manipulate the Windows Login Screen from your app. This will also allow us to detect if we are at the login screen by checking if explorer runs.

      AutoItWindow shows that the screen is: Class: AUTHUI.DLL: LogonUI Logon Window and the password field is named Edit1, so you can actually read the typed data.

    In this way, you should be able to run a program that listens for the characters you type, retrieve the list of accounts and when it finds a match would autocomplete the appropriate account.

    I would suggest C++ (Native) or C# (PInvokes for API calls, easy WMI) but any language might fit...

  12. Alternative:

I think it might be possible to only use a compiled AutoIt script to accomplish this task, as you can track and manipulate the username box and also enumerate WMI, which is the sole thing you need to get this working. Perhaps you need to disable the tray icon feature though...

You can use AutoIt Window Info (place it as osk.exe) to see the class names at the login screen.

  • 3
    Very interesting... I'd like to see if this works... maybe even blog worthy ;) Feb 1, 2011 at 1:25
  • Interesting. Anyone care to try it in a VM? I'll stick to having my name at the beginning of the alphabet.
    – digitxp
    Feb 1, 2011 at 1:26
  • Or as an alternative, set the file back using your installation CD/DVD. :-) Feb 1, 2011 at 2:40
  • 1
    I tried the osk trick, and it doesn't work in Windows 7. Although I took ownership of osk.exe, Windows 7 will not let me change it in any way. The hacks proposed in this answer are prevented by Windows 7, since otherwise it would be quite easy for viruses to capture user passwords. The only legal and working solution is writing a Credential Provider - there is no other way.
    – harrymc
    Feb 1, 2011 at 6:53
  • 1
    @sinni800: You are right about the permissions. However, when I replaced osk.exe by notepad, nothing happened. In any case, this solution is a security breach, so may also be invalidated by the next Windows Update. It will certainly be signaled by an "sfc /scannow". Not recommended, as monkeying with core Windows files is too risky.
    – harrymc
    Feb 1, 2011 at 10:26

Windows Vista and Windows 7 does this out of the box (sort of) for domain logins.

This only works in editions of Windows that support domain join. You may be able to make a script that does this for you on other editions - let me know and I will look in to it.

Launch Group Policy Editor (Start > Run > gpedit.msc).

Look for Computer Config \ Windows Settings \ Security Settings \ Local Policies \ Security Options \ Interactive logon: Do not display last user name, and set this to Enabled

Next time you login, you should be able to type the username you want.

  • This does not provider auto-completion of the user-name at all.
    – sinni800
    Feb 1, 2011 at 10:08
  • But, without getting in to programming, I think it is by far the best solution. Feb 1, 2011 at 10:15
  • 2
    that's not what i want. it does not show the avatars any more, it is just the plain old type in (full) username and password.
    – akira
    Feb 1, 2011 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.