Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CREATING A LOOPING RESTART BATCH FILE

5 views
Skip to first unread message

AlanH

unread,
Oct 3, 2001, 7:46:06 PM10/3/01
to
Hi.

I am a computer engineer and a lot of problems with pcs happen when they are
shutdown/restarted.
I am creating a bootable utilities CD, and one utility I would like to put
on it is an automated restart batch file.

Something which will boot into windows, delay for about 30 seconds (to
allow the TSRs to load, and then restart. And to continue the whole process
again about 10 times before finally stopping.

Any help on this problem would be gratefuly recieved.

Thanks in advance
Alan.


William Allen

unread,
Oct 4, 2001, 3:05:58 AM10/4/01
to
AlanH wrote in message

For some ideas in how to approach this:

I suggest you read my post:
From: "William Allen"
Newsgroups: alt.msdos.batch
Subject: Re: Shutdown Windows
Date: Sat, 22 Sep 2001 15:07:27 +0100
Message-ID: <9oi61n$d42pj$1...@ID-55970.news.dfncis.de>

which details some ways of getting a temporary batch file
to shutdown, or (in the case of Windows 98 and higher, but
not Windows 95), restart.

You can read old Usenet posts at:
http://groups.google.com/advanced_group_search

Note: Google search by Message-ID is usually the quickest.
Message-ID search works with or without <angle> brackets.
Simply cut-and-paste the Message-ID into Google page above.


If your parent batch file creates a recalling script (consisting
merely of the Path+FilenameSpec of your parent batch file) and
writes it to C:\WINDOWS\Start menu\Programs\Startup it can
regain control after the reboot. I assume that with a bootable CD,
you are in the situation where the CD drive is temporarily
assigned a known drive letter (typically A:).

You can count the restart loops by various methods, but
perhaps the simplest is to use a UniqueNamed file in C:\
to which you append a line each time. Count the lines in it
with, say: find "" /v /c<FileSpec

The main problem, as far as I can see, is that there isn't a way
I know of to restart a standard Windows 95 installation from
a batch script (although it's easy to shut it down from Batch).
The additional restart functionality wasn't introduced until
Windows 98. See the Microsoft Knowledge Base document:
How to Exit Windows 98/Me Automatically Using a Batch File
http://support.microsoft.com/support/kb/articles/q234/2/16.asp

--
William Allen


William Allen

unread,
Oct 4, 2001, 3:37:56 AM10/4/01
to
William Allen wrote in message
...snip

> The main problem, as far as I can see, is that there isn't a way
> I know of to restart a standard Windows 95 installation from
> a batch script (although it's easy to shut it down from Batch).

Writing that made me think about the problem and a simple
answer immediately occurred to me.

For Windows 95 only (not needed for Win98/ME), you create
a batch file consisting only of
@ECHO OFF
EXIT

_and_ a shortcut to it with the Program/Advanced properties
set to "MS-DOS mode" and "Don't prompt before entering MS-DOS
mode". Whenever you execute the shortcut, the batch file is executed
in an MS-DOS mode non-permanent shell. The command EXIT in
the non-permanent MS-DOS mode shell causes Windows to do
a complete reboot and any startup processes loaded in the folder
C:\Windows\Start Menu\Programs\Startupare or set in the Registry
Run or RunOnce keys are all executed again during the reboot. Post
for more details of this if you decide to use the idea and it's not clear.

Note that the reboot is made with two temporary versions of CONFIG.SYS
and AUTOEXEC.BAT (the original versions are renamed temporarily
- usually to .WOS versions - during the reboot from MS-DOS mode shell)

--
William Allen


Frank-Peter Schultze

unread,
Oct 4, 2001, 4:19:30 AM10/4/01
to
"AlanH" <mant...@ntlworld.com> wrote in message news:<2rNu7.23483$KJ4.4...@news6-win.server.ntlworld.com>...

If you want to study the "nature of your problem" you should start
windows (9x?) from its original Config.sys/Autoexec.bat.

BTW, we had a lot of problems w/ Pdesk.exe (Power Desk or so) running
under Win2k on Compaq Deskpro. Most PCs hung on shutdown. We fixed this
by erasing its HKLM\...\Run registry entry.

--
Frank-Peter Schultze <fpsch...@my-deja.com>, http://www.fpschultze.de

0 new messages