Jump to content

Empty file creation in a batch file.


Sfor

Recommended Posts

I'm trying to create an empty (0 length) file with a batch script.

The biggest problem is the fact DOS, Windows 98 and Windows 2000 do handle such situations differently.

Windows 2000 will copy a 0 length file with a copy command. On the other hand the Windows 98 or DOS will display "0 files copied" message in such a case.

Windows 98 is able to create an empty file with such a command:

if>empty.txt

Windows 2000 will just say the > character was unexpected here.

I'm trying to find a solution working in DOS, Windows 95, 98 and 2000.

Edited by Sfor
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...