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. Incmd.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. Incmd.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