neo1491 has asked for the wisdom of the Perl Monks concerning the following question:
I'm looking for a Perl script that sends commands to DiskPart.exe (ie: rescan and list disk/volume) and returns the output. Can anyone point me in the right direction? Update: I am trying to rescan the SCSI bus, detect all the PhysicalDrives connected to the system, then print out the return. DiskPart.exe has an option "rescan" and "list disk" which does just that. I'm attempting to write a script to automate this task.my $diskpart_out = `echo $diskpart_cmd|diskpart`;
open ( FH , "diskpart rescan|" ) || die ( "Failed to open filehandle.\ +n" ) ; my @inFile = <FH> ; # read all at once into array foreach (@inFile) { print $_."\t"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: diskpart.exe and perl
by shmem (Chancellor) on Nov 10, 2007 at 21:58 UTC | |
by neo1491 (Beadle) on Nov 10, 2007 at 22:10 UTC | |
by shmem (Chancellor) on Nov 10, 2007 at 22:17 UTC | |
by neo1491 (Beadle) on Nov 10, 2007 at 22:28 UTC | |
by neo1491 (Beadle) on Nov 10, 2007 at 22:20 UTC | |
by ww (Archbishop) on Nov 10, 2007 at 22:29 UTC | |
by neo1491 (Beadle) on Nov 10, 2007 at 23:24 UTC | |
|
Re: diskpart.exe and perl (s/and/in/)
by tye (Sage) on Nov 11, 2007 at 00:57 UTC | |
by neo1491 (Beadle) on Nov 11, 2007 at 02:40 UTC | |
|
Re: diskpart.exe and perl
by jdporter (Paladin) on Nov 11, 2007 at 14:06 UTC | |
|
Re: diskpart.exe and perl
by bigteks (Initiate) on Jul 28, 2010 at 20:24 UTC | |
by bigteks (Initiate) on Jul 29, 2010 at 12:52 UTC |