Clear All writing in the TEXT files

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
r2du-soft
Posts: 68
Joined: 09 Sep 2011 12:13

Clear All writing in the TEXT files

#1 Post by r2du-soft » 22 Aug 2012 16:13

Hi
How Can Clear All writing in the TEXT files?
We assume i have A folder AND Is Inside Folder Be 50 Number text file.
i want Without having open the text files,empty text files?!
im how empty 50 text file with batch file?
tanks

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Clear All writing in the TEXT files

#2 Post by foxidrive » 22 Aug 2012 19:16

This should reduce all the text files to zero byte files.


Code: Select all

@echo off
pushd "c:\folder\"
for %%a in (*.txt) do type nul>"%%a"
popd

r2du-soft
Posts: 68
Joined: 09 Sep 2011 12:13

Re: Clear All writing in the TEXT files

#3 Post by r2du-soft » 23 Aug 2012 08:08

Thanks to all the friends and Dear foxidrive
My problem with the foxidrive code Resolved:


Code: Select all

@echo off
for %%a in (*.txt) do type nul>"%%a"


Thanks to all friends

Post Reply