Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

use echo and another command in the same line in batch file

Writer Andrew Mclaughlin

For for this code

echo x set /p "a=>"

result will be

x set /p "a=>"

The result i want is

x>

Please help,thanks

1

2 Answers

You can use the && to run two command at the same time.

So lets say you want to echo something sent it to clipboard and open notepad, you will write:

echo test | clip && notepad

So yours will be

echo x && set /p "a=>"
3

This question is not clear at all because you don't explain what you want to do.

  1. If you just want to use two (or more) commands in the same line this is the answer:*

Just use & character between commands.

(If you want to wait for the previous command to finish before run the next command, use && instead of &)

example code: @echo off & echo test & pause

  1. Or maybe you must check the prompt command.

check for the use: prompt /?

example code: prompt x$G (the output is: x> )

  1. If you want to OUTPUT in the same line then, already explained well by user 'Sonamor' (answer #1).

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy