←back to thread

195 points _ol1s | 1 comments | | HN request time: 0.248s | source
Show context
torphedo ◴[] No.41084297[source]
Wow, this is the largest batchfile I've ever seen! And I thought my 200-ish line one from high school was pushing it. Honestly huge respect for having the dedication to go this far with batch. I knew about the pseudo-function-calling features and a little bit of the weird syntax, but just skimming there's a lot of stuff in here I haven't seen before. Usually people saying "X in Y KiB" are doing some crazy linker shenanigans, so this was refreshing.

Also, "Windows To Go" and "Windows To Stay" are really funny feature names.

replies(4): >>41084376 #>>41084508 #>>41084695 #>>41085137 #
Kwpolska ◴[] No.41085137[source]
"Windows To Go" is the official name for a former Windows feature.

Writing a Batch script of any length, let alone 3085 lines, is completely insane with PowerShell being part of the default install.

replies(1): >>41085268 #
maccard ◴[] No.41085268[source]
I write tools for video game studios occasionally. You can’t double click a ps1 script and have it run, and you need to change the execution policy for powershell scripts to run. Those two hurdles for non technical people mean that we still write batch scripts
replies(1): >>41085333 #
TiredOfLife ◴[] No.41085333[source]
But you can run .ps1 from .bat that you doubleclick.
replies(2): >>41085615 #>>41087080 #
maccard ◴[] No.41087080[source]
If you are writing a bat wrapper, you might as well write the wrapper in c# at that point (which I do for anything that requires a condition or a loop)
replies(1): >>41087865 #
naikrovek ◴[] No.41087865[source]
The threshold you’ve chosen is crazy low, for me.

A condition or a loop? You’re writing everything in C# then. Everything worth writing, anyway.

replies(1): >>41089726 #
1. maccard ◴[] No.41089726[source]
Pretty much, yep. The batch file is just for pre providing arguments and checking awkward error codes from robocopy