Apagada docs

Aprendiendo a programar el pasado

Herramientas de usuario

Herramientas del sitio


en:bat:shutdown-when-robocopy-ends.cmd
Shutdown when robocopy ends

This is a windows command line script that shutdowns computer if robocopy is not in the task list.

Otherwise, it keeps waiting until robocopy ends – when it is removed from the task list.

This way, we can start robocopy at night, and before going to bed, execute this script to shutdown computer when robocopy ends.

shutdown-when-robocopy-ends.cmd
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
Este sitio web utiliza cookies. Al utilizar el sitio web, usted acepta almacenar cookies en su computadora. También reconoce que ha leído y entendido nuestra Política de privacidad. Si no está de acuerdo abandone el sitio web.Más información
en/bat/shutdown-when-robocopy-ends.cmd.txt · Última modificación: 2018/01/04 06:27 por nepenthes