xxxxxxxxxx
type NUL > EmptyFile.txt
# also
echo. 2>EmptyFile.txt
copy nul file.txt > nul # also in qid's answer below
REM. > empty.file
fsutil file createnew file.cmd 0 # to create a file on a mapped drive
echo. > filename.txt
xxxxxxxxxx
echo. > filename.txt
This command will overwrite the contents of the file with a blank line, effectively clearing its contents.
Note that if the file does not exist, this command will create a new, empty file with the specified name.