Delete folders and keep the content


  1. Posts : 2
    None>
       #1

    Delete folders and keep the content


    I have a boring task. I make an archive of several years of a daily newspaper, and every number of this newspaper i laying in its own folder on the CD I've got. So I open the folders one by one and draw the only pdf-file inside for collecting them. My wish is to delete all the maps at once and keep the contents. Is it possible? Or is there any other solution to get by this Cinderella-job?
      My Computer


  2. Posts : 543
    Windows 7 Ultimate x64
       #2

    Providing that they are all PDF files, I'd run a search for .pdf and then copy them all into a single folder. Then delete the folders and original files - if needed.

    This may not be the best solution. Its a little risky as well.

    You cant delete all the folders without deleting the content. You would have to move the files first.


    Dave
      My Computer


  3. Posts : 2
    None>
    Thread Starter
       #3

    This was a very good idea! :) There are only pdf files. I need no delete anything, only to search .pdf on the CD and then draw the collection over to an own folder. Thank you very much, Dave, you saved my time!
      My Computer


  4. Posts : 543
    Windows 7 Ultimate x64
       #4

    My pleasure :)

    Dave
      My Computer


  5. Posts : 1
    fu
       #5

    You could create a .cmd script, create a .txt file with the below contents and save, then rename file and change extension to .cmd and hit enter, agree with extension name change. I call mine "dissolve.cmd". If you are not showing extensions, then you need to unhide the extensions first.

    I put the script in my SendTo folder so I can right click any folder and dissolve the folder and the contents move to the present folder. Ex: C:\path\myfile.doc >> C:\myfile.doc.

    This is a little advanced and if there are subfolders it will dissolve them all so you could acidentally make a mess if you didn't know what you were doing.

    Set _Source=%*
    For %%I in (%_Source%) Do (
    For /F "usebackq tokens=*" %%J In (`DIR /B /AD ""%_Source%""`) Do
    Move /-Y "%%~I\%%J" "%%~dpI"
    Move /-Y "%%~I\*.*" "%%~dpI"
    RD "%%~I"
    )
    :ause
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 04:19.
Find Us