Diskpart script

grimstoner

Well-Known Member
Joined
Nov 27, 2009
Messages
311
Reaction score
0
Hi...

Anyone proficient in .bat files or Powershell? I have a server with 48 x 1Tb hdd's, that was running Solaris, but is running Windows Server 2008 R2 DataCentre now. I need to run the following commands on each disk in diskpart :

  1. select disk n
  2. attributes disk clear readonly
  3. online disk
  4. convert mbr

Guess it should be easy to just iterate over a range of n's if you now how to shell script.
 
For reference, it actually wasn't that hard... only had to run the script once, so I just copy pasted it over and over, i.e. :

select disk 3
attributes disk clear readonly
online disk
convert mbr
select disk 4
attributes disk clear readonly
online disk
convert mbr
select disk 5
...

saved it in a file (online.txt), and ran diskpart /s c:\online.txt.
 
Top
Sign up to the MyBroadband newsletter
X