Tuesday, June 1, 2010

DOS: Create a 0KB file

Problem Statement:
I want to create a 0KB file using a DOS Command.

Here's how to do it:
Just Run->cmd and type in

goto >> "Filepath"

Since goto doesn't lead to any code execution its a command that is successful and since there is no return of the goto command, there is no data added to the file and hence the filesize is 0KB. Solves the purpose!

Just a try!
One could try "cls >> "Filepath" "; but this doesn't work as it adds a binary character in the file to be created.

No comments: