Jump to content
Sign in to follow this  
scllc

Windows Auto Login with prompted Username

Recommended Posts

scllc

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.

Share this post


Link to post
Share on other sites
Jos

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  

×