Reassign volume on Windows: Command line mode

Again, I need to reassign volume letter (drive D:) to a network drive. However, a DVD-Rom is exist and already taken the drive letter. I need to do it on 32 nodes simultaneously! unless I 'll spend half an hour log-in to every compute nodes and click-click-click. At last I found the way.
Windows has a command called "diskpart", which act as command line interface for "Disk Management" snap-in of "Computer Management". It also accept scripting input, so what I did is

  • Create a script for diskpart

SELECT VOLUME D
REMOVE
ASSIGN LETTER V

  • Run this on every nodes at the same time

clusrun diskpart /s \\winhpc\share\diskpart.txt

Works perfectly!