This guide shows you how to make any program, script, or file launch automatically when Windows starts, by adding a single entry to the registry. You’ll edit the Run key, which Windows reads at every logon. You need administrator access to the computer, and you should know the full path to the executable you want to start.
What You’ll Need
- A Windows PC (any recent version: 10, 11, 8, 7)
- Administrator account privileges
- The full path to the program you want to run (e.g.,
C:\Program Files\MyApp\app.exe) - Optional: a text editor to create a .reg file for easier editing
Step-by-Step
- Open the Registry Editor. Press Win + R, type
regedit, and press Enter. Click “Yes� if prompted by User Account Control. - Navigate to the Run key. In the left sidebar, expand folders in this order:
HKEY_CURRENT_USER→Software→Microsoft→Windows→CurrentVersion→Run. (For all users, useHKEY_LOCAL_MACHINEinstead ofHKEY_CURRENT_USER.) - Create a new string value. Right-click on the
Runfolder (or in the empty space on the right pane), select New → String Value. Name it something descriptive, like “MyAppStartup�. - Set the value data. Double-click the new value. In the “Value data� field, type the full path to the program, enclosed in quotes if it contains spaces. For example:
"C:\Program Files\MyApp\app.exe". Click OK. - Test it. Restart your computer or log off and back on. The program should launch automatically.
- Optional: Add command-line arguments. If the program needs flags, add them after the path, still inside the quotes if the path has spaces. For example:
"C:\Program Files\MyApp\app.exe" -silent.
Common Mistakes
- Wrong registry hive. Using
HKEY_CURRENT_USERonly affects the current user; if you want it for all users, useHKEY_LOCAL_MACHINE. - Missing quotes around paths with spaces. Windows will fail to find the file if you omit the quotes.
- Typing the wrong path. A single typo in the path will silently prevent startup. Always copy the full path from the file’s properties.
- Using a relative path. Registry Run entries require absolute paths (e.g.,
C:\...). - Adding a value that already exists. If you reuse a name, it overwrites the previous entry. Use a unique name.
Tips
- Use a .reg file for easy removal. Create a text file with the following content, then double-click it to import:
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] "MyAppStartup"="\"C:\\Program Files\\MyApp\\app.exe\""
- Add a delay if the program needs it. Windows doesn’t have a built-in delay, but you can use a command like
timeout /t 10 & "C:\...\app.exe"in a batch file and point the registry to that batch file. - Test with a harmless program first. Use Notepad or Calculator to verify the process works before applying it to a critical app.
- Keep a backup. Before editing the registry, export the
Runkey (right-click → Export) so you can restore it if something goes wrong.
Troubleshooting
- Program doesn’t start. First, check the path in the registry value. Right-click the value, select Modify, and verify it matches the exact file location. Also, confirm the program works when launched manually.
- Program starts but then crashes. Some programs need to run as administrator or require a specific working directory. Try adding
/d "C:\Program Files\MyApp"(for some executables) or use a shortcut that sets the working directory. - Registry changes don’t take effect. Make sure you’re editing the correct hive. If you edited
HKEY_CURRENT_USER, it only applies to the logged-in user. If you’re testing on a different account, useHKEY_LOCAL_MACHINE. - “Access denied� when editing. You need administrator rights. Right-click regedit and select “Run as administrator�.
- Program starts twice. Check if the program also has a startup entry in the Startup folder or in Task Manager’s Startup tab. Remove the duplicate.
Frequently Asked Questions
Is it safe to edit the registry?
Yes, if you follow the steps carefully and only change the Run key. Always export a backup before making changes.
What’s the difference between HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE?
HKEY_CURRENT_USER runs the program only for the currently logged-in user. HKEY_LOCAL_MACHINE runs it for all users, but requires administrator rights to edit.
Can I add a program to startup without using the registry?
Yes, you can place a shortcut in the Startup folder (shell:startup). The registry method is more flexible because it allows command-line arguments and works for scripts.
How do I remove a startup program from the registry?
Open the Run key, right-click the value you added, and select Delete. Confirm the deletion. The program will no longer start automatically.
Will this work for scripts or batch files?
Yes, point the registry value to the script’s full path, e.g., "C:\Scripts\startup.bat". Ensure the script has the correct extension and is executable.
Can I use environment variables in the path?
Yes, Windows expands variables like %ProgramFiles% in registry values. For example, "%ProgramFiles%\MyApp\app.exe" works.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Google Desktop Search Widget on Windows 11
- WhatsApp: How to Block Unknown Numbers
- How to Exit Vi in Linux: A Simple Guide
- iPhone Stuck on Setting Up Apple ID: Fixes
- How to Build a Computer Stand (Saturday Workshop)
- Customize Touch Keyboard Themes in Windows 11