Actually your subroutine is worthwhile if the thing you want to do in diskpart requires more than one line, for example to change drive letters.
Here's how I used it for a drive letter changing script:
&send_diskpart_command("select volume $VolNo\nremove letter=$OldLetter +\nassign letter=$NewLetter");
Works like a charm.
The send_diskpart_command subroutine does have a bug though - the textfile cleanup is inside a debug if-block so the textfile only gets cleaned up when debug is turned on. Easy to fix though.
In reply to Re: diskpart.exe and perl
by bigteks
in thread diskpart.exe and perl
by neo1491
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |