Hi,
Before i start i would like to say that i already used the forum search option, and yes there are a few topic talking about this. but in non of them i did found the answer to my solution .
Back to this topic.i am currently writing a script for move(sync) files for some servers we are migrating. most part of the script i already have working or know the solution for. but now i have come to the part where i am trying to log the process of robocopy. i know this can be done with the command STDoutRead.
The robocopy command will have to copy like 15gb of files all not more then 15kb in size. my feeling says that the first run will be a long one and that's why i want log the stream. this is for if something goes wrong. and a error is dected i want to make the script capable of sending me a notification or when ready or other functions.
my question?: how am i able the use STDoutRead to read(react) in real time.
i currently have the following, where i keep asking myself the question where i need to code for it to react in realtime.
#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.8.1 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- #include <Array.au3> ; Script Start - Add your code below here Local $syncPID, $output, $switch = 0 Local $sourcedir = '"C:\SrcFolder"' Local $destdir = '"D:\DesFolder"' Local $options = '/TEE /E /COPYALL /PURGE /COPY:DATO /V /TS /FP /NP' $syncPID = Run (@ComSpec & " /c " & 'Robocopy.exe ' & $sourcedir & ' ' & $destdir & ' ' & $options, @ScriptDir, @SW_Hide, 2 ) While ProcessExists ( $syncPID ) $tempOutput = StdoutRead($syncPID , True , False) $output = StringSplit($tempOutput, @LF) ConsoleWrite ( $output[0] ) WEnd _ArrayDisplay($output)