Computing.Net > Forums > Programming > echo back # of files DEL in .BAT

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

echo back # of files DEL in .BAT

Reply to Message Icon

Name: Code One
Date: January 3, 2004 at 01:54:23 Pacific
OS: me
CPU/Ram: Pent III - 256MB
Comment:

hello,

was wondering what commands I would use to echo back to the user how many files were deleted from a specified folder which had been deleted using a Batch file app.

For instance:

i have a batch file setup to auto delete a batch of files in a folder and I would like the prompt to display AFTER deletion has taken place, the number of files that were deleted.

Also, if someone could show me a command, (if different) that would show the user how many files were found in the folder, BEFORE deletion takes place, because I have it setup to find if the file types within the folder exist or not.

thanks and good day,

code one



Sponsored Link
Ads by Google

Response Number 1
Name: jlyon
Date: January 3, 2004 at 12:44:21 Pacific
Reply:

Hmm,
The only thing I could find on this is to do a directory listing before using the delete command to show the # of files specified present. For example if you wanted to delete all files ending in .tmp you could do like so:

dir *.tmp //this will tell you the nuumber of files...it also displays all the files (not sure if this is inconvenient or what your looking for).

then

del *.tmp

As for showing the number after...not sure.
Good luck, I'll be watching this post, as I'm curious to see...


0

Response Number 2
Name: Code One
Date: January 3, 2004 at 17:32:00 Pacific
Reply:

I know what you mean, it is not documented anywhere, and your suggestions are all i could think of too.

There has to be a way, I mean how does DOS know? There has to be a way to tap into the ways it uses to keep track.

hey if I find out man, I'll make sure to post it here, hope you do the same. ;)

code one


0

Response Number 3
Name: jlyon
Date: January 4, 2004 at 11:13:03 Pacific
Reply:

Hey,
There is a way to do this using assembly. You would have to create a small assembly program ,passing to it the directory path, then search for the files and return the output, although it is rather lengthy and involved...


0

Response Number 4
Name: Code One
Date: January 4, 2004 at 15:55:38 Pacific
Reply:

haha, probably not worth it huh? Thats cool, maybe if i get bored ill try it out, thanks for the tip.

regards

co


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


VB6 / Winsock / IPF?? FTP batch file



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: echo back # of files DEL in .BAT

Count number of files in zip archive www.computing.net/answers/programming/count-number-of-files-in-zip-archive/20254.html

creating a file using a .bat file www.computing.net/answers/programming/creating-a-file-using-a-bat-file/11035.html

count no of files in a directory www.computing.net/answers/programming/count-no-of-files-in-a-directory/18316.html