简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM