rem Save this file as: rem shutdown-when-robocopy-ends.cmd rem and execute it AFTER starting robocopy. rem (otherwise your computer will shut down!) rem :beginning tasklist | find /i "robocopy" > estado_robocopy for %%a in (robocopy_state) do if %%~za.==0. goto :turnoff for /L %%f in (1;1;10000) do rem %%f goto :beginning :turnoff shutdown -s -t 200 @echo ************************************** @echo TO CANCEL, open a Command line and type @echo Shutdown -a :end