Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

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...

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

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...

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

![]() |
VB6 / Winsock / IPF??
|
FTP batch file
|

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