I am manipulating a whole bunch of files and placing them in a different directory. What I need to do now is find out which files are in the original directory that aren't in the output directory (the problem is being processed by a dozen computers). Is there any script I can run on Windows that will display this?

link|improve this question
feedback

migrated from stackoverflow.com Jan 29 '10 at 7:44

This question came from our site for professional and enthusiast programmers.

6 Answers

up vote 3 down vote accepted

Use WinDiff. It comes with Visual Studio and Platform SDK and can be downloaded separately. It's mainly to compare files, but it also allows you to recursively compare folders.

link|improve this answer
feedback

If you are looking for a manual process and have visual studio installed, then you can use windiff.exe to show the differences.

link|improve this answer
feedback

In PowerShell:

$d1 = get-childitem -path $dir1 -recurse 
$d2 = get-childitem -path $dir2 -recurse 
compare-object $d1 $d2 
link|improve this answer
I did this between a dir on my USB card and my local computer. 10 mins later, still waiting... – jcollum Jun 5 '11 at 17:38
feedback

I tend to use PathSync

link|improve this answer
feedback

you can try this vbscript, no need to download any stuff.

Set objFS = CreateObject("Scripting.FileSystemObject")
Set d = CreateObject("Scripting.Dictionary")
Set objArgs = WScript.Arguments
strFolderA= objArgs(0)
strFolderB = objArgs(1)
Set objFolder = objFS.GetFolder(strFolderA)
Set objFolder1 = objFS.GetFolder(strFolderB)
For Each strFile In objFolder.Files
    strFileName = strFile.Name
    strFilePath = strFile.Path
    'collect all files and their full paths.
    d.Add strFileName, strFilePath
Next

For Each strFile In objFolder1.Files
    strFileName = strFile.Name
    strFilePath = strFile.Path
    If Not d.Exists(strFileName) Then
        WScript.Echo "Not found in : " & strFolderA & "->" & strFilePath
    End If 
Next

output

C:\test>dir /B c:\tmp
file
test.bat

C:\test>dir /B c:\tmp1
test.bat

C:\test>cscript //nologo test.vbs c:\tmp1 c:\tmp
Not found in : c:\tmp1->C:\tmp\file
link|improve this answer
feedback

FreeCommander does this quickly. Pick folder on right, pick folder on left, compare. It's a handy utility.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.