Dennis
Like this:
cd 2>Zero.txt
The answer to this can be found in Prof. Timo Salmi's "Batch file
information and FAQs" which was posted just yesterday.
type nul>zerobyte.txt
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
>How can I create a file with 0 byte length?
>
Open Notepad (or other text editor).
Don't enter anything then save it as an empty file
--
----------------
Stubbo of Oz
----------------
> How can I create a file with 0 byte length?
There are several ways - OS specific ways, but
type nul > file
seems to work in all of them.
--
T.E.D. (tda...@mst.edu)
echo. > TEST.TXT
...at the 'Command Prompt' (any dos version)
Then type :
edit.com /79 TEST.TXT
and delete the space and the two odd characters.
Save the file and exit EDIT.COM
Alternatively, use any other binary text editor do delete the CR+LF
end-of-line (return) characters to make the file 0 [zero] bytes.
==
Cheers, Tim Meddick, Peckham, London. :-)
"Dennis Halver" <ha...@persrec.com> wrote in message
news:4a526f74$0$32682$9b4e...@newsspool2.arcor-online.net...
cd.>Zero.txt
On Mon, 06 Jul 2009 21:41:09 +0000, Dennis Halver wrote:
> How can I create a file with 0 byte length?
>
> Dennis
One technique is to use REM > Zero.Bat, another is ECHO.> Zero.Bat.
You may find that some methods work with some command prompts (Dos) and
not with others.
Batcher
Among the many replies in this thread, this one stands out because neither
of the two suggested methods will generate a zero-byte file.
>How can I create a file with 0 byte length?
>
>Dennis
type NUL >mtfile.txt
Hm, my version is the shortest: cd.>file - only 4 characters
.>file.txt
Only 1 character. :)
>On Mon, 06 Jul 2009 21:41:09 +0000, Dennis Halver wrote:
>
>> How can I create a file with 0 byte length?
>
>There are several ways - OS specific ways, but
>
> type nul > file
>
>seems to work in all of them.
This does too - tested in XP and MSDOS V6.22 at least.
rem.>file
Only 1 character. :)
Only _2_ characters, and error in host :( Not a nice way :)
>On 8 ???, 08:18, foxidrive <got...@woohoo.invalid> wrote:
>> On Tue, 7 Jul 2009 06:30:32 -0700 (PDT), 01MDM <001.dmi...@gmail.com>
>> wrote:
>>
>> >On 7 ???, 17:12, charles <some...@somewhere.invalid> wrote:
>> >> On 06 Jul 2009 21:41:09 GMT, h...@persrec.com (Dennis Halver) wrote:
>>
>> >> >How can I create a file with 0 byte length?
>>
>> >> >Dennis
>>
>> >> type NUL >mtfile.txt
>>
>> >Hm, my version is the shortest: cd.>file - only 4 characters
>>
>> �.>file.txt
>>
>> Only 1 character. �:)
>
>
>Only _2_ characters,
No, only 1 character. The others have to be there. :)
>and error in host :( Not a nice way :)
That wasn't part of the discussion. *grins*
:)
I use
copy /y nul TRY.LOG > nul
in XP (sp3) CMD.EXE prompt; it AFAIR works at least in all earlier
systems; it also updates an existing TRY.LOG.
I use the sero-length file as an economical way of recording when
TRY,BAT was last run, surviving over re-boot; that is used in TRY.BAT so
that, in it, HUNT selects all *.htm files created or changed since
TRY.BAT was previously run.
A copy of TRY.BAT is in the Web directory below.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
OP, if you are out there and reading this message, please do us the
courtesy of allowing the multipost to do what it was intended to do,
or at the very least indicate in the original post that you've set
followups to a specific group.
--
Zaphod
No matter where you go, there you are!