Selim Karaman
Selim Karaman

Reputation: 5

Echo two set /p

I made a bat that renames folders and files inside them it asks for the old name and then new name like

SET /p originalcodename="Please enter the ORIGINAL codename: "
SET /p newcodename="Please enter the NEW codename: "

and I made anohter bat for bulk processes and its like this

echo example_oldfoldername| renamecodename.bat (
echo example_newfoldername| renamecodename.bat|rem
)

and it gave bunch of errors I wonder if there is a way to make it echo two inputs it's a bit complicated but

Upvotes: 0

Views: 44

Answers (1)

Stephan
Stephan

Reputation: 56189

You need to provide both inputs to the same instance of your batch file:

(echo example_oldfoldername&echo example_newfoldername)| renamecodename.bat

or to keep it readable in a batch file:

(
  echo example_oldfoldername
  echo example_newfoldername
) | renamecodename.bat

Pay attention to any stray spaces, they are invisible but will get part of the variables, which may lead to unexpected behaviour.

Upvotes: 1

Related Questions