bastian33 Posted January 9, 2017 Share Posted January 9, 2017 Hi all, Newbie here:) I'd like to ask for a little help. I was playing a bit with autoit, trying to create a very simple script that opens webpages. So far so good, but when I tried to have it run on pc boo or Win start, it doesn't. I've tried with adding it to startup folder, as well as registry, but for some reason, it doesn't autorun. Help, pls? #include <IE.au3> RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run', 'AutoClick3', "REG_SZ", @StartupDir & "\AutoClick3.exe") ; or shortcut instead of RegWrite: FileCreateShortcut(@ScriptFullPath, @StartupDir &"\Script.lnk") If Not IsAdmin() Then ShellExecute(@ScriptFullPath, "", "", "runas") ShellExecute ("http://www.google.com") Sleep(3000) ShellExecute ("http://www.google.com") Thanks! Link to comment Share on other sites More sharing options...
Subz Posted January 9, 2017 Share Posted January 9, 2017 Don't you mean @ScriptDir not @StartupDir unless of course you're copying the exe to the Startup folder? Link to comment Share on other sites More sharing options...
bastian33 Posted January 10, 2017 Author Share Posted January 10, 2017 I'm copying it into the Startup folder, thanks. Link to comment Share on other sites More sharing options...
Subz Posted January 10, 2017 Share Posted January 10, 2017 I suppose it all depends on who you're logging in as, the original user or a different user? if you want all users to run this then it should be in the @StartupCommonDir, however whats confusing to me is that, your registry entry points to Startup folder which means that the program would have to run twice. Once via Registry Run and the other via Startup folder. You may also want to try using HKLM for 32-bit entries rather than HKEY_LOCAL_MACHINE and HKLM64 for 64-bit entries. Link to comment Share on other sites More sharing options...
anthonyjr2 Posted January 10, 2017 Share Posted January 10, 2017 If you only have one user on the system, I've had success with: RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run","keyName","REG_SZ",@ScriptFullPath) You could probably replace HKCU with HKLM if you have multiple users, though I forget if it works correctly. UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI= 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