|
cmd命令行取虚拟光驱数及盘符无法回显问题,可以输出但取不到盘符及映像路径
#include <Constants.au3>
#include <Array.au3>
;Local $p = Run(@ComSpec & ' /c ping 6san.com','',@SW_HIDE, 15)
Local $p = Run(@ComSpec & ' /c ' & @SystemDir & "\ImDisk.exe -l",'',@SW_HIDE, 15)
Dim $i
Local $line
ProcessWaitClose($p)
$line =StringMid(StdoutRead($p), 15, 1)
MsgBox(0,"111:",$line)
For $i = 0 To $line Step 1
Local $foo = Run(@ComSpec & ' /c ' & @SystemDir & "\ImDisk.exe -l -u "&$i,'',@SW_HIDE, 16)
Local $sDat
$dv =StringMid(StdoutRead($foo), 14, 10)
$sDat1 = StdoutRead($foo) ;获取数据流
;If @error Then ExitLoop
$sDat = $sDat1
_ArrayDisplay($sDat)
MsgBox(0,$i&"STDOUT read:",$dv) |
|