To run a batch file at start up: start >> all programs >> right-click startup >> open >> right click batch file >> create shortcut >> drag shortcut to startup folder.
The path to the folder is : [D|C]:\Profiles\{User}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
There are a few ways to run a batch file on start up. The one I usually use is through task scheduler. If you press the windows key then type task scheduler it will come up as an option (or find through administerative tools).
When you create a new task you can chose from trigger options such as 'At log on' for a specific user, on workstation unlock etc. Then in actions you select start a program and put the full path to your batch script (there is also an option to put any command line args required).
Here is a an example script to launch Stack Overflow in Firefox:
@echo off
title Auto launch Stack Overflow
start firefox http://stackoverflow.com/questions/tagged/python+or+sql+or+sqlite+or+plsql+or+oracle+or+windows-7+or+cmd+or+excel+or+access+or+vba+or+excel-vba+or+access-vba?sort=newest
REM Optional - I tend to log these sorts of events so that you can see what has happened afterwards
echo %date% %time%, %computername% >> %logs%\StackOverflowAuto.csv
exit
I had the same issue in Win7 regarding running a script (.bat) at startup (When the computer boots vs when someone logs in) that would modify the network parameters using netsh. What ended up working for me was the following:
Log in with an Administrator account
Click on start and type “Task Scheduler” and hit return
Click on “Task Scheduler Library”
Click on “Create New Task” on the right hand side of the screen and set the parameters as follows:
a. Set the user account to SYSTEM
b. Choose "Run with highest privileges"
c. Choose the OS for Windows7
Click on “Triggers” tab and then click on “New…”
Choose “At Startup” from the drop down menu, click Enabled and hit OK
Click on the “Actions tab” and then click on “New…”
If you are running a .bat file use cmd as the program the put
/c .bat
In the Add arguments field
Click on “OK” then on “OK” on the create task panel and it will now
be scheduled.
Add the .bat script to the place specified in your task event.
Another option would be to run the batch file as a service, and set the startup of the service to "Automatic" or "Automatic (Delayed Start)".
Check this question for more information on how to do it, personally I like NSSM the most.
RunOnce is an option and have a few keys that can be used for pointing a command to start on startup (depending if it concerns a user or the whole system):
With setting and exclamation mark at the beginning and if the script exist with a value different than 0 the registry key wont be deleted and the script will be executed every time on startup
You also have two startup folders - one for the current user and one global.
There you can copy your scripts (or shortcuts) in order to start a file on startup
::the global one
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
::for the current user
%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup