Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Starting at Startup

Status
Not open for further replies.

FuzzBall5

Programmer
Feb 5, 2003
1
RO
I was wondering if there was a way to make it so that my qbasic program (that I compiled) starts up when Windows loads via editing the qbasic code. If so what would I put as the code? Thanks
 
you would have to write to autoexec.dat using SHELL, it would be easier to do it in the DOS environment
 
quote: you would have to write to autoexec.dat using SHELL, it would be easier to do it in the DOS environment

The file is actually autoexec.bat.
 
There are others way to do it:
- one way is to edit your msdos.sys, but that means that your program will be used as a shell-program.
- one other way is to make a pif-file in windows say on your desktop. You will have to edit this file. Just for the record, I'm Dutch and I use Dutch programs but I will try to help you. If you make a pif-file from qbasic.exe or QB.exe and it is on your desktop, you click on it with your right mouse button and click in the menu on settings or something, it should be on the bottom of the menu. In the box with 'Target:' you see the path and exe file e.g. 'Target: c:\dos\qbasic.exe' this is it.
you change this to 'Target: c:\dos\qbasic.exe c:\path\programfile.bas' then you press OK and move it into your startup menu of the startmenu.

Good luck!

Balai
 
Make sure to make a backup before you mess with system files!!!!
 
TO Balai:

Ummm, if it's Win 3.x, you should NOT edit MSDOS.SYS nor IO.sys.

You'll need to edit the file Command.com and change it to start your "batch" file instead of autoexec.
(Note: your batch file doesn't need to have a .BAT extension either. ;-))

Then, conclude your "batch" file by simply CALLing or directly running AUTOEXEC.BAT from within it. That way, the user can change the autoexec all they want, but your batch will:

1) remain hidden [for lack of a better word] and unchanged [unless you change it], and

2) will always run prior to running autoexec.bat.

TO FuzzBall5:

There is a way (other than those mentioned above) that will work on Windows 3.x, 95, 98, 98se, and ME (I'm unsure about NT, XP or 2000 machines). But, you have not shown any interest nor responded since you initially posted this question. So, I will presume that you have found your answer elsewhere, and I'll leave it at that.

--MiggyD
 
>Quebasic2 "In windows 98 and up, you can not use the autoexec.bat file to load progs when windows starts. It will not load it."

autoexec.bat will run compiled programs in autoexec before
windows shows the desktop. I have a birthday reminder program written in qb4.5 that pauses autoexec and informs me
of whose birthday is near -- "Send Card" each time I reboot.
(if no birthday is within 2 days, program doesnt display
anything or pause autoexec.

oh and am running win98.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top