Solved Create File of NUL Characters with MS-DOS Batch?

Dell / DIMENSION 2400
March 7, 2012 at 19:15:29
Specs: MS-DOS 7.10, Pentium 4 / 1GB
Is it possible to create a file of all NUL characters with an MS-DOS batch file? Or to put another way, if you looked at the file created by the batch in a hex editor you would see nothing but zeroes in the left pane.

I want to create a 512 byte file of all ASCII "0x00" characters using batch commands if that is possible. I know I could create it separately, but creating it on-the fly is better. Just wanting to know if it's possible, and some hint on how to go about it.

Thanks!


See More: Create File of NUL Characters with MS-DOS Batch?

Report •


#1
March 13, 2012 at 11:50:50
✔ Best Answer
DOS Batch? Not without using DEBUG.

How To Ask Questions The Smart Way


Report •

#2
March 15, 2012 at 02:10:49
Thanks for the link! Some questions remain.

So I have come up with the following code snippet:

> TEMP.SCR ECHO n Zeroes.BIN
>>TEMP.SCR ECHO l
>>TEMP.SCR ECHO f 100 L200 0
>>TEMP.SCR ECHO r BX
>>TEMP.SCR ECHO 0
>>TEMP.SCR ECHO r CX
>>TEMP.SCR ECHO 200
>>TEMP.SCR ECHO w
>>TEMP.SCR ECHO q

DEBUG < TEMP.SCR > NUL

I am still getting a "File not found" message. Is there any way to suppress this?

Do I need the lines?:

>>TEMP.SCR ECHO r BX
>>TEMP.SCR ECHO 0

Is there a more efficient way to feed the script to DEBUG?


Report •
Related Solutions


Ask Question