as the title said I need to run exactly two commands in one line using cmd in windows 10. How is it possible?
to run two commands use &. Both commands will be executed:
dir file.txt & echo done
Use && to execute the second command only if the first command was successful:
dir existentfile.txt && echo done
Use || to run the second command only if the first command failed:
dir nonexistentfile.txt || echo not found
You can combine:
dir questionablefile.txt && (echo file exists) || (echo file doesn't exist)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With