How to create an empty file in a script?

  • Thread starter Thread starter Michael Moser
  • Start date Start date
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
 
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.
 
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.
 
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
 
Back
Top