how to write a batch file to make a program run during boot up in windows???
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how to write a batch file to make a program run during boot up in windows???
Hello all,
i'm not much familiar with batch file programming. Know this only that simple dos command prompt commands are to be written in it.
so i made a .txt file and its content was
Quote:
copy abc.txt C:\
saved it with .bat extension.
the file abc.txt and the batch files were in same directory, so when i executed the .bat file by clicking mouse on it, it copied the abc.txt to C:\.
Fine upto here...
now my questions is that what should be written in this batch file to make it run some executable when the system boots ???
i'll keep both, the .exe and .bat in the same directory so that i won't have to specify the path of the .exe file.
EDIT: In a nutshell: Whatever place that .bat and .exe be (but they must b in the same directory), .bat should make that .exe run and make its entry somewhere such that .exe file runs everytime i boot the machine.
According to the OS version, the interface and naming might change. Also, it isn't necessary to know the registry folder.
In Start -- settings -- taskbar and start menu, look for a "folder" (need not be a directory) called as "startup". Puta link to your programme there being sure to specify that the startup folder os your folder.
According to the OS version, the interface and naming might change. Also, it isn't necessary to know the registry folder.
In Start -- settings -- taskbar and start menu, look for a "folder" (need not be a directory) called as "startup". Puta link to your programme there being sure to specify that the startup folder os your folder.
End
Hi,
I think you are talking about this startup folder (windows XP)
Quote:
C/Documents and Settings/Bond/Start Menu/Programs/Startup
which makes the programs run during boot up.
So is not there any way for a .bat file to put something there to let the .exe run everytime the machine boots up ???
Re : how to write a batch file to make a program run during boot up in windows???
An alternative way is
open command prompt by start -> run -> cmd & enter
cd into c:\ drive
type edit autoexec.bat & enter
a text editor will open where you can write commands and then save the file
the commands will be run during startup
for instance to run aaaaa.exe on startup in c:\aa\bb dir
add the following line
C:\aa\bb\aaaaa.exe
Thanks for the responses.
I appreciate your ideas. But i'm looking something else....something related with [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
in regedit, browse to [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
edit: or [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run] /edit
right click in the part of the window displaying the keys contained in ...\Run
select New-->String Value
name it whatever you want
right click the new value, and select Modify
enter the path to your batch file in the "Value Data" field. edit: or just directly to the exe /edit
in regedit, browse to [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
edit: or [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run] /edit
right click in the part of the window displaying the keys contained in ...\Run
select New-->String Value
name it whatever you want
right click the new value, and select Modify
enter the path to your batch file in the "Value Data" field. edit: or just directly to the exe /edit
voila!
hi,
the same thing i wud like to implement using programming and not manually.
Hi,
for C/C++ you should have a look at this site: http://msdn.microsoft.com/library/de..._functions.asp
Especially the functions: RegOpenKey,RegSetValue,RegQueryValue (or the extented versions ...Ex) and RegCloseKey.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.