Network Administrator Knowledgebase

Apr 9 2008   7:42PM GMT

How to Create File for a Desired File Size

Michael Khanin Michael Khanin Profile: 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

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: