Method to auto generate .md5 after any file finished download?

Page 2 of 2 FirstFirst 12

  1. Posts : 20
    Win 10 Pro x64 21H1
    Thread Starter
       #11

    Garlin the MD5v2 you just provided. I belive would be the answer but i dont see anything created even everytime i launch this script it writes something because it eats about 1MB from my D partition so it writes some files somewhere - should it output some results to some 1mb file?

    If it matters my downloads are varying from simple 1 mb to usually around 100 GB. But mostly those are like 100-300 mb many episodes of tv shows sometimes 100-200 episodes so my goal is to have verifier for any file that finished downloading outputted to filename.md5 because i had situations that i had multiple files with my tv shows stored on ext hdd on which i was testing some file manager programs and everything from my sorted folders there got mixed in one big mess in one folder. I want to be prepared if something similar happens then i would just have at least my soul at peace that every file is untouched.
      My Computer


  2. Posts : 777
    Windows 7
       #12

    You just redirect the output to file. This script doesn't "eat" any disk space, it only reads files and prints output. You're trying to solve two different problems, MD5 only confirms the downloaded file is intact based on someone else's reference MD5. It has nothing to do with organizing a content management system.

    MD5.bat > output.md5
      My Computer


  3. Posts : 1,203
    11 Home
       #13

    garlin said:
    If you're expecting to have a Windows command magically launch after any random file gets written (via download tool or browser save) -- it doesn't work this way. The only way to implement this is a kernel filter driver which behaves like an anti-virus tool and scans every new file. No one's gonna write that for you.
    Someone already has written it, just use the Execute command tab, lol

    Nodesoft Folder Monitor
      My Computers


  4. Posts : 20
    Win 10 Pro x64 21H1
    Thread Starter
       #14

    Ok i think i get it. But one more question. How to make this script you just showed to make results not all at once to output.md5 but one after one with name of this checked file?

    Like your script with your recent answer > output.md5 makes ex this:

    output.md5
    content of file:
    D:\DOWNLOADS\BROWSER\file1.mp4 B2718B337685A7DC68512B46181D7F88
    D:\DOWNLOADS\BROWSER\file2.mp4 7409E7E61C5A0B3B828557665D79DB91

    so this is one file only
    example i need:
    after running script - the files created:

    file1.mp4.md5
    (content of file: B2718B337685A7DC68512B46181D7F88 D:\DOWNLOADS\BROWSER\file1.mp4)

    file2.mp4.md5
    (content of file: 7409E7E61C5A0B3B828557665D79DB91 D:\DOWNLOADS\BROWSER\file2.mp4)

    Ty
      My Computer


  5. Posts : 777
    Windows 7
       #15

    hdmi said:
    Someone already has written it, just use the Execute command tab, lol

    Nodesoft Folder Monitor
    I found this excellent PS script, Monitoring Folders for File Changes, which allows you trap FileSystemWatcher events.

    In theory you can link Created events followed by Changed (to flag when your downloader or browser is done writing), and wait some arbitrary delay before calculating the MD5. Then it could append to a running log of new files, presumably filtered by file extension.

    Nodesoft probably can't do a single-threaded command instance to avoid possible race conditions from updating the same output file. Like when you're scanning a very large file, while a smaller file gets created. This is moot if every download gets its own .md5 file. But like the NTFS cluster size discussion, that seems especially wasteful.
      My Computer


  6. Posts : 1,203
    11 Home
       #16

    garlin said:
    I found this excellent PS script, Monitoring Folders for File Changes, which allows you trap FileSystemWatcher events.

    In theory you can link Created events followed by Changed (to flag when your downloader or browser is done writing), and wait some arbitrary delay before calculating the MD5. Then it could append to a running log of new files, presumably filtered by file extension.

    Nodesoft probably can't do a single-threaded command instance to avoid possible race conditions from updating the same output file. Like when you're scanning a very large file, while a smaller file gets created. This is moot if every download gets its own .md5 file. But like the NTFS cluster size discussion, that seems especially wasteful.
    The 3rd screenshot on the page I linked to shows you can specify timeouts, but you don't need to monitor all the write actions IMO. A file typically gets renamed and/or moved automatically when the download completes, or else the temporary chunks are deleted after the download manger has finished merging all the pieces together etc. so, by studying the behavior of programs you use for downloading you can usually get there.
      My Computers


  7. Posts : 2,191
    Windows 10 Pro 64-bit v22H2
       #17

    Did you try the PowerShell script that I posted earlier? Here is a version that outputs the result to a file.

    Output to file

    Syntax:
    Get-FileHash -Algorithm MD5 -Path (Get-ChildItem "\\path\to\files\*.*" -Recurse) | Out-File [-filePath] string

    Example:
    Get-FileHash -Algorithm MD5 -Path (Get-ChildItem "D:\temp\iso\*.*" -Recurse) | Out-File -filePath "D:\temp\myiso.md5"
      My Computers


  8. Posts : 20
    Win 10 Pro x64 21H1
    Thread Starter
       #18

    MisterEd said:
    Did you try the PowerShell script that I posted earlier? Here is a version that outputs the result to a file.

    Output to file

    Syntax:
    Get-FileHash -Algorithm MD5 -Path (Get-ChildItem "\\path\to\files\*.*" -Recurse) | Out-File [-filePath] string

    Example:
    Get-FileHash -Algorithm MD5 -Path (Get-ChildItem "D:\temp\iso\*.*" -Recurse) | Out-File -filePath "D:\temp\myiso.md5"
    Yes i tried that and tried to include it in this nice post garlin found (so it would be a soulution i think)

    yout post alone throws error: (with paths put right)
    Get-FileHash : A positional parameter cannot be found that accepts argument 'Out-File'


    Monitoring Folders for File Changes - powershell.one
    Still cannot get it working.
      My Computer


  9. Posts : 2,191
    Windows 10 Pro 64-bit v22H2
       #19

    Milky Window said:
    Yes i tried that and tried to include it in this nice post garlin found (so it would be a soulution i think)

    yout post alone throws error: (with paths put right)
    Get-FileHash : A positional parameter cannot be found that accepts argument 'Out-File'


    Monitoring Folders for File Changes - powershell.one
    Still cannot get it working.
    Are you sure the syntax was right? I just ran the example script on my Window 10 desktop. Here are the results:

    Method to auto generate .md5 after any file finished download?-2023-07-11-04_38_36-administrator_-windows-powershell.jpg
      My Computers


  10. Posts : 20
    Win 10 Pro x64 21H1
    Thread Starter
       #20

    MisterEd said:
    Are you sure the syntax was right? I just ran the example script on my Window 10 desktop. Here are the results:

    Method to auto generate .md5 after any file finished download?-2023-07-11-04_38_36-administrator_-windows-powershell.jpg
    Now it is working - was my typo somewhere.
      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 16:53.
Find Us




Windows 10 Forums