Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Starting at Startup

Starting at Startup

Starting at Startup

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

RE: Starting at Startup

you would have to write to autoexec.dat using SHELL, it would be easier to do it in the DOS environment

RE: Starting at Startup

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.

RE: Starting at Startup

my mistake - it is a batch file, not data.   Oops

RE: Starting at Startup

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!


RE: Starting at Startup

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

RE: Starting at Startup

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.


RE: Starting at Startup

>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.

RE: Starting at Startup

Thanks for the tip buff1.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close