#5 Multiple Creation & Verfication of MD5 Files in Dirs

open
nobody
None
5
2010-11-20
2010-11-20
Phil
No

I have a feature request, the ability to create & verify multiple results files per directory that contains files, detecting relative or absolute paths, don't create results file if there is one present.

-DIR1
-DIR2
-FILE1
-FILE2
-DIR2.MD5
-DIR3
-FILE1
-FILE2
-DIR3.MD5

As for verification, to select a folder to scan for multiple results files and verify all.

Select DIR1

-DIR1
-DIR2
-FILE1
-FILE2
-DIR2.MD5
-DIR3
-DIR4
-DIR5
-FILE1
-FILE2
-DIR5.MD5

Verify DIR2.MD5 and DIR5.MD5

Hope it makes sense,
Cheers

Discussion

  • Phil
    Phil
    2010-11-20

    • summary: Multiple Creation & Verficcation of MD5 Files in Dirs --> Multiple Creation & Verfication of MD5 Files in Dirs
     
  • Tom Bramer
    Tom Bramer
    2010-11-20

    Have you tried fvc-batch? I think it does what you're looking for (though at the command line). It is a WSH script that comes with FV++. If you've used the installer, the FV++ directory is included in your PATH variable.

    Example on using it:

    c:\dirs> fvc-batch /n:CHECKSUMS.MD5 /f:MD5SUM /a:MD5 *.*

    This command will create a file called CHECKSUMS.MD5 within c:\dirs and within each subdirectory. Each CHECKSUMS.MD5 will contain the MD5 hashes of all of the files within that directory. Unless the /fo option is used, already existing CHECKSUMS.MD5 files will not be recreated.

    To verify the files, you can use fvc.

    c:\dirs> fvc -x -r CHECKSUMS.MD5

    If you've installed WinFVC and the FV++ shell extension, you can do this from explorer via the context menu for the directory in question (choose FileVerifier++ > Verify Hash Files).

    There currently is not a GUI way of doing this.

     
  • Phil
    Phil
    2010-11-26

    Thank you, that's it.
    I'm having some troubles to set the directory scan paths. - I'm using the portable installation. After several tries calling via batch file/run command
    "C:/Dirs/fvc-batch.cmd" /n:CHECKSUMS.MD5 /f:MD5SUM /a:MD5 *.* "C:\Test\1"
    and same with fvc.exe...
    I modified the batch file in FV++ directory to

    @echo off

    if NOT "%OS%" == "Windows_NT" goto error_exit

    set FVC_BATCH_PATH=%~dp0
    cscript //Nologo "%FVC_BATCH_PATH%\fvc-batch.js" /n:CHECKSUMS.MD5 /f:MD5SUM /a:MD5 *.*
    goto exit

    :error_exit
    echo This script requires Windows NT.

    :exit

    Though it uses the current FV++ directory for the scan. Tried replacing "%~dp02 by "C:\Test\1"
    or modifying the line cscript //Nologo "%FVC_BATCH_PATH%\fvc-batch.js" /n:CHECKSUMS.MD5 /f:MD5SUM /a:MD5 *.* "C:\Test\1"
    I've the impression I'm missing something very simple...
    Also is it possible to set the .md5 filenames to the directory name, like Directory.md5

    Thank you again.

     
  • Tom Bramer
    Tom Bramer
    2010-11-28

    Currently, fvc-batch only works with the current directory and its subdirectories. So in order to get fvc-batch to work for your directory setup, you need to do this:

    C:\> cd c:\test\1
    C:\test\1> c:\dirs\fvc-batch.cmd /n:CHECKSUMS.MD5 /f:MD5SUM /a:MD5 *.*

    fvc-batch currently only supports constant filenames.

     
  • Phil
    Phil
    2010-12-06

    Thanks for the update.
    Tried this:
    @echo off

    if NOT "%OS%" == "Windows_NT" goto error_exit

    set FVC_BATCH_PATH=%~dp0
    cscript //Nologo "%FVC_BATCH_PATH%\fvc-batch.js" /n:%d.%e /f:MD5SUM /a:MD5 *.*

    goto exit

    :error_exit
    echo This script requires Windows NT.

    :exit

    It doesn't work though - It creates an "e" without extension file only in the current directory. If I use /n:%d.md5 it creates a file named "md5sum" without ext. and only in the current dir. About the directory I ended moving the test files/folders inside the current FileVerifier++ directory, but FV++ doesn't create verification files for any of the subdirs - only for the current dir i.e. it should create for
    FV++ Dir
    -modules
    -Test
    -1
    -Files
    -2
    -Files
    modules, directory "1" and "2"
    I wish I had more understanding of wsh scripts/cmd because I'm having some hard times with them. If you can tell me step by step what to do it would be very appreciated and that way I make sure I'm not making mistakes.
    Thank you.

     
  • Tom Bramer
    Tom Bramer
    2010-12-07

    The instructions I gave do not apply to running fvc-batch.js from within a script. You need to double up on your %s inside a batch file, as in, /n:%%d.%%e . Also, the fvc-batch.cmd was not intended to be directly modified. You should create another batch file that calls this batch file with the necessary arguments...

    @echo off
    c:\path\to\fv++\fvc-batch /n:%%d.%%e /f:MD5SUM /a:MD5 *.*

     
  • Phil
    Phil
    2010-12-12

    Alright it's much clear now.. thank you.
    OK, from another batch file I run:
    @echo off
    cd /D "C:\Test\1"
    "C:\Dirs\FV++\fvc-batch" /n:%%d.%%e /f:MD5SUM /a:MD5 *.*
    and It displays:
    Processing: .
    Processing: C:\Test\1\2
    Processing: C:\Test\1\2\3
    without creating any md5 file (The Dirs that contain files are "Test\1","Test\1\2" and "Test\1\2\3")
    If I place the batch file in the same directory as fvc-batch (without the cd line) and with the Test Directories inside, it creates the md5 only for the current FV++ directory.
    Thanks.

     
  • Phil
    Phil
    2010-12-20

    Same results with the test version.

     
  • Tom Bramer
    Tom Bramer
    2010-12-22

    You need to add /e:c:\dirs\fv++\fvc to the fvc-batch command line if your fv++ directory is not in your PATH variable.

     
  • Phil
    Phil
    2010-12-22

    I'm not sure if you meant this:
    @echo off

    cd "C:\Dirs\Test\1"

    "C:\Dirs\FV++\fvc-batch" /e:C:\Dirs\FV++\fvc /n:%%d.%%e /f:MD5SUM /a:MD5 *.*
    (not working though...)
    tried as well
    .. /e:C:\Dirs\FV++\fvc-batch ... ; using "" /e:"..."

    or to edit the fvc-batch.cmd file instead, and whether the PATH variable is the current directory of the executed new* batch file (which is in FV++ main directory) or a value that's added with the setup installation (I'm using the portable install.)

     
  • Tom Bramer
    Tom Bramer
    2010-12-22

    If fvc.exe is within c:\dirs\fv++, then /e:c:\dirs\fv++\fvc would be correct. The parameter for /e should be the full path to the fvc executable on your system.

    As an alternative, the PATH variable can be modified to contain the directory in which fvc.exe resides. You can either permanently modify the PATH variable to include this (System control panel applet), or you could do it through your batch file before running fvc-batch.cmd.

    @echo off

    set PATH=%PATH%;c:\dirs\fv++
    "c:\dirs\fv++\fvc-batch" ...

    Provided that c:\dirs\fv++ contains fvc.exe.

    The FV++ installer automatically modifies the PATH environment variable for you.

     
  • Phil
    Phil
    2010-12-28

    Alright, seems then that I'm setting the PATH variable properly but then what's wrong with the batch?
    I get the same results as before, though the batch now is:
    @echo off

    set PATH=%PATH%;"C:\Dirs\File Verifier ++ 0.6.2.5822 Portable"

    "C:\Dirs\File Verifier ++ 0.6.2.5822 Portable\fvc-batch" "/e:c:\Dirs\File Verifier ++ 0.6.2.5822 Portable\fvc" /n:%%d.%%e /f:MD5SUM /a:MD5 *.*

    here is a screenshot of the batch. http://img524.imageshack.us/img524/4083/screenshotoly.png
    No md5 files are created.

     
  • Tom Bramer
    Tom Bramer
    2010-12-29

    If you set PATH correctly, you do not need to additionally specify the full path with /e. Perhaps doing this would be useful:

    1.) Open a command prompt.
    2.) Run "fvc" at the command prompt (no full path). Verify that fvc cannot be found.
    3.) At the command prompt, use set to set your PATH variable. Do it the same way that the batch file does it.
    4.) Run "fvc" again. Verify that fvc is actually run this time. If it's not, then your PATH variable is not set correctly.
    5.) If successful with step 4, then run your batch file (with the /e option removed).

     
  • Tom Bramer
    Tom Bramer
    2010-12-29

    It appears that the current version doesn't like spaces in path names for FVC for the /e option. Setting the PATH variable as discussed and omitting the /e option should work.

     
  • Phil
    Phil
    2011-01-05

    Great, setting the PATH variable in the batch line without the /e parameter works great!
    As per the verification batch script
    @echo off

    set PATH=%PATH%;"C:\Dirs\File Verifier ++ 0.6.2.5822 Portable"

    "C:\Dirs\File Verifier ++ 0.6.2.5822 Portable\fvc" -x -r *.MD5 -v
    how should I specify the creation of a log file? Tried with -d and -o specifying the file path but they don't work.

     
  • Tom Bramer
    Tom Bramer
    2011-01-05

    If you want to redirect messages to a file, you will need to use the shell's redirection. For example:

    "C:\Dirs\File Verifier ++ 0.6.2.5822 Portable\fv *.MD5 -v > logfile.txt 2>&1

     
  • Tom Bramer
    Tom Bramer
    2011-01-05

    I meant this:

    "C:\Dirs\File Verifier ++ 0.6.2.5822 Portable\fvc" -x -r *.MD5 -v 2>&1

     
  • Phil
    Phil
    2011-01-07

    It works fine with a minor number of files, but for a large number the log gets stuck in the line 2153. I checked twice...

     
  • Phil
    Phil
    2011-01-15

    I tried using HiddenStart application to create the log
    "hstart.exe" ""M:\FV++\fv-Verify.bat" > log.txt"
    though I got the same results.
    I ran the script without the @echo line, and the console output stopped in the same point as the log, so it's not exactly a problem of the log file.
    I realize this is a shell limitation. Is there any chance to work around it?
    Either way, thank you for everything! =-)