1

I have these three commands - how do i execute them on a single line?

@echo off
echo SomeText
pause

Not one after to other like it normally is in batch.

3
  • What do you actually expect to happen? What problem are you trying to solve? How would it help to "run the three commands at the same time"? Commented Mar 28, 2014 at 10:15
  • It would help the code be more compact. Commented Mar 28, 2014 at 10:17
  • 1
    What would that help? Using shortcuts like that is usually frowned upon, since it hurts readability. However, in your case, you could get away with @echo SomeText & pause. In any case, you should edit your question. You're not asking how to run the commands at the same time - you're asking how to put the commands at the same line in the batch file. A very different thing :) Commented Mar 28, 2014 at 10:18

1 Answer 1

2

Try linking them with a "&"

@echo off & echo SomeText & pause

It works in most cases but more complicated code with "()" in may cause problems as the brackets will need escaping.

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

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.