Opened 16 years ago

Last modified 16 years ago

#690 closed Bug

Problems with Run and chkdsk — at Initial Version

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.2.12.1 Severity: Blocking
Keywords: Cc:

Description

I updated to the latest Public (3.2.12.1). I've got problems with chkdsk and Run or StdoutRead.
The following script return not correct return data.
If I change "chdsk" to "sort" the returned data is correct!

I'm I still doing it wrong ?
But were is the misstake?

#include <Constants.au3>

Local $foo, $cmd
Local $line
;$cmd = @ComSpec & " /c chkdsk F: /f/r"
$cmd = @ComSpec & " /c chkdsk /?"

$foo = Run($cmd, @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

dbg($foo)
dbg($cmd)
While 1

$line = StdoutRead($foo)
If $line<>"" Then

dbg("StdoutRead: " & $line)

EndIf
If Not ProcessExists($foo) Then

ExitLoop

EndIf

Wend

Exit

Func dbg($msg, $error=@error, $extended=@extended, $ScriptLineNumber=@ScriptLineNumber)

Local $out = "(" & $ScriptLineNumber & ")(" & $error & ")(" & $extended & ") := " & $msg
;Output to application attaching a console to the script engine
ConsoleWrite($msg & @CRLF)
;Output to debugger (dbgview.exe)
DllCall("kernel32.dll", "none", "OutputDebugString", "str", $out)

EndFunc

Change History (0)

Note: See TracTickets for help on using tickets.