Created
July 31, 2020 10:05
-
-
Save nandini-menon/8d154d813113f5b3149b5c424143f831 to your computer and use it in GitHub Desktop.
Create files automatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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