How to get a list of folders that exist in source but not in destiny


  1. Posts : 456
    Windows 10
       #1

    How to get a list of folders that exist in source but not in destiny


    Hi,

    I would like to know how to get a list of folders that exist in a source folder structure but don't exist in the destiny folder structure.

    For example: source E:\My Files \ destiny: F:\My Files\

    I want to know all Folders that exist in E: but don't exist in F:

    I have been using this but I was wondering if there is something better or simpler without using Find...

    robocopy "E:\My Files" "F:\My Files" /e /nfl /l |find /i "new dir"
      My Computer


  2. Posts : 42,983
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2



    Folder compare shows all files and subfolders found from compared folders as list. Folder compare allows synchronising folders by copying and deleting files and subfolders.
    You could try Winmerge (free).

    And I'm sure someone will propose a script for you.

    More options:
    12 Best Free Folder Compare Software For Windows
      My Computers


  3. Posts : 456
    Windows 10
    Thread Starter
       #3

    @dalchina: Thanks, but since it is a simple task. I prefer to use Windows embedded tools...
      My Computer


  4. Posts : 42,983
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #4

    Then you can do some research on Powershell or command prompt options.

    It always helps to specify what sort of solutions you are not prepared to accept so people don't spend time giving inappropriate answers.
      My Computers


  5. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #5

    Hello @ricardobohner,

    ricardobohner said:
    @dalchina: Thanks, but since it is a simple task. I prefer to use Windows embedded tools...
    You might want to look at something like this then . . .

    How to Use FC (File Compare) from the Windows Command Prompt

    I hope this helps.
      My Computer


  6. Posts : 989
    Microsoft Windows 10 Home
       #6

    If the folders don't have sub-folders (or we only care about the first level), this PowerShell will do the trick:

    Code:
    $Source      = 'E:\My Files'
    $Destination = 'F:\My Files'
    
    $DestFolders = Get-ChildItem $Destination -Directory -Name
    Get-ChildItem $Source -Directory -Name | Where { $_ -notIn $DestFolders }
      My Computer


 

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

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




Windows 10 Forums