ja-cpanel-top

CuruIT - The System Administrator

An invaluable source of News, Tools, Scripts and Knowledge Base for Network Administrators Worldwide

How to Create File for a Desired File Size

E-mail

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 are here: Tools How to Create File for a Desired File Size