Jump to content

get result of ShellExecute


Recommended Posts

  • Developers

Use Run() with the appropriate parameters in stead of ShellExecute(). ;)


Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
Live for the present,
Dream of the future,
Learn from the past.

Link to comment
Share on other sites

The internet said that shellExecute() is suitable than run() when parameters are needed.

This doesn't work either:

Local $iRc = Run ( '"G:\ffmpeg\bin\ffmpeg.exe"  "-version"' , "G:\ffmpeg\bin\")
;Local $iRc = Run ( '"G:\ffmpeg\bin\ffmpeg.exe"  -version' , "G:\ffmpeg\bin\")
;Local $iRc = Run ( 'G:\ffmpeg\bin\ffmpeg.exe  -version' , "G:\ffmpeg\bin\")
$Message = StdoutRead($iRc)

I need to get output from ffmpeg and determine wether commands finished execution!

Link to comment
Share on other sites

ConsoleWrite(_getDOSOutput('ffmpeg -version', 'G:\ffmpeg\bin\') & @CRLF)

Func _getDOSOutput($command , $wd='')
    Local $text = '', $Pid = Run('"' & @ComSpec & '" /c ' & $command, $wd, @SW_HIDE, 2 + 4)
    While 1
            $text &= StdoutRead($Pid, False, False)
            If @error Then ExitLoop
    Return StringStripWS($text, 7)
 EndFunc   ;==>_getDOSOutput


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...