Home windows Simultaneously create and go to the created folder on Windows on the...

Simultaneously create and go to the created folder on Windows on the command line

Author

Date

Category

There is a problem. On the command line there are such commands: mkdir (create a folder) and CD (go to folder). So, how to combine these 2 teams? Is there such a team or need to create it yourself. I know to Linux you need to “lie” with the .bashrc file, but there is simply no such file on windows. What to do?


Answer 1, Authority 100%

To execute several commands from one command line,
You need to combine them using conditional symbol:

Team1 & amp; Team2 – Used to split multiple commands in one command line. In cmd.exe the first command is performed,
Then the second command.

Team1 & amp; & amp; Team2 – Runs a command behind the & amp; & amp; symbol, only if the command facing this symbol has been completed
successfully. In cmd.exe the first command is performed. Second team
Performed only if the first was successful.

Team1 || Command2 – Runs the command behind the || symbol, only if the command facing the || symbol has not been completed. V
cmd.exe The first command is performed. The second team is performed, only
If the first was not executed (the resulting error code exceeds zero).

For your example:

mkdir some_dir & amp; & amp; CD Some_Dir

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions