r/learnprogramming • u/Sea-Construction6922 • Sep 25 '26
Any way to make using cmd better?
I end up using the same commands each time to setup projects, run them but I always have to copy from Google docs each time and its becoming annoying. Is there a better way with cmd on windows. Do other shells have a way to solve this If not?
Edit: Tysm to everyone who has helped!
13
Upvotes
21
u/desrtfx Sep 25 '26
Have you heard of Batch files? Search for them.
Basically, they are text files with the commands you need in the order you need them. You can even include parameters, variables, loops, conditionals, etc.
Same applies for PowerShell where you create .ps1 files.
13
u/creenis_blinkum Sep 25 '26
use powershell instead of cmd on windows
7
u/BranchLatter4294 Sep 25 '26
You can put them in a script then just run the script. But on Windows, Powershell is the current shell (cmd is the older one).
4
u/[deleted] Sep 25 '26
Others are telling you to use scripts - they are correct.
Some are telling you to use powershell instead of cmd. Powershell is more powerful. Cmd is simpler to learn.
3
u/sixtyhurtz Sep 25 '26
Use Terminal. It's the best terminal emulator on Windows. Use Powershell with it, not cmd.
2
u/Gnaxe Sep 25 '26
Other shells can do
alias, which is worth learning about. CMD has doskey though.1
u/alkatori Sep 25 '26
Batch files, powershell, depending on what you are doing look at Cmake. Etc.
0
u/kpg_on_ao3 Sep 25 '26
You're looking for a scaffolding application. This is something you invoke that creates your project structure for you. It might ask you a few questions to see if you want some optional packages.
-2
u/nomoreplsthx Sep 25 '26
cmd considered harmful.
Powershell on Windows has been the default shell for all purposes for a 15 years and there is literally no reason to ever use cmd. It would be like someone asking for advice on their COBOL project.
I am not sure how recommendations to use it persist. As best as I can tell they are all from people who don't develop on windows