Startup script that logins in a passworded user

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
I've been doing some research on how to login a user profile, then lock the account. I think this can be done by a computer startup script but I'm not sure how to have the startup script login one of the user accounts that has a password.

Any idea how I'd put this in a startup script?
 

masteryoda34

Golden Member
Dec 17, 2007
1,399
3
81
type "netplwiz" in your start menu
uncheck the box labeled "User must enter a user name and password to use this computer"
click ok
you will be prompted to enter the login information for the account you want to automatically log on
windows will now automatically log on to that account upon startup

If you want the account to automatically lock after login set this to run in your startup
rundll32.exe user32.dll,LockWorkStation
 
Last edited:

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
But then that account won't have a password. I'd like it to login with that user, and lock the workstation but retain a password.
 

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
I'm thinking something like the old tweakUI utility that 2k/xp had would do this for me. As I vaguely remember this type of thing being an option to autologin a passworded account, then my startup batch to lock the workstation. I thought Ultimate Windows Tweaker would have the option to login a passworded account but it doesn't appear to.

edit-
I think I found what I needed here http://www.computerperformance.co.uk/windows7/windows7_auto_logon.htm
 
Last edited:

ViRGE

Elite Member, Moderator Emeritus
Oct 9, 1999
31,516
167
106
Edit: I see someone already made my suggestion.
 

masteryoda34

Golden Member
Dec 17, 2007
1,399
3
81
But then that account won't have a password. I'd like it to login with that user, and lock the workstation but retain a password.

The method I described does in fact retain a password. It just doesn't prompt for it. Try it out. It does exactly what you are looking for. I use it myself.
 

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
The method I described does in fact retain a password. It just doesn't prompt for it. Try it out. It does exactly what you are looking for. I use it myself.

So if you have an autolock cmd, you have to reenter your password to unlock it? Because the instructions explicitly said "uncheck the box labeled "User must enter a user name and password to use this computer"". Then you enter your credentials to remove the password.

I know you can LOCK the machine without having a password, but I want it locked and password protected. Perhaps I'm not understanding the instructions but it seems the password is actually being removed, not retained?

I now have my main PC at home logging in automatically, and retaining the password requirement to unlock- using the method I linked. I did this because I wanted to start iTunes automatically but have multiple user accounts on my main PC. I couldn't find a easy, maintenance-free method of starting iTunes as a service. But I have an AppleTV and wanted my media to be shared as long as the PC is turned on.

I also did this to my work laptop, because after a reboot the startup takes ages just to get to the welcome/login screen. Then longer to get to a desktop point where I can WindowsKey+L. Then in the mornings I'm able to walk away only after that point.
I use hibernate a lot, which reduces the need for this trick but now I can hit the power button and walk away in the mornings when I didn't hibernate the day before, and have my machine locked, but also placed Outlook, IE in the startup folder and the numerous default login scripts/services on my slow work HDD can take it's time to load.
 

masteryoda34

Golden Member
Dec 17, 2007
1,399
3
81
The netplwiz utility I referenced is just Microsoft's GUI frontend to the registry settings described in the article. The instructions I gave accomplish exactly the same thing.
 

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
It does work the exact same way. I prefer that method unless there's some group policy set that denies using the GUI method. It also doesn't leave the password out in the open in plain text within the registry (I verified). Blocking the GUI might be the case on my work computer. The instructions on sites didn't make it clear that you specify the user that will be automatically logged in.