Help, Task Scheduler won't run a program at startup!

Page 1 of 2 12 LastLast

  1. Posts : 116
    Windows 7 Home Premium 64bit
       #1

    Help, Task Scheduler won't run a program at startup!


    I'm trying to use Task Scheduler to run a program at startup, but it doesn't work.

    It works if I change the trigger from "at system startup" to "one time". But it never works at startup.
      My Computer


  2. diz
    Posts : 49
    Windows 7 Ultimate 64-bit SP1
       #2

    Make sure you select "Run with the highest privileges" and "Configure for windows 7..."

    Here's how:
    Task - Create to Run a Program at Startup and Log On
      My Computer


  3. Posts : 714
    Win 7 Pro, SP1, x86, Win-11/Pro/64
       #3

    Marty McFly said:
    I'm trying to use Task Scheduler to run a program at startup, but it doesn't work. It works if I change the trigger from "at system startup" to "one time". But it never works at startup.
    Marty, you DO realize that in all versions of Windows there is a "Startup" folder, Eh?
    If I want something to run at startup, I just put a shortcut to it in the "Startup" folder and it's DONE.
    I have three different things running at startup on my own PC, all from the "Startup" folder.

    Try it, you'll like it!

      My Computer


  4. Posts : 116
    Windows 7 Home Premium 64bit
    Thread Starter
       #4

    diz said:
    Make sure you select "Run with the highest privileges" and "Configure for windows 7..."
    Thank you very much but I already did both these and it doesn't run at startup.

    TechnoMage2016 said:
    Marty, you DO realize that in all versions of Windows there is a "Startup" folder, Eh?
    Thank you but I don't like the Startup folder and I removed it. I like my Start Menu to be nice and neat and every folder to contain useful links that I use regularly - having a Startup folder just clutters it unnecessarily and makes it a little harder to find the folder I'm looking for when I use the Start Menu.
      My Computer


  5. diz
    Posts : 49
    Windows 7 Ultimate 64-bit SP1
       #5

    What program are you trying to execute?

    If your program doesn't need admin rights you can starting it from the registry.

    Execute "regedit.exe", and go to:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
    Create a new string value, wich its value is the full path to your program.

    Or make a "file.reg" with the following, modify the path and double click on it:
    --------------------------------------------------------------
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
    "myprog"="\"c:\\path\\to\\program.exe\""
      My Computer


  6. Posts : 116
    Windows 7 Home Premium 64bit
    Thread Starter
       #6

    diz said:
    What program are you trying to execute?
    AutoHotKey, for custom keyboard shortcuts.

    diz said:
    If your program doesn't need admin rights you can starting it from the registry.
    I followed your instructions and it worked!

    Thank you!
      My Computer


  7. Posts : 116
    Windows 7 Home Premium 64bit
    Thread Starter
       #7

    I've just realised that the program doesn't quite run properly unless it has admin rights.

    Do you know any way to use the registry to make it launch with admin rights?
      My Computer


  8. diz
    Posts : 49
    Windows 7 Ultimate 64-bit SP1
       #8

    Ok, I downloaded and test my own autohotkey script task. There's indeed a problem.

    Windows execute the script with high privileges as expected, but the problem is that the icon tray its not showing up.

    In this thread speak about the issue and found a solution that didn't work for me: https://www.autohotkey.com/boards/viewtopic.php?t=82981


    So, I found a workaround, it's a two steps solution:
    ---------------------------------
    Step 1 - Do the task with no trigger:
    - general: name your task, select Run with highest privileges, and Configure for: windows 7
    - trigger: nothing
    - actions: put the program ..\AutoHotkeyU64.exe from whatever folder you put it, and as Add arguments put the full path to your script.
    - conditions: nothing
    - Settings: select If the task fails, restart




    Step 2 - Start the task from the registry:
    - execute regedit.exe
    - go to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
    - add a new string value and as a value put: schtasks /run /tn "my autohotkey task"

    (the name must be the same you use when you create the task in task manager, if you put it in a custom folder just add it as a prefix to the name like this "my custom folder\my autohotkey task" ) . Doble quotes are important if your task contain spaces)




    And that's it. Your autohotkey script now must be running, with the tray icon showing and with full privileges.
    Last edited by diz; 06 Oct 2021 at 12:31.
      My Computer


  9. Posts : 116
    Windows 7 Home Premium 64bit
    Thread Starter
       #9

    Hi Diz and thanks so much for your help here! Gracias!

    I know that you updated your above answer. I had actually read the original answer yesterday, and had already followed the steps you gave to use Task Scheduler alone. I was waiting for the next reboot to see if it worked.

    To my surprise, when I booted this morning, it worked! It started up fully, with admin rights, including the system tray icon!

    I wasn't expecting it to work, as your instructions were more or less exacly what I'd already been doing, including "Run with highest privileges", configuring for "Windows ® 7 [etc]" and the "retry every minute" thing. The only thing I hadn't been doing was the trigger being for the specific user, which I did this time. So I guess that made the difference!?

    Why it worked for me and not you, I don't know. I also wonder if it will work every time, because there often seems to be an inconsistency to how things boot on my machine. So I'm glad you offered the above alternative solution! I may well need it. I'll report back here on whether this continues to work.

    As for that AutoHotKey forum thread, the forum seems to be down right now so I can't see it.
      My Computer


  10. Posts : 116
    Windows 7 Home Premium 64bit
    Thread Starter
       #10

    Well I'm happy to report that the 100% Task Scheduler method seems to be working perfectly for me now!

    Again, I believe the key detail was to set the trigger to be for the "specific user"!

    Thank you once again, Diz!
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 21:07.
Find Us