Nato51
Nato51

Reputation: 175

Using multiple commands on a single line

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.

Upvotes: 1

Views: 77

Answers (1)

09stephenb
09stephenb

Reputation: 9776

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.

Upvotes: 2

Related Questions