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?
Best Answer
The following might work, kinda:
This will first get the list of disks from diskpart and subsequently use them with your script file (which will be dynamically created in the loop).
I won't try it here, since I like my disks the way they are currently.