How to let windows automatic execute a bat file after startup

How to let windows automatic execute a bat file after startup?


Thanks
steven98Asked:
Who is Participating?
 
g00334120Connect With a Mentor Commented:
One way is to place the batch file in the startup folder for windows. Which version of windows are you running?

Another way is to go to the following key in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Create a new key there of type String.

For its data value, type in the full path to the to bat file
e.g.

C:\Windows\mybat.bat

Every time windows loads up, this batch file will run.
0
 
_iskywalker_Commented:
easier would be to put into autostart folder.
Just open windows explorer (start->run: explorer)
and copy your batch to the folder autostart
the location of autostart depends on which windows version you are using: in win9x was in windows\menu
in win2000 xp it is better you put in default user folder since it wil start for all users, if you want for one user you put it in in the user folder like:
c:\Documents and Settings\Doctor\Startmenu\Programs\autostart
so just put the batch in this folder.
0
 
Michael PfisterCommented:
Both methods above require that a user logs on. If this is a problem you can use the Task Scheduleder and tick the "At System Startup" option.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
fixnixCommented:
autostart?  Never saw that in English versions of XP/2k, anyway...might be the case in other languages.

location here is:

C:\Documents and Settings\<username>\Start Menu\Programs\Startup

Also, I believe placing it in "Default User" will only take effect for users created after the changes were made (It's like a template).
Placing your .bat in "All Users" will take effect for everyone immediately upon next login by anyone.

C:\Documents and Settings\All Users\Start Menu\Programs\Startup
0
 
JamesHarrisonCommented:
A really nice and neat way of doing this is to use: http://www.duodata.de/ntwrapper/ and create a service from your batch file.  This will then execute the batch file whenever you start the machine, even if a user doesn't log in.

James
0
 
g00334120Commented:
I recommend a split between myself and JamesHarrison.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.