Skip to content

Instantly share code, notes, and snippets.

@SkyN9ne
Created February 19, 2023 01:24
Show Gist options
  • Save SkyN9ne/0cfacd04949aad4ee5ecab7dfdfa2cbc to your computer and use it in GitHub Desktop.
Save SkyN9ne/0cfacd04949aad4ee5ecab7dfdfa2cbc to your computer and use it in GitHub Desktop.
Batch script for creating dummy files using fsutil
REM Batch script for generating a dummy file using fsutil
REM Dummy files have no functionality or purpose alone
REM They're however very useful for testing, debugging or benchmarking
REM You could for example benchmark and compare 7-Zip vs WinRAR performance
@echo OFF
chcp 65001
setlocal EnableDelayedExpansion
SET size2=a
SET "size2=!size2:a=>!"
:top
CLS
MODE 60,14
TITLE Dummy File Generator
COLOR 0A
SET newf=ERR#000#
SET /p newf=Enter output filename:
IF !newf! == ERR#000# GOTO top
SET newf=!newf!.txt
SET size=#ERR000#
ECHO (SIZE) = (BYTES) / (BITS)
ECHO ╔════════════════════════════════════╗
ECHO ║1 KB = 1024 / 8192 ║
ECHO ║1 MB = 1048576 / 8388608 ║
ECHO ║1 GB = 1073741824 / 8589934592 ║
ECHO ║1 TB = 1099511627776 / 8796093022208║
ECHO ╚════════════════════════════════════╝
ECHO Enter the file size to be created in bytes:
SET /p size=!size2!
IF EXIST !newf! DEL /S /Q /F !newf! >NUL
fsutil file createnew !newf! !size! >NUL
ECHO Finished!
TIMEOUT 2 /NOBREAK >NUL
GOTO top
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment