How can I "comment out" files in the Startup folder in Windows?

How can I get Windows to ignore certain files in the Startup folder?

Simply put, I want to comment out files as one comments out lines of code... Something that works like .gitignore, but for Windows.

My situation:

I am trying to get Windows to ignore some files in the StartUp folder and not execute them during startup. Due to certain reasons, I am reluctant to actually remove these files from the StartUp folder. Nesting these files inside another folder in the StartUp folder doesn't work as then that folder opens up at startup. A workaround I have found is the marked answer here, but this does not work for shortcuts.

If possible, I would prefer a solution which can to used to get other scripts to ignore files too.


Solution 1:

A simple solution: Right-click the shortcut, select Properties, and in the General tab set the shortcut to Hidden, then click OK.

I have just tested it, and it works - a hidden shortcut is not used when booting.

The folder I did it on was
C:\Users\USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup.

To undo, in order to see in Explorer the hidden files, you need in View tab > Options button > View tab to set "Show hidden f‌iles, folders and drives".

Solution 2:

Just use the standard startup configuration tools.

This used to be handled by msconfig, which used to have a Startup tab where you could uncheck individual startup items to disable them. This goes way back to Windows XP at least (perhaps even 95 or 98). However, as @Scott pointed out in the comments, running msconfig requires administrator rights.

In Windows 8 and later, this got moved to the Task Manager which got a Startup tab for the same purpose. This move also made it available for non-administrators.

Disabling an item here doesn't alter the link in the Startup folder in any way. It just configures Windows not to run it (via the registry).