Jump to content

Autorun on boot


Recommended Posts

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

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

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...