Announcement

Collapse
No announcement yet.

Win XP: Is there a command line to delete only certain filetypes?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Win XP: Is there a command line to delete only certain filetypes?

    I have approx. 12,000 music files on my harddrive, and half of them are mp3's and half of them are wav's. I want to delete all of the wav's and none of the mp3's. All of my music is arranged in Music\Artist\Album\Songfiles format. Is there a command line to delete ONLY the wav's without having to go into each individual folder?

    For example, if I wanted to go in and unhide all my folder.jpg files in my music directory, I can browse to the root folder in DOS, and type the following:

    'attrib -s -h -r *.jpg /s'

    and it will go in through all of my folders and unhide everything with a ,jpg extension.

    Does a simple line like this for deleting only certain filetypes exist?

    Thanks
    My Grandma & Her Friends on Their Spring Vacation

  • #2
    You know, I suppose one workaround is to do a search for .wav files in my music folder, and delete all the results. If worse comes to worst I'll do that. Still curious if there's a command line though.
    My Grandma & Her Friends on Their Spring Vacation

    Comment


    • #3
      I'm sure someone can come up with a better way to do this, but the way I would go about it, is with nested "for" statements

      e.g.:
      Code:
      for /d %i in (*) do for /d %j in (*) do dir "%i\%j\*.wav"
      This would be run from within the Music directory. %i would be Artist directory %j would be album directory. Replace the "dir" with "del" and I think this should work for you.
      Dr. Ron Paul for President 2008

      Hope for America - http://www.ronpaul2008.com

      Who is Ron Paul? - Why do we need Ron Paul?

      __________________
      CarPC Newbs Start Here: All your questions answered, as if by E.S.P.

      Comment


      • #4
        From the root folder (\MUSIC in your case, Nola):
        DEL /S *.WAV

        Simple as that.
        FYI - From a command line, you an type DEL /? to get all the command line options.
        Have you looked in the FAQ yet?
        How about the Wiki?



        Under normal circumstances, a signature would go here.

        Comment


        • #5
          Thanks DP, I knew there had to be an easy one.
          My Grandma & Her Friends on Their Spring Vacation

          Comment


          • #6
            I was about to say use a wild card.

            Comment


            • #7
              I have a similar request but more pain staking. I recently lost my collection in the car due to some weather. The last time I backed it up was in May, and it is a mess. Windows media pretty much corrupted it with several un needed jpegs. There is about 3 Jpegs (album art) per Album and my original one named FOLDER. Can I delete all Jpegs with the exception of the one named "Folder"?

              Comment


              • #8
                Originally posted by Dougw133 View Post
                I have a similar request but more pain staking. I recently lost my collection in the car due to some weather. The last time I backed it up was in May, and it is a mess. Windows media pretty much corrupted it with several un needed jpegs. There is about 3 Jpegs (album art) per Album and my original one named FOLDER. Can I delete all Jpegs with the exception of the one named "Folder"?
                follow the instructions above but use DEL /S *.JPG

                Comment


                • #10
                  How about this,

                  del /s X.jpg
                  del /s Y.jpg

                  Replace X and Y with the file name you want to remove...
                  New Age Garmin - Skin for RR
                  New Age Slider - RR SKin In Progress
                  "It's called CODE because I don't want you to know"

                  Comment


                  • #11
                    I can see this working if you do it in three steps.

                    1 - Use a compression utility like WinZip to make an archive of all the JPGs you want to retain. Since they all have the same folder name, you'll need to retain the folder structure, as well.
                    If you track down a copy of PKZIP (the old DOS-bases ZIP utility), you can do this from a command line. WinZip has a command-line tool, as well that works wonders.

                    2 - Delete ALL the JPG files using DEL /S *.JPG

                    3 - Unzip the archive you made to restore all the files named FOLDER.JPG.

                    Tah-dah!


                    If you go the PKZIP or WinZip CLI route, you can make a batch file that will perform this operation automagically.
                    Have you looked in the FAQ yet?
                    How about the Wiki?



                    Under normal circumstances, a signature would go here.

                    Comment

                    Working...
                    X