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

  1. ricardobohner's Avatar
    Posts : 359
    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. dalchina's Avatar
    Posts : 31,768
    Win 10 Pro (1903)
       #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. ricardobohner's Avatar
    Posts : 359
    Windows 10
    Thread Starter
       #3

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

  4. dalchina's Avatar
    Posts : 31,768
    Win 10 Pro (1903)
       #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. Paul Black's Avatar
    Posts : 13,302
    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. KeithM's Avatar
    Posts : 830
    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 07:47.
Find Us




Windows 10 Forums