Link to home
Start Free TrialLog in
Avatar of GreatOne
GreatOne

asked on

Making sure a program ALWAYS runs....

I wrote this program that I want to run everytime I turn my computer on. I know that I can put it in the autoexec.bat but I have been having some troubles with that file recently. So is there any other way to make sure my program will run upon boot?
Avatar of mikecr
mikecr
Flag of United States of America image

If your using Windows, you can put it into the startup group and it will run when Windows starts. The only other way to get it to start in Dos would be to use a call command in the autoexec.bat file to get it to run. I.e, @call c:\runnit.bat. Is this what your looking for?

Thanks,
Mike
Avatar of GreatOne
GreatOne

ASKER

I am trying to avoid putting stuff in my autoexec.bat file. Are you sure there is no other way?
Unless you put it in Windows startup, NO! The bootstrap loader turns control of the PC over to the operating system which in turn automatically runs autoexec.bat and config.sys if they are available. You could create a boot menu that would run a different autoexec.bat file instead of the screwed up one, but there isn't any other way that I know of.

Thanks,
Mike
You say you don`t want to add anything to your autoexec.bat
files, so all I can suggest is to add the program to your
windows "startup" group.This will launch the program every
time you`re running windows:
1)press "Start"
2)select "Settings", then "Taskbar", click-on "Taskbar"
3)press "Start menu programs" tab
4)press "add"
5)type-in the path to the program, eg;C:\windows\myprogram\my.exe
6)scroll down to folder called "StartUp"(NOT to be confused
with "Start Menu")
7)highlight this folder and press "next"
8)Select a name for your program
9)Pick an icon you like and press "Finish"
10)Press "OK" and you`re done! This program will now always
auto-start whenever Windows is running.

PS: If it`s a Dos program you want to always run, you`ll have to edit your autiexec.bat file;-)
One other way if running windows; create a winstart.bat file in windows directory. Will execute winstart.bat command before launching windows.

NO OTHER WAY!!

CR
GreatOne,
   Am I correct in assuming that this program is DOS?If so,
will it run in a dos-window? I have, I THINK, one other way
for you to do this.It`s rather inelegant, sort of a "Rube
Goldbergish"-type of setup, but MIGHT allow your computer to
launch a dos-program upon start-up without editing/creating any autoexec.bat/dosstart.bat files. It`s only theory, but I
think it *might* work.It would help if we knew a little more
about the program you want to auto-start, and it certainly wouldn`t hurt to post your existing autoexec.bat file here
for analysis.By far, the easiest way, is for you to "call"
the program in your autoexec.bat files...if you are "having
problems" with your current file, maybe we can help solve
what might be an existing *problem*, so that you could go
forward and call the program in your autoexec.bat file in a
more "accepted" and S.O.P.-type of way, rather than bastard-
ize some other part of your system, just to get this program
to launch automatically.More info would be helpful;-)
Tylox,
You want more info, well here you go. I wrote a little program for DOS that will change the background if it is a certain date. I want to put this on my friends computer but don't want him to know its there. He has problems with viruses in the past and now always checks what files are on his computer. He particularly checks the contents of autoexec.bat and config.sys. If i were to put in the windows start up group, he would see it running and would probably think its a virus. So that's the info. What would you do?

  If you have access to your "friend's" autoexec.bat file, look to see if he's launching anything that he doesn't absolutely need. (e.g., MSCDEX, SMARTDRV, DOSKEY) If so, rename your program to one of those, put it in the proper path... Well, you get the idea...  Might fool him for a while....

  If you've compiled it as a DOS program, and it's made to run in the background, do its thing and close, you might have to create a pif so it doesn't open a window. Regardless... your best bet, (if he ain't too sharp) is add it to the Run or Launch line in WIN.INI, or go with the WINSTART.BAT idea...
Now that you`ve "come clean"<g>regarding what it is you really
want to do, the fact that you want to hide the program`s very
existance from an obviously paranoid and rather overly diligent
friend, pretty much eliminates doing what *I* had in mind.You
might as well reject my answer now, and put it back up for the
others to take a stab-at.Sorry I couldn`t help you:-(

 Launch line? Meant to say Lunch line.

ASKER CERTIFIED SOLUTION
Avatar of Dane Pickering
Dane Pickering

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial