Generate lots of files with FSUTIL

To test network performance I was in a need of copying many files of a certain size to another host in the network.

I created thousands of files of a specific size using the standard WIndows FSUTIL command line tool.

fsutil file createnew filename filesize

Use the Loop command /L to create lots of files in once.
If you want to use the loop in a .cmd file instead then it’s necessary to replace the single % with a double %% .

The examples are to be run from a command line, to run the same command from a powershell prompt use the CMD /C “…” before the command. For example :

cmd /c “For /L %i in (1,1,2500) do fsutil file createnew testfile%i.tmp 1048576”

This command creates 20.000 files of 10KB (=10240 bytes) named testfile1.tmp, testfile2.tmp, testfile3.tmp…

For /L %i in (1,1,20000) do fsutil file createnew testfile%i.tmp 10240

This command creates 10.000 files of 128KB named testfile1.tmp, testfile2.tmp, testfile3.tmp…

For /L %i in (1,1,10000) do fsutil file createnew testfile%i.tmp 131072

This command creates 2500 files of 1024KB named testfile1.tmp, testfile2.tmp, testfile3.tmp…

For /L %i in (1,1,2500) do fsutil file createnew testfile%i.tmp 1048576

This command creates 1000 files of 10MB named testfile1.tmp, testfile2.tmp, testfile3.tmp…

For /L %i in (1,1,1000) do fsutil file createnew testfile%i.tmp 10485760

Leave a Reply

Your email address will not be published.