Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2009
    Posts
    31

    Default Compares Scenario

    Hi there
    I want to check if the following is possible to do via BC
    I have a model server which has 2 drives G and H. In each of these drives there are 10 folders and within these 10 folders there are 10 more subfolders.
    In all the folders there are 10 files exactly. I want to use this model server and compare them with prod servers which are about 900 of them. The way i want to compare is not actual file content but to check if any extra files/folders exist on prod servers other than the ones mentioned above. i know this can be achieved via the GUI but since i have 900 servers to check, i wanted to write script to automate this task.
    please advice

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,684

    Default

    Yes, you can do this with Beyond Compare. BC defaults to comparing modified date and size of files, but you can clear all comparison criteria so BC just compares file name.

    Here's an example script:

    #clear comparison criteria
    criteria
    #load folders provided as command line arguments 1 and 2
    load %1 %2
    expand all
    folder-report layout:side-by-side options:display-orphans output-to:%3

    Save the above as a text file, then use a batch file to run the comparison for each server.

    Example batch:
    bcompare.exe @script.txt g:\ \\server1\g server1g.txt
    bcompare.exe @script.txt h:\ \\server1\h server1h.txt
    bcompare.exe @script.txt g:\ \\server2\g server2g.txt
    bcompare.exe @script.txt h:\ \\server2\h server2h.txt

    This will list differences for each server and drive to a text file.

    If you want to append the reports into a single file, you can use the following modified batch file:
    bcompare.exe @script.txt g:\ \\server1\g out.txt
    type out.txt > report.txt
    bcompare.exe @script.txt h:\ \\server1\h out.txt
    type out.txt >> report.txt
    bcompare.exe @script.txt g:\ \\server2\g out.txt
    type out.txt >> report.txt
    bcompare.exe @script.txt h:\ \\server2\h out.txt
    type out.txt >> report.txt

    The > overwrites an existing file with the contents of the out.txt file, the >> appends to the existing file.
    Chris K Scooter Software

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •