8

I used Autohotkey to compile an Autohotkey script and placed the compiled program in the Windows startup folder. When I start Windows, however, the program no longer runs (it used to). I also tried placing the program somewhere else and putting a shortcut to it in the startup folder.

How can I figure out what's happening and fix it?

  • Does it still run if you start it manually? Have you tried recompiling it into a new EXE? – Ƭᴇcʜιᴇ007 Jun 4 '13 at 19:20
  • @techie007, It still runs when I run it manually, I haven't tried recompiling. sfc says it found corrupt files but was unable to fix some of them. – mowwwalker Jun 4 '13 at 19:32
  • Have you done a disk check recently? – Ƭᴇcʜιᴇ007 Jun 4 '13 at 19:33
  • @techie007, I did run sfc, but it said it found corrupt files it couldn't repair. – mowwwalker Jun 4 '13 at 22:17
  • Does your program require admin rights (-> UAC)? Does your program require network drives that are not mapped any more? Are there other programs in the startup folder and are they run successfully? – Werner Henze Jul 2 '13 at 12:04
7
+150

You Must be aware that some program needs Administrative privilege to start. Keeping program simply in startup folder doesn't provide the program permission to execute it.

  1. You either need to remove the Option to run program as administrator.

    • To do this, right click and go to property of the program and in Advance button of shortcut, uncheck the Run As Administrator.
    • But this may leads to app not work properly for the task it need administrator privilege.
  2. Another option is to create a scheduled task.

    • Open scheduled task and select the program in new task and execute it on every startup.
    • Since Configuring Scheduled task needs admin privilege already, so your program will be already granted admin permission.

So it will work!

  • 2
    This answer is really mixed-up and sometimes you say the opposite of what you mean (example uncheck=>check). You should correct it and supply full instructions. As it stands, it's not very useful. – harrymc Jun 29 '13 at 15:48
  • Sorry for that but i was in really hurry situation but since i knew that answer, i should tell ans and they'll get; and they did. Next time i'll be careful :) – Dheeraj Thedijje Jul 1 '13 at 8:59
  • How may be disabling of Run as Administrator harmful to anything? The opposite action (enabling it) may be harmful for sure. Disabling it may only cause an app to stop working or behave differently. In fact, you're just decreasing rights an app have, so I cannot imagine how it may be harmful for security... – Dawid Ferenczy Rogožan Sep 21 '17 at 12:03
  • 1
    Yes, my mistake, i have corrected it. :-) thank you – Dheeraj Thedijje Sep 22 '17 at 8:11
1

You could try referencing it directly in the registry key HKLM\Software\Microsoft\Windows\CurrentVersion\Run

1

Run ProcessMonitor and capture a bootlog. Open it and look in the processTree if the exe was ever started and if yes, how long did it run. You can go to the Events and look for details in the Result column.

Watch this video from Mark at TechEd 2013:

http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/WCA-B306

0

I've looked up this issue on lots of websites in the last three days. none of them resolved the issue. Once I lowered the user account control settings, The shortcut then started up properly running as administrator.

0

The program doesn't start automatically because it needs your permission to launch. Change "user account control" to "never notify" and your program will start automatically.

0

To complete @Dheeraj's answer with a third option:

3 dont run AutoHotkey.exe as admin but only the script that needs it.

  • Instead of running C:\Program Files\AutoHotkey\AutoHotkey.exe as admin (by checking the box run as admin in righ click/property), simply add this code somewhere at the top of your script that need to run as admin:
; run script as admin (reload if not as admin)
if not A_IsAdmin
{
   Run *RunAs "%A_ScriptFullPath%"  ; Requires v1.0.92.01+
   ExitApp
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.