122

On previous versions of Windows I have used the below technique to run a batch file on Windows startup.

  1. Create a shortcut to the batch file.
  2. Once the shortcut is created, right-click the shortcut file and select Cut.
  3. Click Start, then Programs or All Programs. Find the Startup folder and right-click that folder, then select Open.
  4. Once the Startup folder is opened, click Edit in the menu bar, then Paste to paste the shortcut file into the Startup folder. If you do not see the menu bar, press the Alt key to make the menu bar visible. Any shortcuts in the Startup folder will automatically run each time the user logs in to Windows.

I have been unsuccessful in finding how to do something similar on Windows 10.

Any ideas?

baynezy
  • 1,361
  • 2
  • 10
  • 9

6 Answers6

174

The startup folder is still there and functions as normal.

To access it, press Windows+R, then type shell:startup.

You should be able to do what you were previously doing in Windows 7 from there.

  • 40
    The problem with this `shell:startup` is that it's user dependent (when another user logs on to your computer, the program does not start up), in case you want to start up a program when your computer starts up, regardless of the user, you might add a shortcut in directory `C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup`. – Dominique Apr 28 '17 at 07:12
  • 8
    any way to run this as an administrator? – phil Nov 03 '17 at 00:13
  • 5
    @phil you should open a new question - but to answer your question: make a shortcut to your exe/bat file (right click > create shortcut to), then right-click on the shortcut > Properties > Advanced > Run as administrator. – glenneroo Mar 26 '19 at 23:41
  • I just tried this because after updating W10 (to version "20H2" from an old one, 1607) the script (Autohotkey) no longer ran. Putting it in this folder (C:\Users\USER\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup) no longer seems to work. – mike rodent Feb 19 '21 at 18:51
  • It seems when you check such a startup file to run as an administrator, the file is simply ignored. So is there a way to force it to run as an administrator anyway? – Jerry Green Feb 27 '22 at 20:38
  • 2
    @JerryGreen @phil you should use a Scheduled Task to run as an Administrator. You can set login as a trigger and configure the user context it will run as, tick `Run with highest privileges`. – Baa Jul 11 '22 at 11:15
  • @Baa, it indeed works! thx – Jerry Green Sep 17 '22 at 05:09
50

You can use scheduled tasks and set it to run at startup.

Go to ManageScheduled TasksCreate a Basic Task.

Once at the dialog box, set a name, click Next and select at startup, Next again and select the program you want to run and next to finish. Done!

Peter Mortensen
  • 12,090
  • 23
  • 70
  • 90
sarakusta
  • 503
  • 3
  • 4
10

To add to user314352's answer:

The startup folder is still there and functions as normal.

To access it, press Windows+R, then type shell:startup.

You should be able to do what you were previously doing in Windows 7 from there.

You can also type shell:common startup to access the startup folder for all users.

Kim
  • 103
  • 4
Azeezah M
  • 101
  • 1
  • 2
7

If you don't have access to Windows+X functionality, you can navigate manually to the two startup folders:

  • User: C:\Users\USER\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
  • All users: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

Here's a useful batch file to open either or both of these folders:

rem Load the current user Start folder
%SystemRoot%\explorer.exe "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup"

rem Load the "All Users" Start folder
%SystemRoot%\explorer.exe "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\StartUp"

Note: Above applies to Windows 8.1 and Windows 10 (and maybe earlier versions).

AlainD
  • 4,447
  • 15
  • 49
  • 96
  • I just tried this because after updating W10 (to version "20H2" from an old one, 1607) the script (Autohotkey) no longer ran. Neither of these folders worked. – mike rodent Feb 19 '21 at 18:49
  • You mean neither of these folders are available? Where does `shell:startup` and `shell:common startup` take you? – AlainD Feb 19 '21 at 21:38
  • No, they're there all right. Just found that only the "common startup" location works, and that's after reinstalling Autohotkey (as admin). See my question and answer here: https://superuser.com/q/1627437/419196 – mike rodent Feb 20 '21 at 08:54
4

I have an MSI motherboard that is not playing nice with my beloved Gateway Anykey keyboard. Num Lock won't turn off at boot.

I added a "NumLock Off" utility to the shell:startup folder. No help. I added it to Scheduled Tasks and that worked. BTW, I couldn't schedule a shortcut to the utility. I could only schedule a batch file with the numlock.exe file and the "off" parameter on the command line.

Peter Mortensen
  • 12,090
  • 23
  • 70
  • 90
Al Pomey
  • 41
  • 1
  • @Peter thanks - the insert key dies today: https://superuser.com/questions/31794/windows-insert-key-anti-functionality-accidentally-triggers-how-to-stop-it-perm#answer-31797 – combatc2 Mar 04 '21 at 16:26
2

Alternative through Group Policy

gpedit: Local Computer Policy > Computer Configuration > Windows Settings > Script (Startup/Shutdown)

user.dz
  • 668
  • 7
  • 19