Please help, I need the script if the robocopy is going to MIR more than 100 files it should send alert and stop MIR operation. If it is less that 100 then it can perform the MIR operation.
Thanks,I have created one batch script to send success and failure status mails. But in the below script if the status is 'failed', it is sending both success and failure mails. Eg: for testing purposes removed access for one source file and it's sending both mails instead of failure alone.Please advise if there is any correction on the script
Robocopy source destination /l /mir /w:0 /r:1 /z /log:log path
If %ERRORLEVEL% LSS 8 goto :Finish
Poweshell -ExecutionPolicy Bypass -Command "D:/failure.ps1' Exit /B
:Finish
Poweshell -ExecutionPolicy Bypass -Command "D:/success.ps1'
/L
: List only - don’t copy, timestamp or delete any files. Then parse the output. – DavidPostill♦ May 27 '20 at 19:10