Tech Support > Operating Systems > MS-DOS > How to create a file of exact size 253456789 bytes in the easiest way with MSDOS?
How to create a file of exact size 253456789 bytes in the easiest way with MSDOS?
Posted by Thomas Heinrich on September 25th, 2005


I could imagine that there is a way to create a big file with an MSDOS batch procedure which has exactly
a size of 253456789 bytes.

The content could by any garbage (content text or binary).

How do I do this?

Possibly under Win2000 / WinXP it is easier.

Thomas

Posted by William Allen on September 25th, 2005


Note that I find it offensive when Followups are set to exclude cross-posted
groups. All cross posted groups restored.

"Thomas Heinrich" wrote in message
Under Windows 95/98/ME it's quite trivial with DEBUG. Note
that 253456789 decimal = f1b 7195 hex.

Lines that don't begin with two spaces have wrapped accidentally
====Begin cut-and-paste (omit this line)
@ECHO OFF
ECHO.rcx>SCRIPT
ECHO.7195 >>SCRIPT
ECHO.rbx>>SCRIPT
ECHO.f1b>>SCRIPT
ECHO.nYOURFILE.BIN>>SCRIPT
ECHO.w>>SCRIPT
ECHO.q>>SCRIPT
debug<SCRIPT>NUL
DEL SCRIPT
DIR YOURFILE.BIN | find "YOURFILE"

====End cut-and-paste (omit this line)
For Win95/98/ME study/demo use. Cut-and-paste as plain-text Batch file.
Batch file troubleshooting: http://www.allenware.com/find?UsualSuspects

Screen capture shows operation:
============Screen capture Windows 95
C:\WORK>demo.bat
YOURFILE BIN 253,456,789 25/09/05 17:44 YOURFILE.BIN
C:\WORK>
============End screen capture
--
William Allen
Free interactive Batch Course http://www.allenware.com/icsw/icswidx.htm
Batch Reference with examples http://www.allenware.com/icsw/icswref.htm
From email address not checked. Contact us at http://www.allenware.com/




Similar Posts