r/Batch • • 1d ago

Gnarly batch

2 Upvotes

Can anyone share actual batch?

I wanna see your gnarlest sanitized batch


r/Batch • • 10d ago

Show 'n Tell A batch Pixel Editor compatible with any code

Post image
16 Upvotes

I updated a recent batch pixel Editor project and I said that I'd make it compatible with any batch code

So here it is, and with more options

You just need to write: call BPE_myproject.bat draw

Make sure that your image is in the same folder as your project

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


r/Batch • • 10d ago

Question (Unsolved) Robocopy log question

2 Upvotes

Within the company I work for we use a batch file with a robocopy command to "install" a specific piece of software on user's laptops. This was chosen because the software is particularly difficult to setup right. It now only requires us to do one proper installation, after which we manually copy the software to a directory on the company network. From there, robocopy copies it to the user's hard drive.

The command looks like this (I had to remove company and software names):

ROBOCOPY I:\xxx-xxxxxx\X\apl\SOFTWARE\00-Admin\Admin-xxx\Install\Software%VERSION%\ C:\Users\%USERNAME%\AppData\Local\Software%VERSION%\ /S /LOG+:install%VERSION%.log

As can be seen, a logfile is extended each time a user runs the batch file and installs the software. Not only can we see if the install was succesfully, but it also allows us to track who has installed the software and should be informed of any changes or updates.

In the past (I'm talking about 2022 and earlier), not one but two log files were present. In the first file, named install%VERSION%.log, the full log could be found. The second file, named install%VERSION%_Users.log, only contained the start date & time, source paths, destinations and user's full names. This made it incredibly easy to quickly find out who uses the software. At some point after 2022, this particular file stopped being updated. The robocopy command itself however, has not changed once since the batch file was originally created in 2016.

Was this an automatic function of the robocopy /log+ command? Is there a way to bring this back? I cannot find any information about this online at all. Almost as if it never has existed. But yet, somehow, for 6-or-so years we had two log files updating simultaneously.

It is not something we particularly need, but it used to be quite a lot easier to keep track of the users using this second (and shorter) log file.


r/Batch • • 12d ago

Question (Unsolved) A quick technical question!

3 Upvotes

I am working on a chatbot written in Batch that learns from text files and then rewrites its own Batch script to directly incorporate what it has learned. My goal is to consolidate everything—the code and the accumulated knowledge—into a single file; the user simply needs to provide text files , I realize that this type of mechanism is unconventional and might trigger antivirus alerts. What do you think of this approach?

I’m curious to hear your thoughts.


r/Batch • • 13d ago

Question (Unsolved) Which batch to exe software to use?

3 Upvotes

Hi all, long story short I have used bat2exe and windows defender is picking up as threat and removing it. Not sure if its the actual script or the software itself. Anyways, which batch to exe is safest and wont likely get flagged by antivirus? Thank you


r/Batch • • 16d ago

i made a shell on Batch Script called "CLIShell"

9 Upvotes

Hello, i did a shell called "CLIShell", the version of it is 1.3.0 and it's secure (i hope), it's on Gitlab and it has a File Manager, Settings, Program Launcher, Recent Apps List (on Program Launcher), Update Verifier, Computer Informations, etc.

Link for it: https://gitlab.com/yabadodomingoyabayabae/clishell

i hope you like it:)


r/Batch • • 16d ago

Hello everyone

7 Upvotes

Cela fait un an que je suis à vos côtés et j'ai beaucoup appris grâce à vous , Un grand merci à tous pour votre aide, vos conseils et le partage de votre expérience ,Je suis vraiment heureuse de faire partie de cette belle communauté r/Batch


r/Batch • • 18d 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 • • 21d 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 • • 23d ago

Show 'n Tell I made a pixel editor in CMD

Post image
19 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 • • 24d 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 • • 26d ago

Show 'n Tell ZOMBIE SHOOTER BATCH

Thumbnail
gallery
12 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 • • 26d ago

RawOS v1.2.1

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

I share with you my pixel creations

Thumbnail
gallery
13 Upvotes

r/Batch • • 27d 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 • • 28d 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 • • 28d 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 • • 28d ago

Question (Unsolved) call or goto

6 Upvotes

Who is the fast ?

Do you use more?


r/Batch • • 28d 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
1 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 • • Oct 14 '26

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
15 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 :(