2

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
10
  • 1
    I'm pretty sure that this will not be possible using only a single batch file. The commands are run in order, from top to bottom, just as if you'd typed them into the command prompt yourself. So you'd need a second batch file that could kill the process launched by the first. That starts getting ugly, maybe it's time to look for alternative solutions... Commented Jul 28, 2013 at 13:43
  • I am just guessing here, though. Someone might know a way, that's why I just posted a comment instead of an answer. I'm just saying not to hold your breath. :-) Commented Jul 28, 2013 at 13:49
  • So is it possible to take out / break(c^) one command in a batch without writing millions of codes, reprogramming the os and win a price for doing all this? (lol) Commented Jul 28, 2013 at 13:50
  • possible duplicate of Windows batch: analogue for `timeout` command Commented Jul 28, 2013 at 13:51
  • 1
    Just because you put 2 commands in one line with an ampersand between them doesn't mean they're run in parallel. The ampersand is for daisy-chaining commands. The 2nd command will start only after the first one finishes. Commented Jul 28, 2013 at 13:55

2 Answers 2

4

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

* Left Mouse Click

Sign up to request clarification or add additional context in comments.

6 Comments

Can u add friends on this page? :-)
@JonathanAgerskov No. SO is a Q&A site, not a social network.
@AnsgarWiechers this might be (I have some doubts...) but some user put their friends at the profile site, eg. pattyd.
@Ansgar thanks. Best answer 'We are all friends here... Why would we need a friend list?' Lol. meta.stackexchange.com/a/8243
|
0

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

tree | more

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.