Solved How to create a empty/dummy/blank file under MS-DOS?

Microsoft Ms-dos 6.2 upgrade (for dummie...
August 5, 2012 at 04:15:03
Specs: MS-DOS, 286
Hi!

as title... how can I create a empty/dummy/blank file under MS-DOS?

is there a tool included in MS-DOS to do that? such as FSUTIL.EXE under Windows NT/2000/XP?

if not, someone know a tool to do that? I need a 16bit MS-DOS tool capable of make a empy file (contins 0x00) with a configurable size! such as "fsutil create file <filename> <size>" under Windows XP.

thank you!


See More: How to create a empty/dummy/blank file under MS-DOS?

Report •

✔ Best Answer
August 9, 2012 at 05:11:03
Thanks R2,

Right, as usual.
Messy but usable:

===============================================
@echo off > myscript

if %1'==' echo what size? [in HEX]

>> myscript echo n blank.bin
>> myscript echo rbx
>> myscript echo 0
>> myscript echo rcx
>> myscript echo %1
>> myscript echo f 0 ffff 0
>> myscript echo w 0
>> myscript echo q

debug < myscript
type blank.bin >> BIG

:eof


====================================
Life is too important to be taken seriously.

M2



#1
August 5, 2012 at 05:04:33
Just curious, but have you tried "EDIT"? Try "EDIT xxxxxxxx.yyy" and just save it blank after it comes up...

"Channeling the spirit of jboy..."


Report •

#2
August 5, 2012 at 05:22:17
sorry, missing a point... I need this tool because I have to use it in with my batch files. no manual operations!

Report •

#3
August 5, 2012 at 06:07:48
List of MS-DOS Commands:

http://en.wikipedia.org/wiki/List_o...

ARM Devices the future. Windows have accepted the fact!


Report •

Related Solutions

#4
August 5, 2012 at 07:25:21
maybe

@echo off > filename.ext
or
type nul > filename.ext


====================================
Life is too important to be taken seriously.

M2


Report •

#5
August 5, 2012 at 08:40:36
I have to setup the file size ! using type/echo/set can be userfull only to create a ZERO-size file! instead I have to create a bigger filesize containing all 0x00.

in other words I need an msdos tool such as 'fsutil create file <FILENAME> <FILESIZE>" present in Windows XP:

thank you!


Report •

#6
August 5, 2012 at 09:46:52
Well if you've really shunned 15 years of OS PC development to embrace an obsolete OS that can't interface with modern hardware, you should be able to use DEBUG.COM to write a blank file of an arbitrary size.

Also, what are you doing with such ancient hardware?

How To Ask Questions The Smart Way


Report •

#7
August 5, 2012 at 11:10:44
It would take about a dozen lines of C to write such a utility. Now's a good time to learn a little programming.

You could even do it with a simple batch file - just use a loop that writes a null character to a file the required number of times.

Running an old computer is like running an old car; you have to be prepared to get your hands dirty.


Report •

#8
August 5, 2012 at 12:16:49
If you have vbscripting engine, this might do what you want:
wscript.stdout.write string(wscript.arguments(0),chr(0))

save the above "one-liner" as, for example, zero.vbs.
to use it: cscript /nologo zero.vbs 50000>zeros
writes 50,000 bytes out to file zeros.
or you can put it into a batch wrapper:
@cscript /nologo zero.vbs %1>%2

antique batch can't do it, and there's no "simple" utility that I know of.


Report •

#9
August 5, 2012 at 13:18:44
VBScript in MS-DOS? I doubt it.

Report •

#10
August 5, 2012 at 14:10:24
Yeah, you're correct. I was thinking it went back farther than that, but no. looks like gwbasic or qbasic then, gwbasic version, (gwbasic zero<L for non-interactive):
batch (zeros.bat):
@echo %1>L
gwbasic zero<L
:end

zero.bas content (text):
5 INPUT L!
10 OPEN "R",#1,"ZER",1
20 FIELD #1,1 AS A$
30 A$=CHR$(0)
40 FOR I=1 TO L! : PUT #1 : NEXT I
50 CLOSE #1
60 SYSTEM
69 REM end of basic snippet


Report •

#11
August 5, 2012 at 16:14:04
@Razor2.3
I've a MAME-CAB, some PLAYABLE roms-set (game) contains one or more ROM not dumped at the moment. Teorically you can NOT run games with missing roms (since MAME will not found all the required ROM-files), however creating dummy files for the missing undumped ROM-files will do the job as a temporany solution!

Now the bad story, my MAME-CAD (as many people do) run MAME and other emulators under MS-DOS =) The PC mounted in the CAB is very old and obsolete but it's 100% compatible with DOS6, and most important, with ArcadeVGA (with it you can connect a 15khz arcade monitor or a TV).

In the meantime I will play with DEBUG.COM ...


Report •

#12
August 5, 2012 at 16:26:14
@Razor2.3
I played a bit with debug.com, but I can't understand how to create blank files.. can you help me with a syntax example?
thank you!

Report •

#13
August 5, 2012 at 17:50:00
It's not exactly intuitive. Enter this, and it should create a blank 32KB file. I say 'should' because I only have WinXP's debug.com to test this on:

n blank.bin
rbx
0
rcx
8000
f 100 8100 0
w 100
q

How To Ask Questions The Smart Way


Report •

#14
August 6, 2012 at 00:36:37
yeah, but how I can use it in a batch file (.bat) ? :/

Report •

#15
August 6, 2012 at 06:20:45
You would put it into a text file, then use input redirection to feed it into debug.
debug < some.txt

How To Ask Questions The Smart Way


Report •

#16
August 6, 2012 at 12:27:42
mmm, but in this way the file-size is hard-coded in some.txt :/
it sounds not so good :(
I can't preview what filesize I will need in the future...and how many some.txt should I do?

Report •

#17
August 7, 2012 at 03:51:17
Yep, welcome to the world of DOS batch files.

How To Ask Questions The Smart Way


Report •

#18
August 9, 2012 at 03:50:59
This may work in DOS. If it flops change this:
>> myscript echo n blank.bin
to this:
echo n blank.bin >> myscript
and so on


@echo off > myscript

if %1'==' echo what size? [in HEX] && goto :eof

>> myscript echo n blank.bin
>> myscript echo rbx
>> myscript echo 0
>> myscript echo rcx
>> myscript echo %1
>> myscript echo f 0 ffff 0
>> myscript echo w 0
>> myscript echo q

debug < myscript
type blank.bin >> BIG

:eof


====================================
Life is too important to be taken seriously.

M2


Report •

#19
August 9, 2012 at 03:54:16
if %1'==' echo what size? [in HEX] && goto :eof
I know this line will fail. '&&' isn't used in MS-DOS.

How To Ask Questions The Smart Way


Report •

#20
August 9, 2012 at 05:11:03
✔ Best Answer
Thanks R2,

Right, as usual.
Messy but usable:

===============================================
@echo off > myscript

if %1'==' echo what size? [in HEX]

>> myscript echo n blank.bin
>> myscript echo rbx
>> myscript echo 0
>> myscript echo rcx
>> myscript echo %1
>> myscript echo f 0 ffff 0
>> myscript echo w 0
>> myscript echo q

debug < myscript
type blank.bin >> BIG

:eof


====================================
Life is too important to be taken seriously.

M2


Report •

Ask Question