scllc Posted November 22, 2012 Share Posted November 22, 2012 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 More sharing options...
Developers Jos Posted November 22, 2012 Developers Share Posted November 22, 2012 (edited) 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 November 22, 2012 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 More sharing options...
scllc Posted November 22, 2012 Author Share Posted November 22, 2012 That works a treat many thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now