DEV Community

Cover image for I Wrote A Batch Script to Enhance My Workflow on Command Prompt

I Wrote A Batch Script to Enhance My Workflow on Command Prompt

Debajyati Dey on August 12, 2024

So yess, wonderful readers, I just wrote a batch script, not bash script! Batch is the language in which scripts for windows command prompt(cmd.ex...
Collapse
 
plutonium239 profile image
plutonium239 • Edited

A 3rd and more generic approach would be to use lua scripting through clink, the most insane supercharger for cmd. (Because cmd > ps :P)
In any case, anyone using cmd should absolutely check it out, it's got a lot of features.

Collapse
 
plutonium239 profile image
plutonium239

Also, even though I don't use this (because I discovered clink after I solved these problems), this is how I do it:
I have gnu win32 tools installed, so ls, which, etc, and fzf/other tools are native windows exe s.
Then, I've created a new .cmd script for each complex command, and these are accessible from PATH.
…That's it, you might think it's tedious but I don't have that many commands to alias plus it's easy

Collapse
 
ddebajyati profile image
Debajyati Dey

Wow! That sounds really interesting! But can you run bash files through cmd directly now?
Ig my script wins over there : )

Thread Thread
 
plutonium239 profile image
plutonium239

Yeah, everyone has bash.exe installed, probably from git or somewhere else - you can run bash scripts directly

Collapse
 
subhro profile image
Subhradip Sinha

Really helpful

Collapse
 
ddebajyati profile image
Debajyati Dey

Glad to know that ☺️

Collapse
 
joaquin_salcedo_5b2261f5b profile image
Joaquin Salcedo

Nice article and explanation!

Collapse
 
ddebajyati profile image
Debajyati Dey

Glad you liked the content

Collapse
 
swapnoneel123 profile image
Swapnoneel Saha

Quite a nerdy work!! Good job!

Collapse
 
ddebajyati profile image
Debajyati Dey

Hehe, thanks swapnoneel!

Collapse
 
gregory_magnusson profile image
Gregory Magnusson

Very good. Keep bashing your terminal for shortcuts. Very useful. See also Starlark