Skip to content

Instantly share code, notes, and snippets.

@nandini-menon
Created July 31, 2020 10:05
Show Gist options
  • Save nandini-menon/8d154d813113f5b3149b5c424143f831 to your computer and use it in GitHub Desktop.
Save nandini-menon/8d154d813113f5b3149b5c424143f831 to your computer and use it in GitHub Desktop.
Create files automatically
SETLOCAL ENABLEDELAYEDEXPANSION
@echo off
set numfiles=%1
set maxfilesize=%2
set destination=%3
if not defined destination set destination=C:\temp\
for /l %%x in (1, 1, %numfiles%) do (
SET /A randomsize=!RANDOM! * %maxfilesize% / 32768 + 1
for /f %%A in ('powershell !randomsize! * 1048576') do (
start /B CMD /C CALL fsutil file createNew %destination%File%%x.tar %%A
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment