Apr 9 2008 7:42PM GMT
Posted by: Michael Khanin
Microsoft Windows
How to Create File for a Desired File Size
Posted by: Michael Khanin
Time to time I get the need to have some temp files of varying sizes. In Linux environment it’s not a problem to do. And, in Windows environment it’s not a problem anymore :).
I’ve used a “dd for windows“. “dd for windows” could be downloded from official web site. I’ve created a very simple script, mkef.bat. Here is a syntax for using mkef.bat:
mkef.bat <filename> <size>
And now the content of mkef.bat:
@echo off
if {%1}=={} @Echo Please use the following syntax: mkef.bat filename size &goto :EOF
if {%2}=={} @Echo Please use the following syntax: mkef.bat filename size &goto :EOF
dd if=/dev/zero of=%1 bs=1024 count=%2



You must be logged-in to post a comment. Log-in/Register