Link to home
Start Free TrialLog in
Avatar of IT CAMPER
IT CAMPERFlag for United States of America

asked on

VBscript to enable / disable auto logon for Windows XP

I need a turnkey VB Script that makes changes to the key...
HLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon

When executed, I need the script to prompt for the following...
Do you want enable auto login?

If yes, then prompt...
Please enter the DefaultDomainName
(import into registry)
Please enter the DefaultUserName
(import into registry)
Please enter the DefaultPassword
(import into registry - this key does not exist on first run)
(set AutoAdminLogon = 1)
Please reboot!

If no, then prompt...
Do you want to disable auto login?

If yes, then..
(set AutoAdminLogon=0)

If no, then exit.
Avatar of Fry
Fry
Flag of Australia image

It should be something like the attached file.

Let me know if it doesn't work as I haven't tried it yet.


AutoLogin.txt
Sorry, had a line in the wrong place on that previous script so it wouldn't disable autologin.

This attached script should work to both enable and disable. I've also added a final question to auto reboot.
AutoLogin.txt
Avatar of IT CAMPER

ASKER

Great Work!  

I failed to ask this, and I can open a new question if you wish.

I will likely be using this on a computer that already has auto enabled, so when I go back to re-enable I might not know all the login details in order to re-enter them.  Is it possible for the enable portion to read the registry and return the values already entered and just allow the user to edit the fields?  So in other words, it would work just as it does now, but the default domain, user and pass fields would auto populate based on what the registry already has for those values.  If the registry has nothing, then the field would be blank.

Your thoughts?
ASKER CERTIFIED SOLUTION
Avatar of Fry
Fry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Perfect!
Very good VB programmer.