Jonathan
Jonathan

Reputation: 509

How to timeout a command in a batch file?

I'm trying to make a command sleep after some seconds.

For example: tree & timeout /t 1

Then it would only show the top of the folders.

I have tried:

@echo off
Cd c:\Windows
Tree & timeout /t 1
Echo !
Pause >nul

and

Cd c:\Windows
Tree & ping 1.1.1.1. -n 1 -w 1000 >nul
Echo !
Pause >nul

Upvotes: 2

Views: 5741

Answers (2)

Endoro
Endoro

Reputation: 37569

Just make a LMC* in the Windows command shell window.

* Left Mouse Click

Upvotes: 4

foxidrive
foxidrive

Reputation: 41234

This will show a page at a time, if that is what you need:

tree | more

Upvotes: 0

Related Questions