Reputation: 103
I have a file named testFile.js. js file contains some javascript code. I wanted to know how do I delete the file content alone from command Prompt (Windows).What is the command I should use?
Thanks :)
Upvotes: 1
Views: 1973
Reputation: 3270
Instead of my previous answer try this.
del testFile.js
COPY CON testFile.js
You will get just a blinking cursor. Press F6 and then enter. Your zero byte file will be created.
Upvotes: 1
Reputation: 3270
Try this at the command prompt assuming you're already in the directory containing the file.
echo.> testFile.js
Upvotes: 2