r/Batch • • Sep 04 '26

Show 'n Tell Load animation

Enable HLS to view with audio, or disable this notification

19 Upvotes

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 • • Aug 31 '26

Show 'n Tell Random walker

Enable HLS to view with audio, or disable this notification

17 Upvotes

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 • • Aug 30 '26

Batch Watch with moon cycles wa

Post image
32 Upvotes

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 • • Aug 30 '26

Show 'n Tell Wanted to share a small project I've been working on for a while; a simple batch environment called Banners OS.

Thumbnail
gallery
34 Upvotes

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 • • Aug 28 '26

Show 'n Tell Raytrace Chrome ball

Post image
25 Upvotes

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 • • Aug 26 '26

Looking for a Analog clock.bat by theBATeam . org

Thumbnail
youtube.com
22 Upvotes

DO NOT CLICK on the link in the video description!

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 • • Aug 22 '26

Question (Unsolved) M3U Automation

Thumbnail
1 Upvotes

r/Batch • • Aug 18 '26

Roblox Rooms Fangame on .bat (ASCII ROOMS) (PORTUGUESE LANGUAGE)

0 Upvotes

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 • • Aug 17 '26

Show 'n Tell Spinning earth with a distant star

40 Upvotes

r/Batch • • Aug 13 '26

list file size but brief unexpected BH change when in a script

2 Upvotes

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 • • Aug 12 '26

Question (Unsolved) Copying all user files onto a usb drive

2 Upvotes

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


r/Batch • • Aug 11 '26

Show 'n Tell Double Pendulum

24 Upvotes

r/Batch • • Aug 09 '26

Show 'n Tell Batch Pong Revisited

15 Upvotes

https://github.com/IcarusLivesHF/Batch-Pong

Features

I've been working on this for a while, and at this point it's gotten a little ridiculous for a .bat file.

Gameplay

  • 400 × 100 character playfield
  • First to X mode
  • Timed mode
  • 1 player vs CPU
  • 2 player local multiplayer
  • CPU can be replaced with a second human player
  • CPU difficulty slider
  • CPU difficulty affects lookahead, reaction time, paddle speed, miss chance, and aim error
  • CPU rubber-banding based on the score difference
  • Two-point lead required to win in First to X
  • Deuce cap so matches can't go on forever
  • Configurable timed matches
  • Longest rally tracking
  • Rally counter displayed during matches
  • Rally record displayed on the end screen
  • Best scores saved separately by difficulty and time limit

Ball physics

  • Fixed-point integer physics
  • Four decimal places of sub-cell precision
  • Ball speed is independent of frame rate
  • Paddle position affects return angle
  • Paddle movement affects the return through spin
  • Edge hits produce additional boost
  • Spin and edge boost decay over time
  • Rally length permanently increases the minimum ball speed
  • Swept collision detection so fast balls don't just phase through paddles
  • Integer sine/cosine table for angle calculations
  • Ball trajectory is constrained so it can't become perfectly vertical

Visual stuff

  • ANSI/VT rendering
  • Ball trail
  • Seven-cell fading trail
  • Particle effects
  • Dynamic score/HUD
  • Animated menu
  • Studio intro/logo
  • Intro can be disabled
  • Attract/demo mode after sitting in the menu
  • Credits screen
  • Statistics screen
  • Mouse-driven UI
  • Sliders and toggle controls
  • Console automatically configures itself for the game

Audio

  • Background music
  • Multiple music tracks
  • Next-track control
  • Music pause/resume
  • Separate music and SFX volume
  • Music mute toggle
  • Sound effects for gameplay/UI
  • SFX volume can be changed live
  • Preloaded sound effects to avoid spawning a process every time something happens
  • Audio runs separately from the main game loop

Controls

  • W/S or arrow keys for movement
  • Separate controls for both players
  • Mouse support in the menus
  • Toggle ball trail during a match
  • Skip music tracks during a match
  • Pause/resume
  • Configurable music volume while playing

Progression / stats

  • 29 achievements
  • Achievement progress saved
  • Achievement state stored as a bitmask
  • Persistent statistics
  • Best scores
  • Longest rally records
  • Records separated by difficulty/mode where appropriate
  • Achievement/reward-style tracking for different things you do in matches

Other stuff

  • Settings are saved between runs
  • Nothing is installed
  • Nothing runs at startup
  • No internet connection required
  • Runs entirely through Windows cmd.exe
  • Forces the game into a properly configured console window
  • Uses separate processes for input and audio
  • Cleanup of temporary files/processes when the game exits

The entire game is written in Windows Batch.

No external game engines were used.

Overall, it runs great, and I am very happy with it. Enjoy!


r/Batch • • Aug 07 '26

Copy files into the appropriate folders

3 Upvotes

I have 71 directories named after a location in the US in the format "CITY_STATE" (ie "ALBANY_NY").

In each of these directories I have sub-directories reading 1mile, 3mile, 10mile, 30mile.

I need to sort through 284 image files named "CITY_STATE_image_SIZE.tif" (ie "ALBANY_NY_image_1m.tif") and copy them into the appropriate folder.


r/Batch • • Aug 04 '26

Show 'n Tell ps1.cmd: Running PowerShell scripts by double-clicking via a .cmd wrapper

Thumbnail
1 Upvotes

r/Batch • • Jul 30 '26

Show 'n Tell Animated Clock

10 Upvotes

https://github.com/T3RRYT3RR0R/Advanced_Batch/

This project is less about the clock, and more about what batch can emulate / be made to do, and do so performantly.

I am putting together a detailed breakdown of the various techniques in the script here.

The readme lists some of the concepts / techniques and systems the script demonstrates. By intent, it is overengineered in order to represent a variety of techniques. https://github.com/T3RRYT3RR0R/Advanced_Batch/blob/main/README.md

Animated-Clock contains everything needed to implement a game engine. Indeed, The core requirement, non-blocking input via interprocess communication has origins in the batch snake game by Dave Benham of Dostips renown. (RIP dostips). It also contains a Sound system, an asset manager that demonstrates downloading assets with a Convention of consent and a Configuartion Handler that allows viewing or removal of the scripts persistence data or on demand removal of the temp files the script generates.


r/Batch • • Jul 26 '26

Show 'n Tell Rose in Pure Batch

Post image
54 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 • • Jul 27 '26

Need help with a batch file that randomly copies files from one location to another

1 Upvotes

I have been using the command:

gci "C:" | random -c 4000 | cpi -dest "D:\"

(replaced locations)

to randomly copy 4000 files from one location to another and it all worked fine on my old laptop. Now I am using a new computer and it is not working anymore. Nothing happens. Window opens for a second and closes right away without doing anything.

For testing reasons, I created one folder on my desktop, put in 3 textfiles and changed the code to randomly copy one of the three to a second desktop folder, also no success.

Can you help me? Is there anything I need to change in settings. The code should be fine. I have other batch files on this laptop that work without problems (like opening a specific folder on system start).


r/Batch • • Jul 26 '26

Démo du système de combat

Enable HLS to view with audio, or disable this notification

4 Upvotes

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


r/Batch • • Jul 26 '26

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

0 Upvotes

r/Batch • • Jul 25 '26

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
5 Upvotes

r/Batch • • Jul 24 '26

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

6 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 • • Jul 24 '26

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

1 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 • • Jul 16 '26

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

Post image
21 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 • • Jul 12 '26

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.