AnthemCorporation Posted October 17, 2007 Share Posted October 17, 2007 Hey All I've been asked to create a script that runs a GUI for robocopy. I have everything working fine there, but I want to able to have an editbox with the details of the copy as it goes. Here is my function to start the app: Func StartApp($source, $destination, $sub, $del, $excl, $spare) $commandline = Chr(34) & $source & Chr(34) & " " & Chr(34) & $destination & Chr(34) & " " & $sub & $del & $excl & $spare & " /NP /TEE" $confirm = MsgBox(1, "Please Confirm", "You are about to copy " & $source & " to " & $destination & ". Is this correct?") If $confirm = "1" Then $id = run("robocopy.exe " & $commandline,@scriptdir,@SW_MAXIMIZE,6) ; msgbox(0,"",$id) While 1 $prog = stdoutread($id) ;msgbox(0,"",$prog) $update = guictrlread($progresslog) $prog = $update & @crlf & $prog GUICtrlSetData($progresslog,$prog) if @error then ExitLoop WEnd While 1 $prog = StderrRead($id) ;msgbox(0,"",$prog) $update = guictrlread($progresslog) $prog = $update & @crlf & $prog GUICtrlSetData($progresslog,$prog) if @error then ExitLoop WEnd EndIf EndFunc ;==>StartApp My problem lies in that when it goes to write the contents of the command prompt windows it shows only the header of the copy process, and continually flashes as though its only updating that, and not the rest of it.... Tell you what, if I haven't explained it enough there, i'll upload my script, and you just need to have robocopy.exe in the same folder as the script. Any help would be greatly appreciated CheersFile_Copy.au3 Link to comment Share on other sites More sharing options...
BrettF Posted October 17, 2007 Share Posted October 17, 2007 Maybe... While 1 $prog = StdoutRead($id) _GUICtrlEdit_AppendText ($progresslog, $prog) If @error Then ExitLoop WEnd While 1 $prog = StderrRead($id) _GUICtrlEdit_AppendText ($progresslog, $prog) If @error Then ExitLoop WEnd You will need the BETA to do this Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
AnthemCorporation Posted October 17, 2007 Author Share Posted October 17, 2007 Thanking you muchly Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now