How to create an empty file in a script?

M

Michael Moser

As a marker that some script has processed a directory I want to create
an empty file in that directory.
In unix I would use a "touch filename" command to do that.

On windows I tried
echo "" > filename
but that creates a file containing two ". How do I create a truly empty
(i.e. 0 Bytes long) file in a windows batch file?

Michael
 
A

Ayush

Michael Moser wrote ::
As a marker that some script has processed a directory I want to create
an empty file in that directory.
In unix I would use a "touch filename" command to do that.

On windows I tried
echo "" > filename
but that creates a file containing two ". How do I create a truly empty
(i.e. 0 Bytes long) file in a windows batch file?

Michael


Echo. > File


Good Luck, Ayush.
 
A

Ayush

Michael Moser wrote ::
As a marker that some script has processed a directory I want to create
an empty file in that directory.
In unix I would use a "touch filename" command to do that.
On windows I tried
echo "" > filename
but that creates a file containing two ".

How do I create a truly empty
(i.e. 0 Bytes long) file in a windows batch file?

Echo. > Filename will not create an empty file.. to create a true empty
file, use :
type nul > FileName


Good Luck, Ayush.
 
B

Black Baptist

Michael Moser rambled on in microsoft.public.windowsxp.customize:
As a marker that some script has processed a directory I want to create
an empty file in that directory.
In unix I would use a "touch filename" command to do that.

On windows I tried
echo "" > filename
but that creates a file containing two ". How do I create a truly empty
(i.e. 0 Bytes long) file in a windows batch file?

Michael

C:\>cd storage

C:\Storage>more>>empty.txt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top