MS-DOS

Moderators: blip
Number of threads: 362
Number of posts: 872

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
how to make a .bat to check if the drive is partitioned and formatted Posted by James1982 on 29 Jun 2010 at 7:17 AM
I'm working on some batch files for personal use, I am a complete novice with batch files and I was wondering how I can do these two things. Basically, I have a batch file that when ran, I'd like for it to check if a drive has been partitioned. If not, It'll run fdisk. If it has been partitioned, it'll go to format. If it's already formatted, then it'll just move on to the next operation. i can't find anything on this anywhere.

Anyone have any ideas?
Report
Re: how to make a .bat to check if the drive is partitioned Posted by dsteward on 3 Sept 2012 at 8:13 PM
You can check if you need to run fdisk by:
IF NOT EXIST C:\NUL goto RunFdisk



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.