Live data from Hacker News

Windows recovery environment and bootable USB creator in 200kb

github.com

31–40 of 50 posts

Re: Windows recovery environment and bootable USB creator in 200kb

#32
post #11

can I use this to install monitor drivers? make a bootable usb, add the installer onto the bootable usb and install the firmware? https://www.lg.com/au/support/product-support/cs-32GS95UE-B.... I thought about doing it through WINE, but that kinda scares me. unfortunately my monitor received new firmware only installable through an exe, I only have my linux desktop

If you're okay with third party software, you can make a bootable usb to update firmware from.

https://www.hirensbootcd.org/

Re: Windows recovery environment and bootable USB creator in 200kb

#33
post #23

Earlier quoted context omitted.

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

But you can run .ps1 from .bat that you doubleclick.

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)

Re: Windows recovery environment and bootable USB creator in 200kb

#34
post #8

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 shen…

Not to get TOO far off topic, but you just reminded me of the 300+ line batch file I was using for my BBS back in the early 90s. Lots of errorlevel checks to handle door transitions, Fidonet, etc. You could get some ridiculously complicated batch files if you really needed the added functionality.

Wow, unexpected trip down memory lane. Thanks.

Press ESC twice for nostalgia.

Re: Windows recovery environment and bootable USB creator in 200kb

#35
post #30

Earlier quoted context omitted.

That still has the same issue. Powershell will refuse to run scripts that are not signed by default.

You can use the -ExecutionPolicy argument to get around that. It's not a security boundary, just something to stop users accidentally opening an email attachment like they will with bat/vbs.

Which is pointless if it's only for powershell.... But hey, security theater is kinda the MO of Microsoft if you think about rotating password policies which have a maximum password length etc

Re: Windows recovery environment and bootable USB creator in 200kb

#36

Insane. 3k loc shell script. I admire people that can maintain things like this. For me it’s unapproachable hot mess.

Is it really that unapproachable? I confess, I also prefer files that aren't 3k lines long, but when I have to deal with them, I basically deal with them as I deal with many files, one tab/split per "area" I want to work with. So if I'm working with three areas, I have three splits open that are focused on each area, and jump between the splits. Basically the same as if it was three files.

Re: Windows recovery environment and bootable USB creator in 200kb

#37
post #33

Earlier quoted context omitted.

But you can run .ps1 from .bat that you doubleclick.

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)

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.

Re: Windows recovery environment and bootable USB creator in 200kb

#38

Earlier quoted context omitted.

But you can run .ps1 from .bat that you doubleclick.

That still has the same issue. Powershell will refuse to run scripts that are not signed by default.

Sign the powershell script. It’s not that large of a hurdle to get a code signing cert, though it certainly isn’t trivial.
Post reply on HN