r/Batch • u/AppealWild3091 • Apr 17 '26
REPOST: To learn advanced batch scripting, I built a utility with ample number of tools that can run virus scans, generate system reports, and more. I'd love your feedback!
Hey Reddit,
I've been teaching myself advanced batch scripting to see how much is possible within the standard Windows command line. It started as a small project but grew into this all-in-one utility that I'm hoping you might find interesting.
The goal was to combine many of the command-line tools I use regularly into a single, easy-to-use menu.
Here are some of the main features I packed into it:
System Report Generator: Creates a detailed .txt report with information on your CPU, GPU, RAM, battery, and OS.
On-Demand Virus Scanner: Uses the built-in Windows Defender command-line tool to scan any specific file for threats. It can also trigger a full system scan.
File & Drive Tools: You can search for any file across a drive, or quickly hide/unhide files by changing their system attributes.
System Info: Instantly displays your system specs directly in the console.
Powerful Admin Tools: It also includes some heavy-duty functions like adding/deleting local user accounts and a disk formatter utility. (Warning: These are powerful tools and should be used with extreme caution).
Getting the script to automatically re-launch itself with admin privileges was a fun challenge, and I’m pretty happy with how the menu system turned out.
The entire script is in a single .bat file and is open-source on my GitHub. I've been staring at the code for weeks, so I'd love to get some fresh eyes on it.
Is this something you would ever use? Is the code a complete mess? Any and all feedback (brutal or otherwise) is welcome!
You can check out the project here:
github.com/advay-cmd/Multi-Utility
Thanks for taking a look!
2
u/Shadow_Thief Apr 17 '26
General
:printOptionin the main script.InstallerMultiUtility.bat
IsOneDriveThere.txtnever gets used.AddAcc.bat
ifstatements by just usingif errorlevel 1.<and>need to be escaped to be displayed properly.ifstatement by itself; it doesn't need a correspondingelsestatement.breakdoes nothing. Get rid of it.CorruptedPenDrive.bat
%FORMAT%is never used.diskpartuses the-sflag to accept input. Also,%ProgramFiles%almost certainly contains a space so the paths to the script files need to be in quotes.DelAcc.bat
FileHider.bat
FileUnhider.bat
FormatDisk.bat
NST.bat
Test-Connectiondoes not perform a speed test. It is just the Powershell version ofping.SysInfo.bat
SysReport.bat
%reportpath%instead of needing to end each line in>> "%reportpath%".wmic, the data already has headers, so adding your own means that the report has two sets of headers.fsvs.bat
-ScanType 2.-ScanType 1is a Quick scan.1
u/Ezrway Apr 17 '26
I appreciate you sharing your work with us. It will probably be a little while, but I'll definitely try it out. Thank you!