Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1840
  • Last Modified:

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.
0
murryc
Asked:
murryc
  • 3
  • 3
1 Solution
 
Enigma2001Commented:
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
0
 
Enigma2001Commented:
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
0
 
murrycAuthor Commented:
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?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Enigma2001Commented:
Try this one.

I've also cleaned up a couple of bugs I noticed such as if the user clicked cancel while entering a username or domain it would set those values in the registry to null. ... however please not this will still happen on the password prompt.
AutoLogin.txt
0
 
murrycAuthor Commented:
Perfect!
0
 
murrycAuthor Commented:
Very good VB programmer.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now