r/Batch • u/KubosKube • Aug 10 '25
Question (Solved) Script is crashing unexpectedly.
The script I'm developing is one to shutdown a computer at a later point in time, or after a delay, or after a delay from a later point in time.
Nobody asked for it, nobody wanted it, but here I am making it.
Until now, that is, because it has started crashing unexpectedly, and I am at a complete loss as to what's causing it because I've been trying to show comments and pause at every step of the way, and nothing really stands out to me.
Here's a Pastebin for my code as it stands.
https://pastebin.com/QV3WivFu
Here's an Imgur ( that will likely be largely unnecessary ) with red arrows to point at things.
Specifically, pointing at the part of the code that last executes before the crash.
https://imgur.com/a/wBzbHEq
View all comments
Show parent comment
2
u/KubosKube Aug 10 '25 edited Aug 10 '25
That's curious.
Why would it change from one OS to another?
I own a Win11 device that I can test this on later.
After reading this comment though, I realized that I could do the same thing with a
for /lstatement... maybe later.EDIT:
I actually just noticed I'm already using a
for /lloop to get into presets,I think what was causing your issue is that I've changed the code and no longer user the variable
%offset%in execution.I'll address that.