Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I would like to automatically run a DOS batchfile at windows98 shutdown- can anyone give me any ideas?

Sure, I do it all the time with both Win 3.1 and 4.1 (a.k.a. 98).
Run Windows from a batch file (autoexec.bat) instead of letting
it start automatically. When Windows is closed, your autoexec.bat
will continue where it left off and you can do as you like.See here:
Windows 95/98/ME Complete MSDOS.SYS ReferenceYou may also need to hack win.com to beat it into shape (I did).
I start Windows only when I want to, and when I close Windows I
have real DOS (entering exit does NOT start Windows).

I have read this thread a week ago. I said I don't think it is a good idea to run windows under the control and with an additional instance of command.com in action. Hence the proposed solution by Laurence is far from satisfactory and, in fact, unsatisfactory.
I now find time to write up here a solution.
Everybody knows, if not read the Howtos of computing.net, how to construct the fully 32-bit lnk/icon for system shutdown via the commandline, namely,
rundll32.exe shell32,SHExitWindowsEx 1
or
rundll.exe user.exe,ExitWindowsAs we target win98, I will stick to the first commandline hereinafter.
Now, the problem of the standard construction seems to be barring a multiple line shutdown process whereby some pre-shutdown batch job can be done before actual shutdown all by one click on an icon. That is why the question raised by John Lewery.
There are many way I can think of to accomplish this. The one (in fact, two) I propose here bears the most resemblance of the standard construction.
[1] Make a batch file, say Master.bat with the following construction :
call [drive:][path]\Slave.bat
rundll32.exe shell32,SHExitWindowsEx 5Note : Why parameter 5, instead of 1? Because, as you will experience by yourself, if you use parameter 1, there will be an annoying popup window before shutdown asking you to exit the batch file under the virtual Dos machine. With 5, the exit will be forced which will give you the most satisfaction without bothering with the popup.
[2] Make another batch file, Slave.bat in the [drive:] and [path] as specified in the call statement in [1].
::-----Slave.bat-------
:: All the pre-shutdown house-keep jobs here
...
... all the batch job commands
...
::---------------------[3] With Master.bat, make the pif/icon. The only detail you have to be careful, which is taken care of by default in fact, is to let the dos box sees the windows background in the advanced program setting. This is to assure that the 32-bit rundll32 etc run properly.
Now, you have got the job done. Just cut and paste the pif/icon to the desktop and the job is accomplished one click away.
A slight variation of the above construction is to keep only the rundll32 line in Master.bat, say, Master1.bat with one line only :
rundll32.exe shell32,SHExitWindowsEx 5
and specify the Slave.bat in the Master1.bat shutcut/icon program setting, namely,
cmdline : [drive':][path']\Master1.bat
and
batch file : [drive:][path]\Slave.batYou accomplish the same.
Here you are. I can propose another solution without appealing to Dos batch file but instead using Windows SH. But that would be another story.
PS : I've edited the above in the little box, so my prose may be broken at places. But, you get the idea.

After installing Linux (For which PnP OS was disabled in BIOS) Setups will not run from CR ROM Drive (in Windows) Double clicking on "Setup" is ignored. If PnP is reset then Linux will not load.
is there a work arround?

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |