Click to See Complete Forum and Search --> : Run DOS program before windows


Waldo2k2
September 14th, 2002, 04:50 PM
I want a program to run after the POST test, but before windows begins to load. I know this can be acheived with batch files, but how? How do i get a batch file to run when you turn the computer on? (besides going into dos mode and typing in the command) If i can just edit an existing batch file that'd be fine too, all i need to do is insert a command to run a program. thanks for any help you can give me.

cup
September 15th, 2002, 01:26 AM
On win 3.x, 95 & 98, just stick it into autoexec.bat.

Don't know about NT, ME, 2K & XP although ME might be the same as 98.

Bob Davis
September 15th, 2002, 10:46 AM
Me is exactly the same as 98 in this regard. Unfortunately, for NT/2000/XP, there's not much you can do. In Win9x, after POST, DOS is loaded, and the autoexec.bat is run, which contains a line to load Windows. NT/2000/XP have no underlying DOS layer. This means that after POST, the first and only thing that gets loaded is Windows itself. I'm not sure if there's a way to supercede this or not; you may want to try a question in a Windows programming forum for more specialized people to help you.

Waldo2k2
September 15th, 2002, 01:00 PM
thanks for all the feedback, i knew it was autoexec.bat, however i wasn't sure because if i did a windows search for the file, opening it actually atempted to run the batch file, not edit it. But the little light bulb turned on so i went to dos prompt and typed EDIT autoexec.bat and did what i needed. Just one question though, should I load my program first before any other commands or not?

cup
September 16th, 2002, 06:43 PM
I don't think it matters whether your program is run first or not: as long as it returns. If it doesn't return, windows will not boot up. If it is just a TSR installation, it doesn't matter when it is executed.

Yves M
September 16th, 2002, 08:08 PM
In WinNT / 2K / XP you can write a service and make it load at boot time. This is not exactly before everything else, but depending on what you want to do it might be OK.

dimm_coder
September 17th, 2002, 05:19 AM
It is not simple service, it's kernel driver (driver service).
Only kernel drivers can be successfully loaded at boot time. It can not use for exemple win32-subsystem calls because at boot time win32-subsystem also not loaded.