locked
Batch file to delete or copy files RRS feed

  • Question

  • 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
    Thursday, July 16, 2009 10:18 AM

All replies

  • well i wouldnt know how to do ll of that, but i do know that the commands del(deletes files) ren(renames files) copy(copies files) move(moves files) i find the website http://ss64.com/nt/ helpful
    Saturday, March 12, 2011 5:34 PM