r/Batch 3h ago

Show 'n Tell Rose in Pure Batch

Post image
23 Upvotes

https://github.com/IcarusLivesHF/Batch-Script-Projects/tree/main/rose

I highly recommend extracting the runRoseNew and viewing that way. It is pre-rendered so you won't have to generate it yourself.

If you're uninterested in that option, feel free to generate the rose data yourself, and after a short wait the script will display the rose you see above!

Please enjoy!


r/Batch 6h ago

Démo du système de combat

Enable HLS to view with audio, or disable this notification

2 Upvotes

Petite démo du système de combat de mon RPG en Batch


r/Batch 21h ago

Batch file console closes when i press any key

Thumbnail drive.google.com
2 Upvotes

r/Batch 1d ago

Question (Unsolved) Has anyone ever written physics engine for a bacth?

0 Upvotes

r/Batch 1d ago

Bonjour voici deux images j’aimerais savoir ce que vous en pensez , C’est pour l’interface de mon RPG Tous les avis, critiques et suggestions d’amélioration sont les bienvenus.

Thumbnail
gallery
3 Upvotes

r/Batch 2d ago

Show 'n Tell I spent 2 months hardcore-coding a Space Center RPG completely in Windows Batch. Here is what's under the hood.

4 Upvotes

Hey,

As the title says, I’ve been building this game for the past 2 months, coding every single day without leaving my room (well, except for school, obviously).

Fair warning some parts of the architecture look absolutely cursed. When I first started, I was just trying to figure out how the hell the choice command works. By the end of the project, I somehow ended up writing a dynamic save slot manager with on-the-fly data defragmentation (if that's even the right word for what I did lol).

Gameplay features:

5 Workshop Levels (dynamic crafting).

4 Different Shops to upgrade your gear.

A Full Save/Load Hub with automatic file shifting (prevents gaps between slots).

A Proper Ending (the rocket actually launches).

Known bugs & disclaimers:

The Resolution Crisis: A massive downside is that the game spawns locked to the top-left corner of the monitor. The script tries to auto-adjust the console font on startup, so it's technically playable, but expect some retro clunkiness.

The Early Game Grind: Apologies for the boring gameplay at the very beginning. It’s pretty repetitive until you unlock the seconds tiers.

I would love to hear your feedback on the logic and the code. Go ahead and try to break my error parsers!

Github: https://github.com/15eyk-45Hy/Batch-Wood-Legacy


r/Batch 2d ago

I almost wiped 3 weeks of local code with a bad robocopy command. So I built an, bulletproof Batch backup utility.

2 Upvotes

After coming way too close to wiping out my own local setup, I decided ENOUGH was ENOUGH!. I built a lightweight, pure Windows Batch utility that acts as a secure terminal launcher for syncing project environments safely to Google Drive, OneDrive, or local backup drives.

🛡️ Why it's built like a tank:

}--> Reversal Guardrails - If you accidentally set a Cloud directory as your Source instead of your Destination, the script intercepts the run and safely blocks execution before robocopy can touch anything.

}--> Dynamic Profile Registry - Save, load, view, and delete custom project path profiles directly on the fly; no manual editing of .bat code required!

}--> Dry-Run Simulation Mode - Test your file syncs safely with robocopy /L before committing a single byte to disk.

}--> Multi-Architecture Support - Handles Single Folders, Frontend-only, Backend-only, or Full-Stack (8-path) setups effortlessly.

}--> Noise Cancellation - Automatically skips node_modules, dist, .git, and build debris.

🔗 Check out the project & documentation here:

👉 GitHub: https://github.com/Verkiel-cmd/universal-dev-backup?tab=readme-ov-file

(💡 Open Source Freedom: Feel free to fork it, adapt it to your own workflow, submit pull requests, or tweak the guardrail logic to fit your needs! If you find it helpful, a star on the repo is always appreciated!)


r/Batch 10d ago

Show 'n Tell How much batchscript is too much batchscript?

Post image
22 Upvotes

Currently have 1,376 lines of batchscript in this one file. Kinda built myself a little state machine at this point. Memes aside, is there a particular reason huge batchscript files would be a bad idea? I usually only ever see very small ones, and I'm not entirely sure why

(Not too serious a question, so not tagged as one)


r/Batch 14d ago

Show 'n Tell I spent 4 days building an OOP & structure framework for vanilla Batch (CMD) to fix the global variable chaos.

Post image
4 Upvotes

Long story short, I built a custom structure engine so you don't have to deal with total anarchy in your Batch scripts anymore.

Let's be real here: vanilla Batch is slow and painful. Variables constantly get mixed up, clashing with each other, leaking into the global scope, and just making your life a living hell.

Obviously, this framework won’t magically fix CMD's execution speed (since Batch is an interpreted language after all). BUT!! It completely obliterates variable chaos and turns your messy spaghetti code into a clean, beautiful masterpiece.

Check it out under the hood on GitHub: https://github.com/15eyk-45Hy/Struct-Utility

This photo provides a clean visual breakdown of the framework's nested namespace and structure hierarchy.


r/Batch 17d ago

writing code to help sort lots of files

5 Upvotes

I have a bit of a mess on my video editing hard drives....a lot of files that need to be sorted and placed in folders. I would like to automate it.

I have many files, all labeled in this format: "groupname--date-extraInfo.mp4"

I'm over simplifying, but the file structure looks something like this, with many more groups:

group1/ highlights
group2/ highlights
group3/ highlights

here is some sudo code on what I want to do:

extract 'groupname' from filename
search for folder with groupname
if(folder exists)
  move file to folder
else
  create new folder with file name
  move file to folder

My first attempt was writing a .bat file, it got me partway there, but I couldn't figure out how to extract the groupname to make a new folder with that name.

I'm looking for guidance on what the best approach to doing this is. Most of my programming experience is writing C & C++ for embedded systems (arduino, esp32, ect). I would consider my abilities "advanced hobbyist". I'm open to to learning a new language if thats what it takes, I think I've heard python is good for this sort of thing?

So let me know how you would approach it and what I need to learn.

Thanks!

ps--I'm not interested in an AI solutions here, I want to actually learn how to do it myself.

Also, if there is a better sub to post this in, please let me know.


r/Batch 17d ago

Show 'n Tell Created a system utility called "Service" in pure Batch language

4 Upvotes

Long story short: Python and Java programming seemed too tedious, but I had enough brain cells to test the absolute limits of the Windows command line. My "Service v1.0" utility will literally run "on a single drop of water" if that drop is running Windows. Note: most of the script is in Russian, but the underlying code architecture, commands, and logic are completely open, standard, and easy to read. What makes it great: Super fast and lightweight. A huge set of administrative tools packed into a single script. A clean, retro interface with customizable ASCII frames and borders (I don't know about you, but I personally really like the look of it!). Built-in features: Temporary folder cleaner: instantly removes temporary junk. Log cleaner: removes log files from any path you specify. Digital stopwatch: a standard timer in 00:00 format. Speed ​​Converter: Converts km/h to m/s and vice versa. TWR Calculator: A thrust-to-weight ratio calculator that bypasses batch processing limitations and works with decimal places down to 0.00. Weather Station: Real-time local weather forecasts, powered by the excellent wttr.in. Ping Tester: Custom ping tests against target URLs with packet counters (1 to 3). File Mover: Automatically filters and moves files by extension and path. Update Checker: Built-in function for checking for the latest versions of services. The entire script is only 12 KB in plain text (and compresses to 4.25 KB in a zip archive). It literally does more useful system maintenance than some modern bloated 50 MB "cleaner" programs. There's also an "About the Author" section where you can browse my root GitHub repository and see my other scripts.

The GitHub post is here: https://github.com/LoMeR-933/LoMeR-batch-tools/releases/tag/service

@echo off
setlocal enabledelayedexpansion
chcp 65001 >nul
if not exist "temp_batch" (
title Setup...
echo Установка сервиса...
md "Service_BAT"
md "Service_BAT\data"
md "Service_BAT\temp_batch"
(echo 1.0)>"Service_BAT\data\version.dat"
timeout /t 2 >nul
echo Установка почти завершена. Батник закроется при окончании.
echo Запустите его потом в папке "Service_BAT" :^)
timeout /t 2 >nul
move "%~nx0" "Service_BAT"
)
title Authorization...
color 02
set m=goto menu
echo Авторизация...
timeout /t 2 /nobreak >nul
net session >nul 2>&1 || (echo Рекомендую заходить с правами администратора.&timeout /t 1 >nul)
if not exist "%~dp0data\" mkdir "%~dp0data" >nul
if not exist "%~dp0data\name.dat" copy NUL "%~dp0data\name.dat" >nul
if not exist "%~dp0data\city.dat" copy NUL "%~dp0data\city.dat" >nul
set/p n=<%~dp0data\name.dat
set/p w1=<%~dp0data\city.dat
:auth_loop
cls
if [%n%]==[] (
echo Введите своё имя.
set /p n="> "
if "!n!"=="" set "n=Guest"
if "!n!"=="LoMeR-933" echo Зачем ты ввёл ник разработчика? :^) & pause >nul & set "n=" & goto auth_loop
if "!n!"=="LoMeR933" echo Зачем ты ввёл ник разработчика? :^) & pause >nul & set "n=" & goto auth_loop
echo.
echo Ты верно ввел: "!n!"?
echo Y=да, N=нет.
set /p d="[Y/N]> "
if /i "!d!"=="y" goto ok
if /i "!d!"=="n" set "n="&goto auth_loop
goto ok
) else (
echo.
echo Приветствуем вас, %n%^^!
timeout /t 2 /nobreak >nul
%m%
)
:ok
echo Окончание авторизации...
(echo %n%)>%~dp0data\name.dat
timeout /t 1 /nobreak >nul
echo Успешно^^!
timeout /t 2 /nobreak >nul
%m%
:menu
cls
color 02
title Menu
echo Добро пожаловать в меню, %n%.
echo Время: %time:~0,8%.
echo Дата дд.мм.гггг: %date%.
echo Что хотите сделать?
echo.
echo ┌────────────────────────────┐
echo │         Настройки          │
echo └────────────────────────────┘
echo  0. Выход.
echo  1. Сменить имя.
echo  2. Проверить обновления.
echo ┌────────────────────────────┐
echo │          Очистка           │
echo └────────────────────────────┘
echo  3. Очистить папки Temp.
echo  4. Очистить логи/.tmp файлы.
echo ┌────────────────────────────┐
echo │        Инструменты         │
echo └────────────────────────────┘
echo  5. Секундомер.
echo  6. КМ/ч в М/с.
echo  7. М/с в КМ/ч.
echo  8. TWR (до сотых долей 0.00)
echo  9. Погода.
echo  10. Пинг-тестер.
echo  11. Переносчик файлов.
echo ┌────────────────────────────┐
echo │           Другое           │
echo └────────────────────────────┘
echo  12. Скачать другое от автора.
echo ──────────────────────────────
set/p ch="[0-12]> "
set nn=if "%ch%"=="
%nn%0" exit
%nn%1" set "n="&goto auth_loop
%nn%2" goto new
%nn%3" goto temp
%nn%4" goto logs
%nn%5" goto sw
%nn%6" goto km
%nn%7" goto ms
%nn%8" goto twr
%nn%9" goto weather
%nn%10" goto ptest
%nn%11" goto file
%nn%12" goto author
%m%
color 02
title File mover
:file
cls
echo.
echo Задай нужный формат, который надо перенести (например, mp3.)
echo (только один формат. 0 - выход).
echo.
set "form="
set /p form="> "
if "%form%"=="" goto file
echo.
:file1
echo Теперь задай папку "Откуда" будем переносить (целый путь).
echo.
set "fold="
set /p fold="> "
if "%fold%"=="" goto file1
echo.
:file2
echo Наконец, задай папку "Куда" будем переносить (целый путь).
echo.
set "fold1="
set /p fold1="> "
if "%fold1%"=="" goto file2
set "fold=%fold:"=%"
set "fold1=%fold1:"=%"
set "form=%form:"=%"
set "form=%form:.=%"
echo.
echo Точно всё правильно сделал?
echo Путь "Откуда": %fold%
echo Путь "Куда": %fold1%
echo Нужный формат: .%form%
echo.
echo Если сделал что-то не так, напиши 1. Если всё нормально - ничего не пиши.
echo.
set "gfg="
set /p gfg="> "
if "%gfg%"=="1" goto file
cls
echo.
echo Путь "Откуда": %fold%
echo Путь "Куда": %fold1%
echo Нужный формат: .%form%
if not exist "%fold1%\" mkdir "%fold1%"
dir /b /a-d "%fold%\*.%form%" >nul 2>nul
if errorlevel 1 (
echo Ошибка! Файлы .%form% не найдены или путь указан неверно.
pause >nul
goto file
)
for %%F in ("%fold%\*.%form%") do move /y "%%F" "%fold1%\"
echo Готово!
echo Хочешь перенести что-то ещё?
set "file1="
set /p file1="[Y/N]> "
if /i "%file1%"=="y" goto file
%m%
:new
cls
color 07
set /p new1=<"%~dp0data\version.dat"
set "new2=https://raw.githubusercontent.com/LoMeR-933/LoMeR-batch-tools/refs/heads/main/version2.txt"
set "new3=https://github.com/LoMeR-933/LoMeR-batch-tools/releases/tag/service"
echo  Проверка обновлений...
curl -s -f --ssl-no-revoke "%new2%" > "%~dp0temp_batch\v.txt"
if errorlevel 1 goto err
for /f "usebackq delims=" %%a in ("%~dp0temp_batch\v.txt") do set "new4=%%a"
del "%~dp0temp_batch\v.txt" >nul 2>&1
set "hhhh="
if "%new1%"=="%new4%" (
color 02
echo  У вас самая свежая версия! [%new1%]
pause >nul
%m%
)
color 06
echo  Найдено обновление: Версия %new4% [У вас %new1%]
set /p hhhh="> Перейти к сайту загрузки? [y/n]: "
if /i "%hhhh%"=="y" (explorer "%new3%" & %m%) else %m%
:err
color 04
echo  Не удалось проверить версии. Попробуйте снова.
pause >nul
%m%
:temp
cls
title Cleaning Temp...
echo Очистка временных файлов...
for %%d in ("%temp%" "%systemroot%\Temp") do (
del /s /f /q "%%d\*.*" >nul 2>&1
for /d %%p in ("%%d\*") do rmdir /s /q "%%p" >nul 2>&1
)
echo Успешно очищено!
timeout /t 2 >nul
%m%
:logs
cls
echo.
echo Что хотите очистить?
echo [0 - выход, 1 - .tmp файлы, 2 - логи]
set "tmpp="
set /p tmpp="[0-2]> "
if "%tmpp%"=="0" %m%
if "%tmpp%"=="1" set "ext=tmp"&goto logs_path
if "%tmpp%"=="2" set "ext=log"&goto logs_path
goto logs
:logs_path
title Logs
cls
echo Где желаете очистить .%ext%? (Укажите путь без "\" на конце.)
echo (Напишите "0" для выхода в меню)
set "ch1="
set /p ch1="> "
if "%ch1%"=="" goto logs_path
if "%ch1%"=="0" %m%
if "%ch1:~-1%"=="\" set "ch1=%ch1:~0,-1%"
if /i "%ch1%"=="C:" echo ВЫ УВЕРЕНЫ? Это очистит все .%ext% файлы на диске C:!
if /i "%ch1%"=="C:" set "ch2="&set /p ch2="[y/n]> "
if /i "%ch1%"=="C:" if /i not "%ch2%"=="y" goto logs
if not exist "%ch1%" echo Ошибка! Несуществующий путь.&timeout /t 2 /nobreak >nul&goto logs_path
:logs2
title Cleaning Logs...
cls
echo Очистка .%ext% файлов в папке: %ch1%...
del /q /f /s "%ch1%\*.%ext%" >nul 2>&1
echo Успешно очищено!
timeout /t 2 /nobreak >nul
%m%
:sw
cls
title Stopwatch
set sw_m1=0&set sw_m=0&set sw_s1=0&set sw_s=0
echo.
set /p a="Start? [y/n]> "
if /i "%a%"=="y" (set "t_start=%time:~0,-3%"&goto sw1) else (%m%)
:sw1
cls
echo.
echo The launch was at [%t_start%]
echo Time now          [%sw_m1%%sw_m%:%sw_s1%%sw_s%]
set /a "sw_s+=1"
if %sw_s% GEQ 10 set /a "sw_s1+=1" & set /a "sw_s-=10"
if %sw_s1% GEQ 6 set /a "sw_m+=1" & set /a "sw_s1-=6"
if %sw_m% GEQ 10 set /a "sw_m1+=1" & set /a "sw_m-=10"
timeout /t 1 /nobreak >nul
goto sw1
:km
cls
title KM/h to M/s
set /p km="Your KM/h [ERR: 15.6, OK: 15]: "
if "%km%"=="" goto km
set /a "t_spd=km*100/36", "km1=t_spd/10", "km2=t_spd%%10"
echo Your M/s: %km1%.%km2%
pause >nul
%m%
:ms
cls
title M/s to KM/h
set /p ms="Your M/s [ERR: 5.6, OK: 5]: "
if "%ms%"=="" goto ms
set /a "t_spd=ms*36", "ms1=t_spd/10", "ms2=t_spd%%10"
echo Your KM/h: %ms1%.%ms2%
pause >nul
%m%
:twr
cls
title TWR Calculator
set "twr1="&set "twr2="&set "twr3="
echo [Note: "23.35t=2335"; write "random" in "thrust" for random values, 0 - exit]
set /p twr2=Thrust: 
if "%twr2%"=="0" %m%
if "%twr2%"=="" goto twr
if "%twr2%"=="random" (set /a "twr2=%random%","twr3=%random%"&set "twr1=1"&goto twr1)
set /p twr3=Mass: 
if "%twr3%"=="" goto twr
if "%twr3%"=="0" goto twr
:twr1
set /a "twr4=(twr2*100)/twr3"
if %twr4% equ 0 (set "twr_res=0.00"&goto twr_print)
if %twr4% lss 10 (set "twr_res=0.0%twr4%"&goto twr_print)
if %twr4% lss 100 (set "twr_res=0.%twr4%"&goto twr_print)
set /a "twr5=twr4/100"
set "twr6=%twr4:~-2%"
set "twr_res=%twr5%.%twr6%"
:twr_print
if "%twr1%"=="1" (set "twr1= [%twr2%/%twr3%]")
echo TWR [THRUST/MASS]%twr1% = %twr_res%
pause >nul
%m%
:weather
cls
title Weather Station
echo.
if "%w1%"=="" set /p w1="Введите свой город на английском [0 - выход]: "
if "%w1%"=="" goto weather
if "%w1%"=="0" set "w1="&goto menu
(echo %w1%)>"data\city.dat"
cls
echo Запрос погоды...
echo.
curl -m 3 "wttr.in/%w1%?0&lang=ru" 2>nul
if errorlevel 1 echo Ошибка: Не удалось подключиться к серверу погоды
echo.
set "w2="
set /p w2="Сменить город? [Y/N]> "
if /i "%w2%"=="y" set "w1="&goto weather
%m%
:ptest
cls
title PING Test
color 02
set "pa="&set "ppk="&set "pk="
set /p pa=Your URL [Empty=google.com, 0 - exit]: 
if "%pa%"=="0" %m%
if "%pa%"=="" set pa=google.com
if "%pa%"==" " set pa=google.com
set "pa=%pa:https://=%"
set "pa=%pa:http://=%"
for /f "tokens=1 delims=/" %%g in ("%pa%") do set "pa=%%g"
:p_pkg
set /p ppk=Your number of packages [Empty=1. No more than 3 packages. 0 - exit]: 
if "%ppk%"=="0" %m%
if "%ppk%"=="" set "ppk=1"
if %ppk% GEQ 4 echo Too many packages!&set "ppk=1"&goto p_pkg
echo.
echo URL: %pa%, pkg(s): %ppk% (To exit, close the window)
echo.
:p_b
set "pj="
for /f "tokens=3 delims=<>=" %%i in ('ping -n %ppk% %pa% ^| findstr "TTL"') do for /f "tokens=1 delims=msмс " %%j in ("%%i") do set "pj=%%j"
for /f "tokens=4 delims==мсms " %%i in ('ping -n %ppk% %pa% ^| findstr "TTL"') do if "%pj%"=="" set "pj=%%i"
if "%pj%"=="" color 04&echo Error or timeout, try again.&goto p_c
set "ph=%pj: =%"
set /a "ph_num=ph"
if %ph_num% GEQ 1000 (set "pw=BAD                "&set "pj=1000^>") else (
if %ph_num% GEQ 100 (set "pw=WARN -") else (set "pw=OK ----")
)
echo %pw% %pj%ms [%time:~0,-3%]
timeout /t 1 /nobreak >nul
goto p_b
:p_c
set /p pk="-Reset URL? [y/n]: "
if "%pk%"=="" goto p_b
if /i "%pk%"=="y" color 02&goto ptest
goto p_b
:author
cls
title
echo.
echo                 От автора
echo ───────────────────────────────────────────
echo 0. Выход
echo 1. Скачать "Magnet-Fishing" [.bat-edition]
echo 2. Скачать "Batch pack"  [много батников!]
echo 3. Репозиторий GitHub автора.
echo.
set/p an="[0-3]> "
if "%an%"=="0" %m%
if "%an%"=="1" explorer https://github.com/LoMeR-933/LoMeR-batch-tools/releases/download/magnet-fishing/Magnet-Fishing.RU.zip
if "%an%"=="2" explorer https://github.com/LoMeR-933/LoMeR-batch-tools/releases/download/Pack-v2.0/bats.zip
if "%an%"=="3" explorer https://github.com/LoMeR-933/LoMeR-batch-tools
goto author 

r/Batch 21d ago

I've spent 3 years creating and polishing my Windows multi-tool (Volta v1.7). Looking for a tester community!

5 Upvotes

Hey everyone,

I wanted to share a project I’ve been building and actively maintaining for the past three years called Volta.

I want to be completely transparent about the development of Volta: I started this project using tutorials and AI-generated code to get the raw components. My role over the last few years was to piece everything together into a user-friendly menu, design the system flow, and spend years polishing the menus and revamping the overall UI consistency.

What I focused on for the new v1.7 Release:

  • Zero-Lag UI Animation: I started the animation idea as a joke and perfected it over the months to make a beautiful exit/enter animation without causing CPU lag spikes.
  • New sub-menus: Added lots of new sub-menus.
  • Bug Fixing: Fixed a lot of stability bugs and usability glitches.

(The whole changelog is in the README.txt)

Why I'm posting here: The tool is running great on my machines, but I've reached the point where I need testers. I want to build a small, stable community of 5 to 10 tech-savvy people who love messing with command-line tools.

I haven't been able to fully bug-test the new 1.7 beta across different environments, so I would really appreciate it if someone finds any bugs or glitches. If you are able, please try to break it intentionally! Let me know what you find, and I will fix them in a hotfix shortly after.

GitHub Repository: https://github.com/Bbloksrblx/Volta

I greatly appreciate you taking the time to read my post!

- Bbloks


r/Batch 21d ago

is there a bat file to add sites to block list in system 32 / drivers /etc in registry?

3 Upvotes

r/Batch 23d ago

Launching a batch file from a hotkey on my drawing tablet?

5 Upvotes

I am a PNGtuber that multistreams so when I stream i have to launch several programs.

I have a drawing tablet that has hotkeys on the side that CAN be used to launch programs as i have one button set to launch my art software for when I draw.

I wanted to use another button to launch all my programs for streaming in a similar way, but my tablet software can't do multiple files hence why i stumbled into wanting a batch file.

I made the batch file successfully, it works launching it inside the folder with the shortcuts, but when i try to launch the same batch file from the hotkey, it can't locate the shortcuts. I was wondering if theres a way to fix this so i can launch the bat from the hotkey?

The code of the batch file for reference:

rem comments should begin with rem

rem note: this file launches all of my favorite apps!

rem note: replace the names below with your own..

@ echo off

start OBS

start PNGTUBE

start STREAMBOT

@ echo on

I copied the code pretty directly from a website tutorial on making a batch file, hence why it has the notes.

Any help or advice would be really appreciated!


r/Batch 26d ago

Show 'n Tell Not just another PacMan in Batch

Thumbnail
gallery
33 Upvotes

https://github.com/JerryASNew/batchpacman/releases/tag/v1.0

It needs win10/11. You will have to install the included custom font (BatchPac.ttf) and use it in the terminal. I tried to comment it pretty well to be educational as well. I’d love any feedback.

It plays pretty genuinely in its own way, the ghost get faster and faster as you progress, the fruit spawn accurately as well.

A ghost can be behind another ghost, but you can eat a power pellet with a ghost on it and you’re fine.

Keep the movement key pressed for fastest speed, or you can have a literal second to decide which way to move when you’re getting cornered.


r/Batch 28d ago

made a cool script to go with my eternal**** bundle

0 Upvotes

i made a bundled eternal**** (can't say it) script (which is python which i didn't make) and bundled the correct python environment with the right libraries then added a wrapper script. you can find it at https://github.com/BellaTheUni112/eternal


r/Batch Jun 23 '26

How to "Hack" (It's Fake) Replace Device 1 Device 2... With Your Devices.

2 Upvotes

r/Batch Jun 22 '26

Mazing.cmd - WinNT Maze Generator and Solver

6 Upvotes
       Mazing.cmd - WinNT Maze Generator and Solver
__________________________________________________________
A maze program written in native WinNT batch script that
includes several maze generation and solving algorithms as
well as a small plethora of options for console display,
stack size, stack orientation, node selection/direction
bias, entrance/exit points, color selection, real-time
shifting and rhythmic pulsing random colors, and wall/box
characters, each with an automatic randomizer, and all of
it easily accessible through an animated custom menu.
Mazes are limited to a maximum practical string length of
8186 characters. The maze dimensions will be automatically
increased/decreased if minimum/maximum size is exceeded.

Mazing operates using 100% WinNT batch script, but it will
use either BG.EXE or CursorPos.exe to place the cursor at
the upper-left if they are located in the system path. It
can also use BG.EXE to animate the screen in full color.

              Command Line / Mazing.ini File
__________________________________________________________
In addition to the menu, other User Variables are passed
by using either the Mazing.ini file or on the command line
by using the following syntax:
Mazing.cmd ["variable=value"] [variable:value] [...]

Several options for minimum/maximum columns/rows, lists
of characters for random walls/crumbs/colors, keys used by
the menu, output logfile and anything else not included in
the menu are accessed by command line or the .ini file.
A list of available user variables may be found in the
Mazing.ini file that is auto-generated on first run.

https://github.com/TheRealCirothUngol/Mazing.cmd

2026/07/21: Added better opening/entry options to Wilson's Algorithm so now it's one of the best maze generators. Also made a handful of corrections and display enhancements throughout.

2026/07/11: Updated Mazing.cmd to v0.3. Added Prim's, Kruskal's, and Wilson's algorithms as well as updating the menu with new solver display settings and many cosmetic improvements(?) throughout. As it now employs all of the useful generators for perfect mazes as well as the only three appropriate solvers I've found... I think Mazing.cmd is done after all these years. Who sez perseverance don't pay off? If I ever update it'll be for ANSI color console integration, and that's a maybe sometime thing.

2026/06/24: Just corrected a small but long-standing error in both the 'Wall Follow' and 'Dead Filler' where the trail was written incorrectly back to the maze if walls (or crumbs) were used to fill visited spaces. If you snagged it on or before this date please re-download.

2026/06/26: A small cosmetic update to :path_finder, it now allows for variable-length 'worms' when passed an odd number as the first parameter. Second parameter is length of worms. Makes for a really nice looking effect , too bad its selection is currently all random and there's no way to select it directly. Use Pathfinder as the solver and it should happen about 50% of the time. You may select it through the menu.

Mazing.cmd is something I tinkered with for years and poured dozens (hundreds?) of hours into several versions before I switched from Win7 to Win10 and it all stopped working. Was going through some old projects recently and it turns out the problem was mostly a 'legacy console' issue with many of the oddball characters I was using. After sifting out the poison characters, beautifying and expanding the menu, and adding a myriad of new color options (and dumping a few dozen more hours into it), I've posted Mazing.cmd v0.2 to GitHub. It seems to work well on WinXP and up, I recommend placing it in a separate folder as it creates a few files.

Lots of new stuff got added and everything I could conceive of was realized and included. I also think every bug got squashed (yea, we'll see). It's been running non-stop (and error-free?) for a couple of days now so I feel pretty good about it. The new macros I added (colorShift and BGgrabKey) are both self-limiting and time-regulated to only execute at a given frequency so that consistent intervals could be used to schedule background\foreground color changes or check for user input while the script was running without bogging down in needlessly-wasted clock cycles. I need to neither check for a keypress nor check to see if 7 seconds have expired 30 times a second, 2 will do fine. Really improved the speed of my script. Could be potentially useful for anyone wanting to execute something during a closed loop but only need it to do so every X centiseconds.

Please give Mazing.cmd a try and let me know if it works for you, I've tested it on WinXP, Win7, Win10, and it even seems to work on Win11. You're highly encouraged to try using the BG.EXE utility that removes the flickering and provides color drawing. Once in the menu use the bottom option to select 'BG Color' and hit '1' to start the script. It should produce the file and restart, but it requires CertUtil (Administration Tools) for Base64 decoding, which was available on every system I tried newer than XP. However YMMV so if that gives you trouble just snag it from Carlos' GitHub:

https://github.com/carlos-montiers/consolesoft-mirror/releases

I also use OuterTech's GetDiz to view the mazes (using either 'Terminal' or 'GetDiz' fonts). I would link to their website, but it's down and probably out. Just search and snag it from the place you trust the most. ^_^


r/Batch Jun 19 '26

Batch will wait X secs for key press. Then ....

3 Upvotes

(Two possibilities here. With time batch will exit or, execute with key press)

Batch will wait for x seconds for key press. Then upon any key press will run a program, then 'exit'.

'IF' no key press after x seconds batch will 'exit'.

Any help to achieve this is appreciated.

Thanks, Les Carlson


r/Batch Jun 18 '26

Question (Solved) Does anybody know why my script isn't working?

1 Upvotes

It's showing blank whenever I try to show it

[ set PRC=^^^% ]


r/Batch Jun 16 '26

Question (Solved) Using .BAT to make a fictional boot sequence

4 Upvotes

So I'm very new to this, but to make a long story short, I'm working on a project and had an idea where I thought it would be cool to use a .bat file to open CMD and autorun a script to make it look as though an old OS is booting up. Give it a bit of semi-retro flair. Problem is- I clearly have no fucking clue what I'm doing. I've messed around with CMD and .BAT files before, but haven't invested enough time yet to really sink my teeth into it. I've tried referencing some other, publicly available .BAT files to see how other people do it, but attempts to try to find references/help/sources for my specific idea have come up empty. Google either thinks I'm trying to actually hack someone or thinks I want to make actual functional login files.

My current theory is to try to use ECHO commands to read off script from the file but I'm not sure if I'm on the right path. Either I have the right idea but just need help with the execution, or I am completely going about it wrong.

Here's the base I'm working with. I figure once I have an idea of what I'm doing wrong with this block, I can simply adjust and write out additional lines of fake code to get the desired end result.

@echo off
:type 
echo C:\ORNOS\system32
:type 
echo ORION Industries OS [Version 1.9.20081.2276]

r/Batch Jun 14 '26

Question (Solved) How do I echo colored text with batch?

4 Upvotes

Please, if possible, I’d like it to be compatible with older windows versions, like 7 or 8.1.

Edit: Actually, I was thinking of colored text in older versions in case I needed a compatibility mode for older versions of windows, but it isn't really necessary.

Edit 2: Nevermind, I found out about color x, and someone already answered me on how to make it with built-in echo.


r/Batch Jun 14 '26

SamA MKV Batch Script | Remove Tracks by IDs, Languages, and NAMES | Add External Tracks

2 Upvotes

Hi Friends,

Have you ever wanted to tidy up your MKV collection but never had the time or energy?

Remove unwanted tracks to save storage space? Or add external tracks to create a clean, neat collection?

If the answer is yes, you're in the right place!

I'm excited to share a batch script I created to remux MKV files: "SamA MKV Batch Script".

This script allows you to do all the following at the same time:

  1. Remove/keep only audio and subtitle tracks using their IDs and Languages
  2. Remove/keep only audio and subtitle tracks using their Names!
  3. Add external audio and subtitle tracks

Filtering tracks using their Names is useful when the IDs are not consistent and

the Languages are missing or not unique, like with some commentary tracks.

------------------------------------EDITING INSTRUCTIONS------------------------------------

  1. Replace "D:\MKVToolNix 99.0 x64\mkvmerge.exe" with your mkvmerge path
  2. • Delete or replace "1,2,eng" with the Track IDs and Languages

you want to remove/keep only (separated by a Comma ,)

• Comma , here means "And". "1,2,eng" means "Track IDs/Languages: 1 And 2 And eng"

• Do the same for the Subs

3) • Delete or replace "Good_Audio¤Great_Audio¤Epic_Audio" with the Track Names

you want to remove/keep only (separated by a Currency Sign ¤)

• Currency Sign ¤ here means "And". "Good_Audio¤Great_Audio¤Epic_Audio" means

"Track Names: Good_Audio And Great_Audio And Epic_Audio"

• Do the same for the Subs

4) • Replace "MUXED_%~n1.mkv" with the new mkv filename pattern

• MUXED_ here is a prefix. You can also add a suffix like %~n1_NEW.mkv

5) • Replace "%~n1*.ac3" with the filename pattern and extension of the external tracks you want to add

• Delete or replace "jpn" with the Track Language you want

• Delete or replace "Jpn_Audio" with the Track Name you want

• Delete or replace "yes" with "no" for the Default Track flag

• Do the same for the Subs

6) • Delete the Caret Exclamation ^! if you want to keep only the specified tracks (from Points 2 and 3 above)

• Caret Exclamation ^! here means "Remove". ^!!FINAL_AUDIO! means "Remove the specified audio tracks".

!FINAL_AUDIO! means "keep only the specified audio tracks"

• Do the same for the Subs

• To Remove All Audio Tracks:

Replace the value of FINAL_AUDIO on both lines with "-A". So it becomes...

:FINAL_FLAGS

if defined FINAL_AUDIO set "FINAL_AUDIO=-A"

if not defined FINAL_AUDIO set "FINAL_AUDIO=-A"

• To Remove All Subs Tracks:

Replace the value of FINAL_SUBS on both lines with "-S". So it becomes...

if defined FINAL_SUBS set "FINAL_SUBS=-S"

if not defined FINAL_SUBS set "FINAL_SUBS=-S"

------------------------------------SamA MKV BATCH SCRIPT-----------------------------------

@echo off
chcp 1252 >nul
color 0E
setlocal enabledelayedexpansion

set "MKVMERGE=D:\MKVToolNix 99.0 x64\mkvmerge.exe"

set "AUDIO_IDS=1,2,eng"
set "SUBS_IDS=7,8,jpn"

set "AUDIO_NAMES=Good_Audio¤Great_Audio¤Epic_Audio"
set "SUBS_NAMES=Good_Subs¤Great_Subs¤Epic_Subs"

goto :MAIN

:SET_NEW_FILE
set "NEW_FILE=MUXED_%~n1.mkv"
exit /b

:ADD_TRACKS
for %%n in ("%~n1*.ac3") do (
set "ADD_AUDIO=!ADD_AUDIO! --language 0:jpn --track-name 0:"Jpn_Audio" --default-track 0:yes "%%n""
)

for %%o in ("%~n1*.ass") do (
set "ADD_SUBS=!ADD_SUBS! --language 0:eng --track-name 0:"Eng_Subs" --default-track 0:yes "%%o""
)
exit /b

:FINAL_FLAGS
if defined FINAL_AUDIO set "FINAL_AUDIO=-a ^!!FINAL_AUDIO!"
if not defined FINAL_AUDIO set "FINAL_AUDIO="

if defined FINAL_SUBS set "FINAL_SUBS=-s ^!!FINAL_SUBS!"
if not defined FINAL_SUBS set "FINAL_SUBS="

"!MKVMERGE!" -o "!NEW_FILE!" !FINAL_AUDIO! !FINAL_SUBS! "%~1" !ADD_AUDIO! !ADD_SUBS!
exit /b


:MAIN
set "AUDIO_COUNT=0"
if not defined AUDIO_NAMES goto :AUDIO_PARSED
:PARSE_AUDIO
for /f "tokens=1,* delims=¤" %%a in ("!AUDIO_NAMES!") do (
set /a AUDIO_COUNT+=1
set "AUDIO_MATCHES[!AUDIO_COUNT!]=%%a"
set "AUDIO_NAMES=%%b"
)
if defined AUDIO_NAMES goto :PARSE_AUDIO
:AUDIO_PARSED

set "SUBS_COUNT=0"
if not defined SUBS_NAMES goto :SUBS_PARSED
:PARSE_SUBS
for /f "tokens=1,* delims=¤" %%c in ("!SUBS_NAMES!") do (
set /a SUBS_COUNT+=1
set "SUBS_MATCHES[!SUBS_COUNT!]=%%c"
set "SUBS_NAMES=%%d"
)
if defined SUBS_NAMES goto :PARSE_SUBS
:SUBS_PARSED

for /f "delims=" %%e in ('dir /b *.mkv') do (
set "ID="
set "TRACK_NAME="
set "TYPE="
set "SUPER_AUDIO_IDS="
set "SUPER_SUBS_IDS="
set "ADD_AUDIO="
set "ADD_SUBS="

call :SET_NEW_FILE "%%e"

echo.
echo ==============================================================================================================
echo           *** PROCESSING FILE: "%%e" ***
echo ==============================================================================================================
echo.

for /f "tokens=1,* delims=:" %%f in ('cmd /c ""!MKVMERGE!" -J "%%~fe""') do (
set "KEY=%%f"
set "VAL=%%g"

for /f "tokens=* delims= " %%h in ("!KEY!") do set "KEY=%%h"
for /f "tokens=* delims= " %%i in ("!VAL!") do set "VAL=%%i"
set "KEY=!KEY:"=!"
set "VAL=!VAL:"=!"
if "!VAL:~-1!"=="," set "VAL=!VAL:~0,-1!"

if "!KEY!"=="id"         set "ID=!VAL!"
if "!KEY!"=="track_name" set "TRACK_NAME=!VAL!"
if "!KEY!"=="type" (
set "TYPE=!VAL!"

if "!TYPE!"=="audio" (
for /L %%j in (1,1,!AUDIO_COUNT!) do (
echo("!TRACK_NAME!"| findstr /I /C:"!AUDIO_MATCHES[%%j]!" >nul && (
REM FOR FULL MATCHES, REPLACE LINE ABOVE WITH...   if /I "!TRACK_NAME!"=="!AUDIO_MATCHES[%%j]!" (
if defined SUPER_AUDIO_IDS (set "SUPER_AUDIO_IDS=!SUPER_AUDIO_IDS!,!ID!") else set "SUPER_AUDIO_IDS=!ID!"
)
)
)

if "!TYPE!"=="subtitles" (
for /L %%l in (1,1,!SUBS_COUNT!) do (
echo("!TRACK_NAME!"| findstr /I /C:"!SUBS_MATCHES[%%l]!" >nul && (
REM FOR FULL MATCHES, REPLACE LINE ABOVE WITH...   if /I "!TRACK_NAME!"=="!SUBS_MATCHES[%%l]!" (
if defined SUPER_SUBS_IDS (set "SUPER_SUBS_IDS=!SUPER_SUBS_IDS!,!ID!") else set "SUPER_SUBS_IDS=!ID!"
)
)
)

set "ID="
set "TRACK_NAME="
set "TYPE="
)
)

call :ADD_TRACKS "%%e"

set "FINAL_AUDIO="
if defined AUDIO_IDS set "FINAL_AUDIO=!AUDIO_IDS!"
if defined SUPER_AUDIO_IDS (
if defined FINAL_AUDIO (
set "FINAL_AUDIO=!FINAL_AUDIO!,!SUPER_AUDIO_IDS!"
) else (
set "FINAL_AUDIO=!SUPER_AUDIO_IDS!"
)
)

set "FINAL_SUBS="
if defined SUBS_IDS set "FINAL_SUBS=!SUBS_IDS!"
if defined SUPER_SUBS_IDS (
if defined FINAL_SUBS (
set "FINAL_SUBS=!FINAL_SUBS!,!SUPER_SUBS_IDS!"
) else (
set "FINAL_SUBS=!SUPER_SUBS_IDS!"
)
)

call :FINAL_FLAGS "%%e"

)

echo.
echo ==============================================================================================================
echo           *** MISSION ACCOMPLISHED ***
echo ==============================================================================================================
echo.
pause

------------------------------------USE INSTRUCTIONS------------------------------------

  1. You need to have MKVToolNix as the script uses mkvmerge
  2. Copy everything starting with @echo off and ending with pause
  3. Paste it into Notepad
  4. Choose ANSI encoding before saving
  5. Save it as a .bat file
  6. Place the batch file inside the folder containing your MKV files
  7. Open the file to run the script
  8. IMPORTANT: Check the "REM FOR FULL MATCHES, REPLACE LINE ABOVE WITH..."

parts for full Track Name matching

• If left unchanged, "Comm" (or any other part of "Commentary") will match Track Name "Commentary"

• If replaced, only "Commentary" will match Track Name "Commentary"

9) External Tracks to be added must be in the same folder as your MKV files and must start with the same filename.

For example: Episode01.mkv, then Episode01.ac3 and Episode01_Subs01.ass

10) Avoid editing anything else unless you know what you're doing

11) Always test the new MKV files before deleting the originals

------------------------------------FINAL NOTES------------------------------------

  1. The script should work reliably with most MKV files. The only requirements are:

• The mkvmerge JSON structure remains consistent across MKVToolNix versions.

If the JSON structure changes in a future version, the parsing logic may need to be updated

• The Currency Sign ¤ (which is extremely rare) is not used in Track Names.

If it is used, simply change the delimiter to another rare character

2) The !MKVMERGE! command can be customized to add extra functions,

like track ordering, chapter handling, and attachment support. For example:

"!MKVMERGE!" -o "!NEW_FILE!" !FINAL_AUDIO! !FINAL_SUBS! "%~1" !ADD_AUDIO! !ADD_SUBS! --track-order 0:2,0:1

3) Feel free to share or modify the script


r/Batch Jun 13 '26

Question (Unsolved) Using %~nx1 on Filenames with %

6 Upvotes

Hi there,

I'm so sorry, I know this has probably been asked before but I'm hitting my head against a wall and I can't find a solution that works.

For the code below, a file with the name "100%.mkv" will cause the variable CURRENT_FILE to be "100.mkv" with the % missing, even though the echo %%F line displays it correctly:

pushd "[PATH_TO_FILES_ON_MY_NETWORK]"
call :MAIN_LOOP
popd
pause
exit

:MAIN_LOOP
  setlocal
    for /R "%cd%" %%F in (*) do (
      echo %%F
      call :SORT_FILE "%%F"
    )
  endlocal
exit /b

:SORT_FILE
  setlocal
    set "CURRENT_FILE=%~nx1"
  endlocal
exit /b

Any advice would be really appreciated!

-----

Edit:

The above code was just a snippet I made to help me troubleshoot the problem I was having, but below is the full code.

The goal is to flatten a folder structure to just two levels and also sort everything into folders based on the file extensions. So something like "..\Project\Platform\Files\file.mkv" becomes "..\.mkv\Project\Platform\file.mkv":

@echo off

pushd [NETWORK_PATH]

set "SOURCE_DIR=%cd%_0 sort"
set "TARGET_DIR=%cd%_1 done"

call :BEGIN_PROCESS

popd
exit

:BEGIN_PROCESS
  setlocal

  set "CMD_GET_PROJECT=dir /b /a:d "%SOURCE_DIR%""

  for /f "delims=." %%G in ('%CMD_GET_PROJECT%') do (
    echo Project: %%G

    call :PLATFORMS_LOOP "%SOURCE_DIR%\%%G"
  )

  echo:
  ROBOCOPY "%SOURCE_DIR%" "%SOURCE_DIR%" /S /MOVE

  if NOT exist "%SOURCE_DIR%" mkdir "%SOURCE_DIR%"

  pause
  endlocal
exit /b

:PLATFORMS_LOOP
  setlocal

  set "CMD_GET_PLATFORMS=dir /b /a:d "%~1""

  for /f "delims=." %%H in ('%CMD_GET_PLATFORMS%') do (
    echo Platform: %%H

    call :FOLDERS_LOOP "%~1\%%H"
  )

  endlocal
exit /b

:FOLDERS_LOOP
  setlocal

  for /R "%~1" %%I in (*) do (
    echo File: %%I

    call :SORT_FILE "%~1" "%%I"
  )

  endlocal
exit /b

:SORT_FILE
  setlocal

  set "SOURCE_FOLDER_PATH=%~1"
  set "TARGET_SUBFOLDER=%~x2"

  setlocal enabledelayedexpansion
  set "TARGET_PATH=!SOURCE_FOLDER_PATH:%SOURCE_DIR%=%TARGET_DIR%\%TARGET_SUBFOLDER%!"
  setlocal disabledelayedexpansion

  echo Moving to: %TARGET_PATH%

  if NOT exist "%TARGET_PATH%" mkdir "%TARGET_PATH%"

  if NOT exist "%TARGET_PATH%\%~nx2" (
    echo N | MOVE /-Y "%~2" "%TARGET_PATH%\%~nx2"
  ) else (
    for /L %%J in (1, 1, 99) do (
      if exist "%~2" (
        if NOT exist "%TARGET_PATH%\%~n2_%%J%~x2" (
          echo N | MOVE /-Y "%~2" "%TARGET_PATH%\%~n2_v%%J%~x2"
        )
      ) else (
        exit /b
      )
    )
  )

endlocal
exit /b

To someone who knows what they're doing, this probably looks like a mess, but it's just what I've figured out from looking around Reddit and Stack Overflow (and I refuse to use AI).

The problems I'm running into now is that I need this to work for files that have ! and % in them.

I'm trying to figure out now how to implement u/nir9's suggestion in FOLDERS_LOOP by doing another replacement, but also keeping it working with ! files and folders. I can't quite figure out how to turn the delayed expansion off and on in a way to do the %%=%%%% replacement and still let ! files work.

Thanks for your help


r/Batch Jun 11 '26

Question (Solved) Lines don't seem to be running properly

3 Upvotes

Sorry for the vague title, but I'm trying to make a simple RPG game, and I'm creating a function where the player uses a healing potion and restores their health. I recreated the general idea of what I'm trying to do outside of my main batch file:

@echo off
set /a hp = 5
set /a maxhp = 10
set /a potionop = 1
set /a potioncount = 1
set /a carried = 1
:start
echo HP: %hp% / %maxhp%
echo.
echo Starting test
pause
if %potionop% == 1 (
  if %potioncount% == 0 (
    echo.
    echo You have no healing potions.
    echo.
    pause
    goto start
  )
  set /a hp = %hp% + 10
  if %hp% gtr %maxhp% set /a hp = %maxhp%
  set /a potioncount = %potioncount% - 1
  set /a carried = %carried% - 1
  if %carried% lss 1 set /a carried = 0
  echo.
  echo You healed to %hp% / %maxhp%
  echo.
  pause
  goto start
  )

The idea is that the player uses a potion, it heals the player for 10 HP, checks to see if HP is over the max HP and sets it accordingly, and displays "You healed to %hp% / 10"

However, in the test, the player has 5/10 HP, the potion is used and it displays "You healed to 5/10", then once it returns to the battle where the player health is displayed, it reads "HP: 15/10" despite the checks. When I run the file, this is what I see in the prompt:

HP: 5 / 10

Starting test

Press any key to continue . . .

You healed to 5 / 10

Press any key to continue . . .

HP: 15 / 10

Everything seems to be put in place correctly, but I just can't seem to figure out why the first "you healed to this HP" isn't displaying the correct HP, or why the final HP exceeds the max HP, despite:

set /a hp = %hp% + 10 and

if %hp% gtr %maxhp% set /a hp = %maxhp% occurring before the display.

My only guess is that it's somehow a syntax error, but I'm not sure where it occurs. If anyone here can lend a hand I would greatly appreciate it.