Ask a questionAsk a question
 

QuestionBatch file to delete or copy files

  • Thursday, July 16, 2009 10:18 AMjimmyfortune Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi all,

    I have a directory with jpeg files. Then I have a list of numbers, for instance:

    10023
    10024
    10027
    10028
    10031

    The jpeg's are also named like this: 10023.jpg, 10024.jpg, ...

    I want to write a batch file that

    • Option 1: deletes all jpeg files that are not in the list of numbers
    • Option 2: copies all jpeg files that are in the list to another directory
    I don't mind to use the list of numbers hard coded in the batch file.
    Problem is that I have no idea how to do this.

    Can someone write me something quick?

    Cheers.
    Jimmy