General discussion

Locked

MS-DOS question

By edrox ·
Hi,

I am building a boot and format/gdisk process for an unattended setup.
I want to be able to check if the is an second (d:) partition, if there is I want to run 1.bat, if there isn't I want to run 2.bat

I run this with MSDOS 6.22 from a floppy.

Anybody has any idea how I can do this?

Thanks in advance,

Eduard de Vries

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

MS-DOS question

by erikdr In reply to MS-DOS question

Doesn't look all too complicated, supposing you want to test for a formatted .
First COPY a small file from A: to , with <Abort.txt as input in case you get an Abort,Retry,Ignore. Of course Abort.txt solely contains the A.
Then do an IF EXIST check in the batchfile on smallfile.txt.
As you will be aware of, IF EXIST allows branching in the batchfile.
So if positive, execute 1.bat and goto Einde.
If negative, execute 2.bat and goto Einde.

Have fun,

<Erik> / The Netherlands

Collapse -

MS-DOS question

by edrox In reply to MS-DOS question

Thanks Erik, eventhough to be honest I prefer the next solution.

Eduard

Collapse -

MS-DOS question

by rogerndgreen In reply to MS-DOS question

Although the first answer will work, a slightly quicker way is to look for the existence of the file d:\nul
If it exists, there is a formatted drive. If not, there isn't.
After that you can execute the appropriate batch file
HTH
Roger

Collapse -

MS-DOS question

by edrox In reply to MS-DOS question

Roger,

exactly what needed, feel a bit stupid though, I should have thought of this, I probably have looked to long at this with my complicated gfidk and fdisk commands.

Regards,

Eduard de Vries

Back to Windows Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums