How to partition and format multiple disks using a batch script?

Posted by chandu on Server Fault See other posts from Server Fault or by chandu
Published on 2010-02-26T11:10:28Z Indexed on 2010/05/24 19:02 UTC
Read the original article Hit count: 283

Filed under:
|

I am trying to format 'n' number of disks using a batch script. My script goes like this.

diskpart /s "abc.txt"

where abc.txt is:

sel disk 1
create part primary
format FS=NTFS  label=label2 quick compress

My Problem here is I want to 'loop' the commands in abc.txt for the number of disks that exists. But I cannot send an argument like %1 to abc.txt file as it is a .txt file. and my diskpart /s can only take a .txt file as an argument. how to overcome this... could anybody please help?

© Server Fault or respective owner

Related posts about Windows

Related posts about batch-file