Jump to content

Windows Auto Login with prompted Username


scllc
 Share

Recommended Posts

Hi,

I am new to AUTOIT and I'm trying to create a .exe that will prompt for username and then pass it into a reg key.

This what I've got so far

Local $username = InputBox("AutoIt Example", "Please type in the username eg ""XXXX-Till"" and click OK")

#cs

Enables AutoLogon

#ce

RegWrite ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", "1")

#cs

Set USERNAME

#ce

RegWrite ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", "REG_SZ", "$username")

#cs

Set PASSWORD

#ce

RegWrite ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "REG_SZ", "password")

#cs

Set DOMAIN

#ce

RegWrite ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomainName", "REG_SZ", "Domain")

Currently it just sets the DefaultUsername to $username in the reg key

If someone could point me in the right direction that would be great.

Link to comment
Share on other sites

  • Developers

Remove the Double Quotes around the variable name else it is treated as a literal string.

RegWrite ("HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionWinlogon", "DefaultUserName", "REG_SZ", $username)

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...