Script to delete files with certain extension


















The -WhatIf switch is unnecessary. I submitted an edit to this answer. It's a good idea to use -whatif to verify you will remove only the files you want to remove. And especially when offering up a deletion command to those of unknown technical expertise. Best to keep the training wheels on. Community Bot 1. This finally did it for me - tried all above and nada.

Pawan Kumar Pawan Kumar 1 1 1 bronze badge. Esperento57 Esperento57 4 4 bronze badges. Could you improve on this answer or explain how it might help in this situation? Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.

The Overflow Blog. Podcast Helping communities build their own LTE networks. Podcast Making Agile work for data science. Featured on Meta. Batch to delete file. Batch to delete all files. Prev Article. Next Article. Related Articles. The following article will provide you script to check disk ….

The following article will teach how to rename multiple files …. Learn more. Script for file deletion based on extension Ask Question. Asked 1 year, 6 months ago. Active 1 year, 6 months ago. Viewed times. Improve this question. Glorfindel 1 1 gold badge 9 9 silver badges 17 17 bronze badges. Marin Marin 1. Do you want to delete all files with certain extensions in the current directory or other directories? Please add more details how you want to specify the list of file extensions and how you want to run the script.

Should the script have command line arguments? What extensions? Will they always be the same or do you need to be able to choose them when you launch the script? Will the files always be in the same directory or will you need to recurse into subdirectories? Please edit your question and give us more details. Maybe an example of the file you want to delete and the files you want to keep. Also, please show us what you have done so far so we don't repeat your work.

Marin, sorry, I wasn't too clear. I edited the answer a bit.



0コメント

  • 1000 / 1000