Date: Wed, 20 Jan 1999 14:38:14 +0100 From: Matthias Paul Subject: Re: batch file help To: opendos AT delorie DOT com Message-id: Organization: Rechenzentrum RWTH Aachen X-Mailer: Pegasus Mail v3.22 Reply-To: opendos AT delorie DOT com On Tue, 19 Jan 1999 wrote: > I need to set up an automated install of DR-Dos and Newdeal School > suite. > [...] > Is there an easy way to tell if the HDD is already fdisked and formated > with DR-dos so I can have the batch skip step 2 after rebooting when > exiting fdisk? Hm, this is an ad-hoc solution (untested, might need improvement): @ECHO off IF EXIST a:\semaphor.log GOTO continue REM If the following query causes a critical error due to an REM unformatted disk, try suppressing COMMAND.COM s critical REM error handler using its Fail option in CONFIG.SYS, e.g.: REM SHELL=a:\command.com /F /P IF EXIST c:\ibmbio.com GOTO skip ECHO > a:\semaphor.log FDISK < a:\keyfile.lst REM FDISK should reboot here, otherwise we could force a reboot REM using 4DOS REBOOT command or a DEBUG script... PAUSE Press CTRL+ALT+DEL to reboot your machine. :continue IF EXIST a:\semaphor.log DEL a:\semaphor.log > \dev\nul REM Using MS-DOS FDISK requires the following instead: REM FORMAT c: /S SYS c: :skip If the "IF EXIST c:\ibmbio.com" still causes problems, there are more sophisticated methods to solve that problem, e.g. reading and analyzing the harddisk s MBR to see if it s formatted. This can be done using DR-DOS DEBUG s quite powerful scripting facilities, but first let s see if the simple approach doesn t solve your problem already... > How about a way to automate FDISK? As shown above, you can use input redirection to feed DR-DOS FDISK with simulated keystrokes, e.g. FDISK < keyfile.dat However, since the numbers assigned to the various options may vary depending on the drive s current status, this can be dangerous in some situations (since Novell DOS 7, FDISK takes some precautions to avoid the most serious mistakes, but it s still VERY dangerous). On the other hand, there s nothing to loose if you only perform this on non-initialized disks. MS-DOS 7 FDISK and OS/2 FDISK have a bunch of command line options to automate the process of partitioning, but you will have to run FORMAT afterwards. > How about a way to cause a reboot at the end? If necessary FDISK will usually force a reboot by itself. Otherwise you can use 4DOS REBOOT, or a simple DEBUG script. Matthias ------------------------------------------------------------------- Matthias Paul, Ubierstrasse 28, D-50321 Bruehl, Germany eMail: Web : http://www.rhrz.uni-bonn.de/~uzs180/mpdokeng.html -------------------------------------------------------------------