Windows 10: Delete everything but picture files from a directory structure?

Discus and support Delete everything but picture files from a directory structure? in Windows 10 Support to solve the problem; Got an odd request, anyway to delete everything but picture files from a directory structure ? 64233 Discussion in 'Windows 10 Support' started by ZippyDSMlee, Sep 18, 2016.

  1. Delete everything but picture files from a directory structure?


    Got an odd request, anyway to delete everything but picture files from a directory structure ?

    :)
     
    ZippyDSMlee, Sep 18, 2016
    #1

  2. What can I do with File Explorer Search Results?

    No, remember, I said EVERYTHING (data/files/etc.) is stored on external drive and therefore it is E:/2016 System so it is a directory. From there the major sub-directories are:

    GRs File

    Spirit Hill

    My Downloads

    My Pictures

    That is it. OF course within each sub-directory, there many more sub-directories and same on down and down and down.
     
    TemporaryUser0101, Sep 18, 2016
    #2
  3. specify skydrive folder photos upload to?

    Same question here. My Nokia Lumia 920 insists on uploading any pictures I take to Skydrive\Pictures 1\Camera Roll. I assume the "Pictures 1" is because I already have a Pictures directory under my Skydrive cloud location and it's not smart enough to use
    it. I even tried moving the Camera Roll location from that "Pictures 1" location to the Pictures directory, but no luck.

    Normally, I'd just write this off as a standard irritation. But, from the troubles my wife's having accessing that shared Pictures location, it looks like the existence of the "Pictures 1" directory keeps her from opening "Pictures." Until I delete "Pictures
    1" all she gets when she tries to open Pictures is a note saying:

    "This item might have been deleted, expired, or you might not have permission to access it. Contact the owner of this item for more information."

    The directory also shows zero files/subdirectories under it. As soon as "Pictures 1" is gone, she can access Pictures (though it still shows zero files/subdirectories under it).
     
    oreveredrist, Sep 18, 2016
    #3
  4. cereberus Win User

    Delete everything but picture files from a directory structure?

    Select all picture files in explorer, right click and select properties. Mark them as hidden, delete remaining files, and then unhide the files and remove hidden attribute.

    You may have to do this by directory.
     
    cereberus, Sep 18, 2016
    #4
  5. Mmmmmm command line should be able to select a wild cards, tho I am unsure if you can string them together. Not sure if you can exempt this and delete that and keep folders but delete empty folders LOL
     
    ZippyDSMlee, Sep 18, 2016
    #5
  6. dalchina New Member
    Hi, if this is only required once, and there aren't too many subfolders, a relatively simple way might be to use an image viewer. That automatically picks out all image files of types it supports.

    View the folder in the image viewer, mark all as hidden. (Borrowing @Cerberus idea)
    Delete the remainder in file explorer, unhide the images.

    Repeat for all other folders.

    I'm not sure if you're looking for a script to do this repeatedly.
    If so, you could possibly do that with a viewer you can use from the command line e.g.
    PictView - image viewers and converters
    - but I can't see what the command line options are for that!
     
    dalchina, Sep 18, 2016
    #6
  7. Code: Loop, x:\RootFolder\*.*, 0,1 ; x = drive letter - 1 = search subfolders { if (A_LoopFileDir = A_WinDir) continue if A_LoopFileExt not in bmp,gif,jpg,png ; add other image extensions as needed FileDelete, %A_LoopFileLongPath% }[/quote]
    You can download AutoHotkey free programming tools from AutoHotkey


    It may be a good idea to build in a sanity check to make sure the root folder does not contain the Windows folder or any folder with other files that should not be deleted. The code I pasted is just a quickie starting point. On the AHK site you can download tools including an IDE that can wrap the script and interpreter into an exe so that the program will run on machines that do not have AHK installed.


    Enjoy *Smile

    Edit: I added an If statement to skip to the next loop if the current folder is the Windows folder as example how it is done. The forums for autohotkey are populated with regular posters who enjoy helping people with their scripts. So just visit the "ask for help" forum there for enahancements.
     
    MilesAhead, Sep 18, 2016
    #7
  8. Delete everything but picture files from a directory structure?

    You can download AutoHotkey free programming tools from AutoHotkey


    It may be a good idea to build in a sanity check to make sure the root folder does not contain the Windows folder or any folder with other files that should not be deleted. The code I pasted is just a quickie starting point. On the AHK site you can download tools including an IDE that can wrap the script and interpreter into an exe so that the program will run on machines that do not have AHK installed.


    Enjoy *Smile

    Edit: I added an If statement to skip to the next loop if the current folder is the Windows folder as example how it is done. The forums for autohotkey are populated with regular posters who enjoy helping people with their scripts. So just visit the "ask for help" forum there for enahancements.[/quote] I'll give it a go, its mainly all just a recovery of a WinXP hard drive, they want the pictures on CD's(5 or 6 in all I think) of all things, so I need to pair it down some. I think one I get down to pictures I will remove the 0-10KB ones then check and make sure the rest are half viewable. Not having a bit of luck with picture repair programs or hex editing the headers. Blah oh well some are there and working at least.

    Recovery of the hard drive on a USB hard drive(secondary documents and stuff they can get to if they want), plus pictures on CD plus all pictures on a DVD(dvds are nice I like dvds LOL).
     
    ZippyDSMlee, Sep 18, 2016
    #8
  9. Ah, in that case I feel much better. No worries about hosing a running system. AHK syntax can be weird on some of the older built in functions. But it can be great for doing file stuff simply. I wrote a utility to delete every index.dat file on the system drive in 7 lines of code. You could do the same thing with a command line batch but the AHK runs much smoother.
     
    MilesAhead, Apr 4, 2018
    #9
Thema:

Delete everything but picture files from a directory structure?

Loading...
  1. Delete everything but picture files from a directory structure? - Similar Threads - Delete everything picture

  2. Problems with directory structure in Windows 11

    in Windows 10 Gaming
    Problems with directory structure in Windows 11: I'm having great difficulty managing the new Directory Structure in Windows 11. Windows keeps creating a second "OneDrive" Desktop!! My personal desktop is NOT onedrive....I'm only one person and want all my desktop stuff going to my personal desktop....Not Onedrive...
  3. Problems with directory structure in Windows 11

    in Windows 10 Software and Apps
    Problems with directory structure in Windows 11: I'm having great difficulty managing the new Directory Structure in Windows 11. Windows keeps creating a second "OneDrive" Desktop!! My personal desktop is NOT onedrive....I'm only one person and want all my desktop stuff going to my personal desktop....Not Onedrive...
  4. Windows 11 File Explorer Directory Structure - WHERE ARE THINGS

    in Windows 10 Gaming
    Windows 11 File Explorer Directory Structure - WHERE ARE THINGS: SORRY, but I don't care what you say, the directory, folder structure displayed in File Explorer IS A MESS, pretty much unfathomable to navigate.1 There are a least about a half dozen Documents folders found under folders named: Desktop, Home, a Folder with my name, This PC,...
  5. Windows 11 File Explorer Directory Structure - WHERE ARE THINGS

    in Windows 10 Software and Apps
    Windows 11 File Explorer Directory Structure - WHERE ARE THINGS: SORRY, but I don't care what you say, the directory, folder structure displayed in File Explorer IS A MESS, pretty much unfathomable to navigate.1 There are a least about a half dozen Documents folders found under folders named: Desktop, Home, a Folder with my name, This PC,...
  6. Cannot delete a pdf file from Downloads directory

    in Windows 10 Software and Apps
    Cannot delete a pdf file from Downloads directory: I want to delete a .pdf file from the downloads directory. When I try to delete it, I get the error - "Action cannot be completed because the file is open in Intelr OptaneTM Memory service."How to delete this file please ?...
  7. Cannot delete a pdf file from Downloads directory

    in Windows 10 Gaming
    Cannot delete a pdf file from Downloads directory: I want to delete a .pdf file from the downloads directory. When I try to delete it, I get the error - "Action cannot be completed because the file is open in Intelr OptaneTM Memory service."How to delete this file please ?...
  8. I'm trying to display the structure of your file system directory

    in Windows 10 Network and Sharing
    I'm trying to display the structure of your file system directory: Here the script but showing errorimport osroot = os.path.join'..', 'panda'for directory, subdir_list, file_list in os.walkroot: print'Directory:', directory for name in subdir_list: print'Subdirectory:', name for name in file_list: print'File:', name printAnyone help what was...
  9. I'm trying to display the structure of your file system directory

    in Windows 10 Gaming
    I'm trying to display the structure of your file system directory: Here the script but showing errorimport osroot = os.path.join'..', 'panda'for directory, subdir_list, file_list in os.walkroot: print'Directory:', directory for name in subdir_list: print'Subdirectory:', name for name in file_list: print'File:', name printAnyone help what was...
  10. I'm trying to display the structure of your file system directory

    in Windows 10 Software and Apps
    I'm trying to display the structure of your file system directory: Here the script but showing errorimport osroot = os.path.join'..', 'panda'for directory, subdir_list, file_list in os.walkroot: print'Directory:', directory for name in subdir_list: print'Subdirectory:', name for name in file_list: print'File:', name printAnyone help what was...

Users found this page by searching for:

  1. [window title]i:\pte.exe[content]i:\pte.exethe file or directory is corrupted and unreadable.[ok]