10

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?

5
  • Does it still run if you start it manually? Have you tried recompiling it into a new EXE? Jun 4, 2013 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, 2013 at 19:32
  • Have you done a disk check recently? Jun 4, 2013 at 19:33
  • @techie007, I did run sfc, but it said it found corrupt files it couldn't repair.
    – mowwwalker
    Jun 4, 2013 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? Jul 2, 2013 at 12:04

6 Answers 6

9
+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!

4
  • 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... Sep 21, 2017 at 12:03
  • 1
    Yes, my mistake, i have corrected it. :-) thank you Sep 22, 2017 at 8:11
  • 1
    actually UNCHECKING ru as admin fixed this problem for me
    – niico
    Apr 14, 2020 at 15:21
  • but why does having a shortcut with "Run As Administrator" making it unable to autostart?
    – Ooker
    Aug 18, 2022 at 7:00
1

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

1
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
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
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .