08.02.2022 Views

batch-file-es Windows

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

REM 1.1.1.1 is an non-existing IP so the -w flag can ping a delay and go to next command

Esto generaría lo siguiente en su archivo / consola por lotes:

C:\Foo\Bar\Baz>ping -n -w 1000 1.1.1.1

Pinging 1.1.1.1 (Using 32 bytes of data)

Request timed out

Ping statistics for 1.1.1.1

Packets: Sent = 2,Received = 0, Lost = 1(100% loss)

Ocultar el texto con eco

Simplemente agregue >nul en la parte posterior del comando para redirigirlo a nulo.

ping -n w 1000 1.1.1.1 >nul

Esto no produciría nada.

Dormir

Dormir

En sistemas Windows más antiguos, el timeout no está disponible. Sin embargo, podemos usar el

comando sleep .

Uso

sleep 1

Muy autoexplicativo; dormir durante 1 segundo. Sin embargo, sleep modo de espera es un

comando deperactado y debe reemplazarse por el tiempo de espera .

Disponibilidad

Este comando está disponible en el antiguo sistema de Windows. También SLEEP.exe se incluye

en 2003 Resource Kit.

Para usar sleep.exe , coloque el archivo ejecutable en la carpeta %Windir%\System32 . Entonces

puedes usarlo como comando normal.

Lea Añadir retraso al archivo por lotes en línea: https://riptutorial.com/es/batchfile/topic/9123/anadir-retraso-al-archivo-por-lotes

https://riptutorial.com/es/home 10

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!