i have a folder with 2K+ files in it, i need to delete around 200, i have a txt file with all the file names i need removed ordered in a list, how do i remove the specific files from the folder using the list? (OS is windows 7)
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
Simple way is copy the txt file to a file called mydel.bat in the directory of the files to delete. Using an editor like MSWORD edit this file. Do a global replace on Newline normally ^p in MSWORD. Replace it with "space/Y^pdelspace". This will change
TO
Edit the fist line to add the del space and delete the last line. Run the batch command. |
|||||||||
|
|
Type this on the command line, substituting your file for
|
|||||||||||||
|
|
Using PowerShell:
|
|||
|
|
|
I imagine it can be done with powershell. Knowing Perl, I tend to use it for this sort of thing
|
|||
|
|