How to delete files from a folder using a list of file names in windows?



As an IT administrator, it can be daunting to manage a large number of files, especially in a Windows environment. This article will cover a method of how to delete files from a folder using a list of file names. This can be a time-saving tool for those who need to quickly clean out large folders.

The first step is to create the list of file names. This can be done in a spreadsheet, text editor, or any other program that allows for text entry. The list should contain the names of the files that you would like to delete, one per line. It is important to make sure that the file names are typed exactly as they appear in the folder, including any extensions such as .txt or .jpg.

Next, open the Command Prompt. To do this, open the Start Menu, type “cmd” in the search box, and press Enter. This will open the Command Prompt window.

Once the Command Prompt is open, type “for /f %i in (list.txt) do del %i”, where “list.txt” is the name of the file containing the list of file names. This will start the process of deleting the files.

The process may take a few minutes, depending on the number of files in the folder and the speed of the computer. When it is done, a confirmation message will be displayed, stating that the files were successfully deleted.

It is important to note that this method only works for files in the same folder. If the files are located in multiple folders, the process will need to be repeated for each folder. Additionally, files in sub-folders will not be deleted.

This method is a great tool for administrators who need to quickly delete a large number of files from a single folder. By creating a list of files to delete and using the Command Prompt, the process can be completed in a fraction of the time that it would take to manually delete each file.

Inquire Now

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Find your next full or part-time role here

ScaleDesk can either help you find your next full time gig or a part time side gig where you can create extra income!

Onboard with us once
Skip HR screening and go to the final interview with with only your resume and a video interview you never have to redo
Get paid electronically every month for the hours you work
We will be your reference even if you work for us once

IT Teams: Use ScaleDesk to augment your team

Schedule Demo