Compare file versions and other important details on two different boxes

Quite often, we hear that two boxes are completely alike but for some reason a program that works on first just fails on another. Sometimes, you suspect certain patches which got applied on one box and not applied on the other box might have been the issue.

The question is... how do you find out which files are different in the two boxes? It is not rocket science, you can compare them after enabling the extended view in your Windows Explorer. BUT, what about using a script so that it is easier... may be when you have a large number of files to compare to!

The following script will give you details for all the files in a specific folder from a command line so that you don't have to check the versions of each file explicitly. Once you have the output, you can compare it with Windiff etc.

Create a file called FileInfo.vbs on your harddrive and copy the code given below...


'To download WinDiff visit
'If you are wondering where these constants from visit
Const FILE_NAME = 0
Const SIZE = 1
If wscript.Arguments.Count = 0 Then
 Wscript.echo "Try cscript FileInfo.vbs /?"
End If
If wscript.Arguments(0) = "/?" OR lcase(wscript.Arguments(0)) = "/h" OR lcase(wscript.Arguments(0)) = "/help" then
 Wscript.echo "You can list the File Information of all the files in a folder using this script"
 Wscript.echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
 Wscript.echo "Examples"
 Wscript.echo "~~~~~~~~"
 Wscript.echo "CScript FileInfo.vbs /? or /h or /help : Shows this help"
 Wscript.echo "CScript FileInfo.vbs C:\Temp\ : Shows Filename, Size, Date Modified & Created & Accessed and File Version"
End If
'Get some important Extended properties in a folder
IF wscript.Arguments.Count = 1 THEN
 If Not wscript.Arguments(0) = "" Then
  Set objShell = CreateObject ("Shell.Application")
  Set objFolder = objShell.Namespace(wscript.Arguments(0))
  If objFolder is Nothing Then 
   Wscript.echo "Folder doesn't exist! Try Again..."
  End If
  Wscript.Echo "File Name ~ Size ~ Date Modified ~ Date Created ~ Date Accessed ~ File Version"
  For Each strFileName in objFolder.Items
   strTemp = ""
   strTemp = objFolder.GetDetailsOf(strFileName, FILE_NAME) & " ~ " & _
        objFolder.GetDetailsOf(strFileName, SIZE) & " ~ " & _
        objFolder.GetDetailsOf(strFileName, DATE_MODIFIED) & " ~ " & _
        objFolder.GetDetailsOf(strFileName, DATE_CREATED) & " ~ " & _
        objFolder.GetDetailsOf(strFileName, DATE_ACCESSED) & " ~ "
   Set objFSO = CreateObject("Scripting.FileSystemObject")
   strTemp = strTemp + objFSO.GetFileVersion(wscript.Arguments(0) & strFileName)
   Set objFSO = Nothing
   WScript.Echo strTemp
 End If
End If

To use this script, you have to type in something like this...

cscript FileInfo.vbs C:\windows\system32\Setup\ > C:\List.txt ----- This will redirect the output to a file C:\List.txt.

Notice the trailing "\". This is a must (in case you want to get the files at the root level like... C:\)...


Comments (1)

  1. Tom says:

    I’ve used an app called Araxis Merge ( for many years for this purpose.  It is a great folder and file differencing and merging utility.  It has paid for itself many, many times over since I paid a couple hundred bucks for it around 5 years ago.  Since then, they’ve released tons of updates/improvements (all for free), and it is one of the few apps I have that is actually properly tested and supported on Vista.

Skip to main content