Link to home
Start Free TrialLog in
Avatar of Luis Diaz
Luis DiazFlag for Colombia

asked on

Windows batch: del & exclude file

Hello experts,
I have the following command
Del C:\folder \*.csv* C:\folder2\*log.* /q /s 

Open in new window

I would like to exclude of the delete operation a specific file with the following name mapping.csv
If you have questions, please contact me.
Thank you.
SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Luis Diaz

ASKER

Thank you.
Not possible to do it in a single command through cmd?
Thank you.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you. What is the option for remove-item with drill down?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much for those proposal.
@slightwv (䄆 Netminder): I tested your proposal but I modified:
C:\folder2\*log.*

Open in new window

by:
C:\folder2\*.log

Open in new window

Could you please modify your proposal so I can add your proposal as solution.
@Bill: your proposals works: Thank you again for your advice concerning sfk. I already installed and placed in C:\System32 to use it as cmd.
The tricky part is to select the most useful command and memorize them. :-)
Thank you again.
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

>>Could you please modify your proposal so I can add your proposal as solution.

Modify in what way?  You have the basic command.  You should just need to tweak it to meet your final requirements.  If you can tell me the requirements it is missing, I can try to post a copy/paste solution.
Modify your proposal as extension should be like this *.extension*.
But know it is fine I understood how to proceed.
Thank you again.