{"id":94,"date":"2009-04-10T15:04:00","date_gmt":"2009-04-10T15:04:00","guid":{"rendered":"http:\/\/www.roysac.com\/blog\/wp-admin\/2009\/04\/de-dupe-files-script-tool-for-windows-32bit\/"},"modified":"2014-03-26T05:03:25","modified_gmt":"2014-03-26T13:03:25","slug":"de-dupe-files-script-tool-for-windows-32bit","status":"publish","type":"post","link":"http:\/\/www.roysac.com\/blog\/2009\/04\/de-dupe-files-script-tool-for-windows-32bit\/","title":{"rendered":"De-Dupe Files Script Tool for Windows 32bit"},"content":{"rendered":"<p>You can skip the background story about the why, when and how I decided to write this little<strong> File De-Duping script<\/strong>, if you are not interested in it and jump right the section about how the script works, what it does, where to download it, how to install and de-install it and the source code of it as well. <strong>The tool is Freeware<\/strong>, but any donation (<a href=\"http:\/\/www.roysac.com\/roy_ansidetail.asp?f=ROY-SKY.ANS&#038;src=b&#038;pg=2\" target=\"_blank\">money<\/a> or <a href=\"http:\/\/www.cumbrowski.com\/contact\" target=\"_blank\">goods<\/a>) and\/or simply a ???<strong><em>Thank You<\/em><\/strong>??? (e.g. via the comments section at the end of this post) are appreciated nevertheless. <\/p>\n<p>Important Node: I updated the script and this post, because of some bugs that I found and issues with the 3rd party tool ???touch.exe???. I had to remove it and come up with another solution for the problem that it solved. I also added some nice stuff, so it was more than just bug fixing :).<\/p>\n<h3>The Background Story<\/h3>\n<p>Who did not have the problem yet to have hundreds of any type of files, text files, documents, spread sheets, images, videos and others in one directory with the a high chance that you have duplicates, identical files that only have a different file name. I often have to deal with duplicate images that I downloaded from the internet. <\/p>\n<p>I cannot always remember, if I downloaded a particular image already or not and go by the slogan, archive \/ save \/ back up first, sort later, because there will be nothing to sort, if you don???t save a copy and go back to the place where you found them at a later time, to learn that the stuff isn???t there anymore for any reason. Maybe even the whole web site is gone <a href=\"http:\/\/en.wikipedia.org\/wiki\/Dodo\" target=\"_blank\">the way of the Dodo<\/a>. <\/p>\n<p>The original file names are often useless, either to generic, like <strong>image1.jpg, logo.gif<\/strong> or simply <strong>1.jpg, 2.jpg<\/strong> etc. or they are long and cryptic without any meaning, like: <strong>3104458219_cc0dfd3980_o_d.jpg<\/strong> or something like that. So you end up giving the files your own name and thus make it highly likely that you download the same file at a different time again and give it a different file name than you did the first time around. Voila, duplicate.<\/p>\n<p>I looked at a number of tools and options and found some that were decent, but all of them had always something (or didn???t have something) to make things that should be semi automatic to a manual time consuming ordeal. What I wanted is something that finds duplicates, does not delete them straight out or have me right then go over each dupe found to make a decision about it right away. I also wanted to be able to verify that the dupes found are really identical so it must be easy to know quickly which file is a duplicate of another file. <\/p>\n<p>Non of the solutions that I tried delivered on all those aspects so de-duping of files was painstaking and time consuming, if I did it or I simply would not do it at all and carry a bunch of dupe garbage around .<\/p>\n<p>The idea for this simple script of mine came when I did <a href=\"http:\/\/www.roysac.com\/blog\/2008\/12\/interesting-sac-art-packs-statistics-figures-and-downloads\/\" target=\"_blank\">the sorting<\/a> and <a href=\"http:\/\/www.roysac.com\/blog\/2008\/12\/interesting-sac-art-packs-statistics-figures-and-downloads-part-ii\/\" target=\"_blank\">inventory of<\/a> the <a href=\"http:\/\/www.roysac.com\/sac.html\" target=\"_blank\">SAC art pack releases<\/a> back in December last year and <a href=\"http:\/\/www.roysac.com\/blog\/2009\/01\/first-ascii-art-piece-of-mine-in-ages\/\" target=\"_blank\">January this year<\/a>. I uploaded files, like <strong><em><a href=\"http:\/\/en.wikipedia.org\/wiki\/MOD_(file_format)\" target=\"_blank\">MODs<\/a><\/em><\/strong> that I converted to <strong><em><a href=\"http:\/\/en.wikipedia.org\/wiki\/MP3\" target=\"_blank\">Mpeg-1 Audio Layer 3<\/a>, short MP3,<\/em><\/strong> and other files to my file sharing account at Mediafire.com. I learned that <strong><em>Mediafire.com<\/em><\/strong> has a de-duper function build into their system that prevents user from uploading the same file twice to their account. You can upload it a second time, but you will get the message that the file already exists and that your new upload was being deleted. I got that message and first thought that it was an error on <strong><em>Mediafire???s<\/em><\/strong> part. <\/p>\n<p>What dupes? There were no dupes, I thought. Yeah, there were some <strong><em><a href=\"http:\/\/en.wikipedia.org\/wiki\/MOS_Technology_SID\" target=\"_blank\">SID Adlib music<\/a><\/em><\/strong> files that had the same size and all, but there where like a dozen of them, all with a different name and even different prefix, indicating that the files were created by different musicians. Also the dates were different. Being close to send an email to <strong><em>Mediafire<\/em><\/strong> customer support, I decided to listen to the songs that could be potential duplicates to the file that was rejected (Mediafire didn???t tell me the file name or shared URL of the original file). And there it was, the same tune with a different file name and different file dates by the same artist. <\/p>\n<p>I was curious about how <strong><em>Mediafire<\/em><\/strong> noticed that the files are identical and did some research. They are using the <strong><em>MD5 Check Sum<\/em><\/strong> value of a file. Chances are astronomical that two files that are not byte by byte identical will have the same <strong><em>MD5<\/em><\/strong> check sum value. That???s a smart, fast and easy way to find dupes and the idea of writing a de-dupe script that does exactly what I want it to do was born.<\/p>\n<p>This is enough of a background story I believe. Let???s get busy with the Script itself.<\/p>\n<h3>How the Script Works<\/h3>\n<p>The script detects duplicate files within a directory. Duplicate files are files that have the same MD5 Check Sum value.?? Two <strong>DIFFERENT<\/strong>\/NON IDENTICAL files having the same <strong>MD5 Check Sum<\/strong> is not impossible, but highly unlikely. This allows the script to detect duplicate files regardless of their file name or other characteristics, such as &#8220;date created&#8221; or &#8220;date modified&#8221;.<\/p>\n<p>The tool scans all files within a directory. It does <strong>not include<\/strong> files in <strong>sub directories<\/strong> of the processed folder. <\/p>\n<p>If a duplicate file is found, it will be renamed by by appending the original file name as prefix with an _ as separator, which is also used to replace the &#8220;.&#8221; that indicates the file extension of the original file name (other &#8220;.&#8221; in the file name itself remain). At the end of the file name is the string [DEDUPED] added.<\/p>\n<p><a href=\"http:\/\/www.roysac.com\/blog\/uploaded_images\/Roy-DeDupeScript10b.zip\" target=\"_blank\"><img decoding=\"async\" src=\"http:\/\/www.roysac.com\/blogimages\/dedupe-illustration.jpg\"\/><\/a> <\/p>\n<h3>Example<\/h3>\n<p>For Example <strong><em>aFile1.EXT<\/em><\/strong> and <strong><em>bFile2.EXT<\/em><\/strong> are identical. After the script was executed, one of the two files will remain as it is and the other one is being renamed. Which file will be considered the &#8220;<em>original<\/em>&#8221; is determined by which file was found first. The script sorts the files by name first, before it de-dupes them.<\/p>\n<p>In this example <strong><em>bFile1.EXT<\/em><\/strong> would be considered the original and<strong><em> bFile2.EXT<\/em><\/strong> will be renamed to <strong><em>aFile1_EXT_bFile2[DEDUPED].EXT<\/em><\/strong>. This makes dupes appear right after the original, if you sort the directory by file name. To be able to filter the dupes to copy\/move them away or to delete them, use the copy, move or del command in MS DOS. For example &#8220;<strong><em>DEL *[DEDUPED].*<\/em><\/strong>&#8221; would delete all duplicate files found and renamed by the script.<\/p>\n<h3>More New Stuff<\/h3>\n<p>The script creates two files by default in the processed directory:<\/p>\n<ul>\n<li>&#8220;<strong><em>!DeDupe-FileList.txt<\/em><\/strong>&#8221; &#8211; a list of all files in the directory and their MD5 Check Sum Values (tab separated) <\/li>\n<li>&#8220;<strong><em>!DeDupeLog.txt<\/em><\/strong>&#8221; &#8211; a processing log file where you can find the list of dupes that were detected, their old &#038; new file name and the corresponding original file <\/li>\n<\/ul>\n<p>If you do not want any of the files to be created, change the options for &#8220;WriteFileList&#8221; and &#8220;WriteDeDupeLog&#8221; to &#8220;<strong><em>0<\/em><\/strong>&#8221; in the beginning of the code of &#8220;DedupeFilesInFolder.vbs&#8221;. Alternatively use the command line options:     <br \/>???<strong><em>\/log:[0\/1]<\/em><\/strong>??? and ???<strong><em>\/list:[0\/1]<\/em><\/strong>??? to turn the creation of the list and\/or log on\/off. <\/p>\n<p>You can also suppress all dialogs via the command line option ???<strong><em>\/quite:[0\/1]<\/em><\/strong>???.     <br \/>???<strong><em>\/quite:1<\/em><\/strong>??? would disable the progress dialog, results message and all error messages. <\/p>\n<p>Note, the script returns error levels for batch processing regardless of the &#8220;<strong><em>quiet<\/em><\/strong>&#8221; settings.     <br \/>The Error Level codes are: <\/p>\n<p>0 = Script Ran Successful    <br \/>1 = Script Ran, but there were no files to process     <br \/>2 = The script was aborted (only relevant if progress dialog is on)     <br \/>4 = Script Error (md5sum.exe not or processing path not found) <\/p>\n<p>Also new, a nice progress dialog using MS Internet Explorer and an extended results message box. Here are some screen shots of the new and updated windows. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"DeDupeScript-Progres\" height=\"228\" alt=\"DeDupeScript-Progres\" src=\"http:\/\/www.roysac.com\/blogimages\/DeDupeScriptProgres.png\" width=\"395\" border=\"0\"\/>?? <img loading=\"lazy\" decoding=\"async\" title=\"DeDupeScript-Results\" height=\"262\" alt=\"DeDupeScript-Results\" src=\"http:\/\/www.roysac.com\/blogimages\/DeDupeScriptResults.png\" width=\"289\" border=\"0\"\/><\/p>\n<h3>Installation\/De-Installation &#8211; Download<\/h3>\n<p>Download this small 36 KB ZIP file with the name<strong> <\/strong><a href=\"http:\/\/www.roysac.com\/blog\/uploaded_images\/Roy-DeDupeScript11b.zip\" target=\"_blank\">Roy-DeDupeScript11b.zip<\/a><strong><\/strong> and extract the archive to a folder on your local hard drive. The ZIP archive contains the following EIGHT files: <\/p>\n<li>DedupeFilesInFolder.vbs <\/li>\n<li>DeDupeInstall.bat <\/li>\n<li>DedupeInstall.reg <\/li>\n<li>DeDupeUnInstall.bat <\/li>\n<li>DedupeUnInstall.reg <\/li>\n<li>file_id.diz <\/li>\n<li>md5sum.exe <\/li>\n<li>Readme.txt\n<p>File_ID.diz and Readme.txt are simply text files, md5sum.exe is a 3rd party command line utility that was developed by somebody else and is being needed for my script. The two .BAT files and two .REG are only needed for the installation and de-installation of the tool. The .VBS file is the main tool script written in Visual Basic Script (VBScript). <\/p>\n<p>Use the provided Batch Scripts &#8220;<strong><em>DeDupeInstall.bat<\/em><\/strong>&#8221; and &#8220;<strong><em>DeDupeUnInstall.bat<\/em><\/strong>&#8221; to install or un-install the De-Dupe Shell Extension. <\/p>\n<h4>Installation<\/h4>\n<p>Double click on the Batch Script File &#8220;<strong><em>DeDupeInstall.bat<\/em><\/strong>&#8221;       <br \/>Thats it. <\/p>\n<p><strong>Notes:<\/strong>       <br \/>The install batch file copies <strong><em>md5sum.exe <\/em><\/strong>and <strong><em>DedupeFilesInFolder.vbs<\/em><\/strong> into your <strong><em>System32<\/em><\/strong> directory under your windows installation directory?? and Imports the registry file &#8220;<strong><em>DedupeInstall.r<\/em><\/strong>eg&#8221; into your systems registry database. It creates entries under the Registry Key: <\/p>\n<p><strong><em>HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Directory\\shell\\<\/em><\/strong> <\/p>\n<p>Non of the files in the installation directory will be needed anymore to run the script itself. You will need them only to uninstall the tool or to re-install it again, if necessary. <\/p>\n<h4>De-installation<\/h4>\n<p>Double click on the Batch Script File &#8220;<strong><em>DeDupeUnInstall.bat<\/em><\/strong>&#8221;       <br \/>The Un-Install batch file deletes the three files from your <strong><em>System32<\/em><\/strong> directory and utilizes the registry file <em><strong>DedupeUnInstall.reg<\/strong><\/em> to remove the entries for the script from your systems registry database. If you want to continue to use <strong><em>md5sum.exe<\/em><\/strong> and only want to disable the shell extension, either simply double click on the file <strong><em>DedupeUnInstall.reg<\/em><\/strong> without executing the uninstall batch file (the script <strong><em>DedupeFilesInFolder.vbs<\/em><\/strong> will remain in your <strong><em>System32<\/em><\/strong> folder though) or you can copy the tool back into your system folder manually after you ran the uninstall batch file. <\/p>\n<h3>About the Software<\/h3>\n<p>The De-Dupe Windows Explorer Shell Extension Script Tool is written in VBScript and is executed by the system tool WScript.exe. The De-Dupe script (DedupeFilesInFolder.vbs) uses a small support tool that it requires to work properly. <\/p>\n<p><strong>&#8220;<\/strong><a href=\"http:\/\/roysacold.blogspot.com\/etree.org\/md5com.html\" target=\"_blank\"><strong>md5sum.exe<\/strong><\/a><strong>&#8220;<\/strong> is a small command line tool that return the MD5 Check Sum value for a file.       <br \/>It can also validate MD5 check sums, which is a feature that is not used by the De-Dupe script.       <br \/>You can find out more information about it at <a href=\"http:\/\/etree.org\/md5com.html\">http:\/\/etree.org\/md5com.html<\/a>       <br \/>Md5Sum was written by <strong><em>bruce@gridpoint.com<\/em><\/strong> <\/p>\n<h3>Legal Stuff\/Copyright and Disclaimer<\/h3>\n<p>The 3rd party tool that come with the De-Dupe script is freeware and can be used and copied by anybody without the need of a license or to pay a fee. Since I did not write that tool, I cannot take any responsibility for any issues that they might cause by it, via my script or without out.<\/p>\n<p>This De-Dupe script is also freeware and can be used, copied and modified for free, <\/p>\n<h4>Important Disclaimer! <\/h4>\n<p>The author, of this software accepts no responsibility for damages resulting from the use of this product and      <br \/>makes no warranty or representation, either express or implied, including but not limited to, any implied warranty of merchantability or fitness for a particular purpose. <\/p>\n<p>This software is provided &#8220;AS IS&#8221;, and you, its user, assume all risks when using it. <\/p>\n<p>Depending if I have the time and the urge to extend on the script, new features might get added to this tool in the future. I could envision additional configuration options and alternative options for what to do with duplicate files that were found by the script. Since you are free to do modifications to the script yourself and improve on it, I would appreciate, if you would let me know and send me the enhanced version of yours, if you decide to take matters into your own hands. \ud83d\ude42<\/p>\n<h3>Change Log<\/h3>\n<p>V1.1<\/p>\n<\/li>\n<li>MD5Sum Determination Issue Resolved for file names with spaces in it <\/li>\n<li>Sorting by File Name Issue Resolved, now the &#8220;original&#8221; is really the first one sorted by name <\/li>\n<li>Progress dialog implemented to show status <\/li>\n<li>Quiet option implemented to suppress all dialogs <\/li>\n<li>Return of Error Levels implemented for batch scripts that call the script <\/li>\n<li>Rename logic changed, [DEDUPED] added to the renamed file in addition to existing logic <\/li>\n<li>touch.exe tool removed. It did not work reliable, period <\/li>\n<li>File List output with file names and their MD5 checksums implemented <\/li>\n<li>Log File output implemented <\/li>\n<li>command line parameters introduced to suppress file list and log file creation as well as to enable\/disable &#8220;quiet&#8221; mode <\/li>\n<li>general code clean up<br \/>\n<h3>Source Code<\/h3>\n<p>Here is the Source Code of the script. After that is also the code of the install and uninstall batch files and registry key values and settings.<\/p>\n<p>Again, you can download the whole code and the 3rd part command line tool md5sum.exe in a single ZIP archive called <strong><\/strong><a href=\"http:\/\/www.roysac.com\/blog\/uploaded_images\/Roy-DeDupeScript11b.zip\" target=\"_blank\">Roy-DeDupeScript11b<\/a><strong><\/strong>. You may need a ZIP extracting utility, although Windows XP and later should be able to open the file without the need to install additional software. However, if this does not work for any reasons, either download the commercial program <a href=\"http:\/\/www.winzip.com\/\" target=\"_blank\">WinZip<\/a> at this web site or download and install the open source Zip and other archiver???s processing tool called <a href=\"http:\/\/peazip.sourceforge.net\/\" target=\"_blank\">PeaZip<\/a>. <\/p>\n<h4>DedupeFilesInFolder.vbs Source Code<\/h4>\n<div>\n<div>\n<pre><span>   1:<\/span> <span>=======================================================================<\/span><\/pre>\n<pre><span>   2:<\/span> Parameters you might want to change<\/pre>\n<pre><span>   3:<\/span> <span>=======================================================================<\/span><\/pre>\n<pre><span>   4:<\/span> Specifies the action to take <span>if<\/span> dupes are found, used by DupeHandling<\/pre>\n<pre><span>   5:<\/span> <span>Values other than 1 are not supported\/implemented yet<\/span><\/pre>\n<pre><span>   6:<\/span> Dim DupeAction: DupeAction = 1<\/pre>\n<pre><span>   7:<\/span>?? <\/pre>\n<pre><span>   8:<\/span> If you want to suppress the progress dialog, the results message popup <\/pre>\n<pre><span>   9:<\/span> <span>and Error Messages set bQuiet = true<\/span><\/pre>\n<pre><span>  10:<\/span> Note, the script returns error levels <span>for<\/span> batch processing regardless<\/pre>\n<pre><span>  11:<\/span> <span>of the bQuiet settings. The ErrorLevel codes are:<\/span><\/pre>\n<pre><span>  12:<\/span> 0 = Script Ran Successful<\/pre>\n<pre><span>  13:<\/span> <span>1 = Script Ran, but there were no files to process<\/span><\/pre>\n<pre><span>  14:<\/span> 2 = The script was aborted (only relevant <span>if<\/span> progress dialog <span>is<\/span> on)<\/pre>\n<pre><span>  15:<\/span> <span>4 = Script Error (md5sum.exe not or processing path not found) <\/span><\/pre>\n<pre><span>  16:<\/span> Dim bQuiet: bQuiet = false<\/pre>\n<pre><span>  17:<\/span>?? <\/pre>\n<pre><span>  18:<\/span> LOGFILES<\/pre>\n<pre><span>  19:<\/span> <span>Set to 1 to generate file list with name and md5 sum, set to 0 to disable<\/span><\/pre>\n<pre><span>  20:<\/span> Dim WriteFileList: WriteFileList = 1<\/pre>\n<pre><span>  21:<\/span> File name <span>for<\/span> the file list. File <span>is<\/span> saved <span>in<\/span> processing path folder<\/pre>\n<pre><span>  22:<\/span> Dim FileListFName: FileListFName = <span>\"!DeDupe-FileList.txt\"<\/span><\/pre>\n<pre><span>  23:<\/span>?? <\/pre>\n<pre><span>  24:<\/span> <span>Write a log file with all dupes that were processed<\/span><\/pre>\n<pre><span>  25:<\/span> Dim WriteDeDupeLog: WriteDeDupeLog = 1<\/pre>\n<pre><span>  26:<\/span> File name <span>for<\/span> the file list. File <span>is<\/span> saved <span>in<\/span> processing path folder <\/pre>\n<pre><span>  27:<\/span> Dim DeDupeLogFName: DeDupeLogFName = <span>\"!DeDupeLog.txt\"<\/span><\/pre>\n<pre><span>  28:<\/span>?? <\/pre>\n<pre><span>  29:<\/span> <span>=======================================================================<\/span><\/pre>\n<pre><span>  30:<\/span> Don<span>t touch the stuff below this line, unless you know what <\/span><\/pre>\n<pre><span>  31:<\/span> you are doing.<\/pre>\n<pre><span>  32:<\/span> <span>=======================================================================<\/span><\/pre>\n<pre><span>  33:<\/span> Dim oFso: set oFso = Wscript.createobject(\"scripting.fileSystemObject\")<\/pre>\n<pre><span>  34:<\/span> Dim oFolder, oFiles, oFile, oLogFile<\/pre>\n<pre><span>  35:<\/span> Dim iCounter: iCounter = 0 File Counter<\/pre>\n<pre><span>  36:<\/span> Dim sFolderPath <span>Work Folder Path (Current folder)<\/span><\/pre>\n<pre><span>  37:<\/span> Dim arguments: Set arguments = Wscript.arguments<\/pre>\n<pre><span>  38:<\/span> Dim md5sumPath,sErr, sMsg, sMD5CS<\/pre>\n<pre><span>  39:<\/span> Dim MyArray() Array with MD5 Checksum and File Names<\/pre>\n<pre><span>  40:<\/span> Dim iDupCnt: iDupCnt = 0  <span>Counter for Dupes<\/span><\/pre>\n<pre><span>  41:<\/span> Dim iDupErr: iDupErr = 0  Error Count <span>for<\/span> Dupe Action<\/pre>\n<pre><span>  42:<\/span> Dim iMD5SumErr: iMD5SumErr = 0 <span>Error Count for MD5 Check Sum Calc<\/span><\/pre>\n<pre><span>  43:<\/span> Dim iFilesCnt: iFilesCnt = 0 Number of files proc <\/pre>\n<pre><span>  44:<\/span> Dim iFilesProc:iFilesProc = 0 <span>Number of files processed (iFilesCnt - iMD5SumErr)<\/span><\/pre>\n<pre><span>  45:<\/span> Dim iDupProc Dupe Processed Count (iDupCnt - iDupErr) <\/pre>\n<pre><span>  46:<\/span>?? <\/pre>\n<pre><span>  47:<\/span> <span>global const and vars for Statusbar<\/span><\/pre>\n<pre><span>  48:<\/span> Const conBarSpeed = 80<\/pre>\n<pre><span>  49:<\/span> Const conForcedTimeOut = 900000<\/pre>\n<pre><span>  50:<\/span> Dim objIE<\/pre>\n<pre><span>  51:<\/span> Dim objProgressBar<\/pre>\n<pre><span>  52:<\/span> Dim objTextLine1<\/pre>\n<pre><span>  53:<\/span> Dim objTextLine2<\/pre>\n<pre><span>  54:<\/span> Dim objQuitFlag<\/pre>\n<pre><span>  55:<\/span>?? <\/pre>\n<pre><span>  56:<\/span> Dim bAbort: bAbort = false<\/pre>\n<pre><span>  57:<\/span>?? <\/pre>\n<pre><span>  58:<\/span> System Constants<\/pre>\n<pre><span>  59:<\/span> Const SYSTEM_FOLDER = 1, TEMP_FOLDER = 2<\/pre>\n<pre><span>  60:<\/span> Const ForAppending = 8<\/pre>\n<pre><span>  61:<\/span> Const ForReading = 1<\/pre>\n<pre><span>  62:<\/span> Const ForWriting = 2<\/pre>\n<pre><span>  63:<\/span>?? <\/pre>\n<pre><span>  64:<\/span> <span>========================================================================<\/span><\/pre>\n<pre><span>  65:<\/span> Initialization of Work Environment<\/pre>\n<pre><span>  66:<\/span>?? <\/pre>\n<pre><span>  67:<\/span> <span>if<\/span> arguments.Named.Exists(<span>\"quiet\"<\/span>) then<\/pre>\n<pre><span>  68:<\/span>?? <\/pre>\n<pre><span>  69:<\/span>   <span>if<\/span> arguments.Named.Item(<span>\"quiet\"<\/span>) = 1 then<\/pre>\n<pre><span>  70:<\/span>     bQuiet = <span>true<\/span><\/pre>\n<pre><span>  71:<\/span>   end <span>if<\/span><\/pre>\n<pre><span>  72:<\/span>?? <\/pre>\n<pre><span>  73:<\/span>   <span>if<\/span> arguments.Named.Item(<span>\"quiet\"<\/span>) = 0 then<\/pre>\n<pre><span>  74:<\/span>     bQuiet = <span>false<\/span><\/pre>\n<pre><span>  75:<\/span>   end <span>if<\/span><\/pre>\n<pre><span>  76:<\/span>?? <\/pre>\n<pre><span>  77:<\/span> end <span>if<\/span><\/pre>\n<pre><span>  78:<\/span>?? <\/pre>\n<pre><span>  79:<\/span> <span>if<\/span> arguments.Named.Exists(<span>\"list\"<\/span>) then<\/pre>\n<pre><span>  80:<\/span>?? <\/pre>\n<pre><span>  81:<\/span>   <span>if<\/span> arguments.Named.Item(<span>\"list\"<\/span>) = 0 or arguments.Named.Item(<span>\"list\"<\/span>) = 1 then<\/pre>\n<pre><span>  82:<\/span>     WriteFileList = arguments.Named.Item(<span>\"list\"<\/span>)<\/pre>\n<pre><span>  83:<\/span>   end <span>if<\/span><\/pre>\n<pre><span>  84:<\/span>?? <\/pre>\n<pre><span>  85:<\/span> end <span>if<\/span><\/pre>\n<pre><span>  86:<\/span>?? <\/pre>\n<pre><span>  87:<\/span> <span>if<\/span> arguments.Named.Exists(<span>\"log\"<\/span>) then<\/pre>\n<pre><span>  88:<\/span>?? <\/pre>\n<pre><span>  89:<\/span>   <span>if<\/span> arguments.Named.Item(<span>\"log\"<\/span>) = 0 or arguments.Named.Item(<span>\"log\"<\/span>) = 1 then<\/pre>\n<pre><span>  90:<\/span>     WriteDeDupeLog = arguments.Named.Item(<span>\"log\"<\/span>)<\/pre>\n<pre><span>  91:<\/span>   end <span>if<\/span><\/pre>\n<pre><span>  92:<\/span>?? <\/pre>\n<pre><span>  93:<\/span> end <span>if<\/span><\/pre>\n<pre><span>  94:<\/span>?? <\/pre>\n<pre><span>  95:<\/span> <span>Check for command line paramater passed<\/span><\/pre>\n<pre><span>  96:<\/span>?? <\/pre>\n<pre><span>  97:<\/span> if arguments.unnamed.count = 0 then<\/pre>\n<pre><span>  98:<\/span>   Set Path to Current Path <\/pre>\n<pre><span>  99:<\/span>   sFolderPath = ofso.GetAbsolutePathName(<span>\".\"<\/span>)<\/pre>\n<pre><span> 100:<\/span> <span>else<\/span><\/pre>\n<pre><span> 101:<\/span>   <span>Set Path to folder that was passed as argument for the script call<\/span><\/pre>\n<pre><span> 102:<\/span>   sFolderPath = arguments.unnamed(0)<\/pre>\n<pre><span> 103:<\/span> end if<\/pre>\n<pre><span> 104:<\/span>?? <\/pre>\n<pre><span> 105:<\/span> Make sure that 3rd party tools md5sum.exe and touch.exe are either <span>in<\/span> <\/pre>\n<pre><span> 106:<\/span> <span>the System32 directory or the current path (I don<\/span>t check the whole Path Env)<\/pre>\n<pre><span> 107:<\/span> md5sumPath   = oFso.BuildPath(oFso.GetSpecialFolder(SYSTEM_FOLDER), <span>\"md5sum.exe\"<\/span>)<\/pre>\n<pre><span> 108:<\/span>?? <\/pre>\n<pre><span> 109:<\/span> <span>if<\/span> not oFso.FileExists(md5sumPath) then<\/pre>\n<pre><span> 110:<\/span>   md5sumPath = oFso.BuildPath(oFso.GetAbsolutePathName(<span>\".\"<\/span>), <span>\"md5sum.exe\"<\/span>)<\/pre>\n<pre><span> 111:<\/span>?? <\/pre>\n<pre><span> 112:<\/span>   <span>if<\/span> not oFso.FileExists(md5sumPath) then<\/pre>\n<pre><span> 113:<\/span>     sErr     = sErr & <span>\"Md5sum.exe not found in \"<\/span> & oFso.GetSpecialFolder(SYSTEM_FOLDER) & _<\/pre>\n<pre><span> 114:<\/span>     <span>\" nor \"<\/span> & oFso.GetAbsolutePathName(<span>\".\"<\/span>) & vbcrlf & vbcrlf<\/pre>\n<pre><span> 115:<\/span>   end <span>if<\/span><\/pre>\n<pre><span> 116:<\/span>?? <\/pre>\n<pre><span> 117:<\/span> end <span>if<\/span><\/pre>\n<pre><span> 118:<\/span>?? <\/pre>\n<pre><span> 119:<\/span> <span>Make sure that the folder (especially the ones passed as Param) exists<\/span><\/pre>\n<pre><span> 120:<\/span>?? <\/pre>\n<pre><span> 121:<\/span> if not oFso.FolderExists(sFolderPath) then<\/pre>\n<pre><span> 122:<\/span>   sErr = sErr & \"Processing Folder: \" & sFolderPath & _<\/pre>\n<pre><span> 123:<\/span>   \" does not exist.\" & vbcrlf & vbcrlf<\/pre>\n<pre><span> 124:<\/span> end if<\/pre>\n<pre><span> 125:<\/span>?? <\/pre>\n<pre><span> 126:<\/span> If something <span>is<\/span> not right, show error and abort the script<\/pre>\n<pre><span> 127:<\/span>?? <\/pre>\n<pre><span> 128:<\/span> <span>if<\/span> sErr <> <span>\"\"<\/span> then<\/pre>\n<pre><span> 129:<\/span>   <span>if<\/span> bQuiet = <span>false<\/span> then Wscript.echo sErr<\/pre>\n<pre><span> 130:<\/span>   CleanUpAndQuit 4<\/pre>\n<pre><span> 131:<\/span> end <span>if<\/span><\/pre>\n<pre><span> 132:<\/span>?? <\/pre>\n<pre><span> 133:<\/span> Dim sLogOutput: sLogOutput = oFso.BuildPath(sFolderPath,DeDupeLogFName)<\/pre>\n<pre><span> 134:<\/span>?? <\/pre>\n<pre><span> 135:<\/span> <span>Okay.. Let<\/span>s get started<\/pre>\n<pre><span> 136:<\/span> <span>------------------------------------------------------------------------<\/span><\/pre>\n<pre><span> 137:<\/span>?? <\/pre>\n<pre><span> 138:<\/span> Set oFolder = oFso.GetFolder(sFolderPath)<\/pre>\n<pre><span> 139:<\/span> Set oFiles  = oFolder.Files<\/pre>\n<pre><span> 140:<\/span> iFilesCnt   = oFiles.count<\/pre>\n<pre><span> 141:<\/span>?? <\/pre>\n<pre><span> 142:<\/span> if iFilesCnt > 0 then<\/pre>\n<pre><span> 143:<\/span>   ReDim MyArray(oFiles.count,3)<\/pre>\n<pre><span> 144:<\/span>   Build 2 Dimensional Array with CheckSum of <\/pre>\n<pre><span> 145:<\/span>   <span>Filename & File Name itself for all files in <\/span><\/pre>\n<pre><span> 146:<\/span>   current directory. Looking like <span>this<\/span> <\/pre>\n<pre><span> 147:<\/span>   <span>(x = dimention 2 and y = dimention 1) <\/span><\/pre>\n<pre><span> 148:<\/span>   the 3rd column <span>is<\/span> MD5 +[]+ lower <span>case<\/span> file name <span>for<\/span> sorting purposes<\/pre>\n<pre><span> 149:<\/span>   <span>43a52d14577de0299146aa9f8f0c062f, file1.ext, 43a52d14577de0299146aa9f8f0c062f[]file1.ext <\/span><\/pre>\n<pre><span> 150:<\/span>   0052d12577de56567546aa9f8f0c0af3, file2.ext, 0052d12577de56567546aa9f8f0c0af3[]file2.ext<\/pre>\n<pre><span> 151:<\/span>?? <\/pre>\n<pre><span> 152:<\/span>   <span>if<\/span> bQuiet = <span>false<\/span> then<\/pre>\n<pre><span> 153:<\/span>     <span>Launch Status Bar<\/span><\/pre>\n<pre><span> 154:<\/span>     StartIE \"De-Dupeing Files in \" & sFolderPath<\/pre>\n<pre><span> 155:<\/span>     SetLine1 \"Step 1\/4: Reading Files and MD5 Check Sums. Path:\" & sFolderPath<\/pre>\n<pre><span> 156:<\/span>   end if<\/pre>\n<pre><span> 157:<\/span>?? <\/pre>\n<pre><span> 158:<\/span>   For each oFile in oFiles<\/pre>\n<pre><span> 159:<\/span>     iCounter = iCounter + 1<\/pre>\n<pre><span> 160:<\/span>     sMD5CS   = GetMd5Sum(oFile.name)<\/pre>\n<pre><span> 161:<\/span>     MyArray(iCounter - 1,0) = sMD5CS<\/pre>\n<pre><span> 162:<\/span>     MyArray(iCounter - 1,1) = oFile.name<\/pre>\n<pre><span> 163:<\/span>     MyArray(iCounter - 1,2) = sMD5CS & \"[]\" & lcase(oFile.name)<\/pre>\n<pre><span> 164:<\/span>     Check <span>if<\/span> Abort Button was pressed<\/pre>\n<pre><span> 165:<\/span>?? <\/pre>\n<pre><span> 166:<\/span>     <span>if<\/span> bQuiet = <span>false<\/span> then<\/pre>\n<pre><span> 167:<\/span>?? <\/pre>\n<pre><span> 168:<\/span>       If IsQuit() = True Then<\/pre>\n<pre><span> 169:<\/span>         bAbort = <span>true<\/span><\/pre>\n<pre><span> 170:<\/span>         Exit For<\/pre>\n<pre><span> 171:<\/span>       End If<\/pre>\n<pre><span> 172:<\/span>?? <\/pre>\n<pre><span> 173:<\/span>       <span>Set Status Bar Value   <\/span><\/pre>\n<pre><span> 174:<\/span>       SetLine2 \"Files Processed: \" & CStr(iCounter) & \" of \" & cstr(iFilesCnt)<\/pre>\n<pre><span> 175:<\/span>     end if<\/pre>\n<pre><span> 176:<\/span>?? <\/pre>\n<pre><span> 177:<\/span>   Next<\/pre>\n<pre><span> 178:<\/span>?? <\/pre>\n<pre><span> 179:<\/span> end if<\/pre>\n<pre><span> 180:<\/span>?? <\/pre>\n<pre><span> 181:<\/span> iCounter = iCounter - 1<\/pre>\n<pre><span> 182:<\/span>?? <\/pre>\n<pre><span> 183:<\/span> if bAbort = true and bQuiet = false then<\/pre>\n<pre><span> 184:<\/span>   Close Status Bar<\/pre>\n<pre><span> 185:<\/span>   CloseIE<\/pre>\n<pre><span> 186:<\/span> end <span>if<\/span><\/pre>\n<pre><span> 187:<\/span>?? <\/pre>\n<pre><span> 188:<\/span> <span>if<\/span> iCounter >= 0 and bAbort = <span>false<\/span> then<\/pre>\n<pre><span> 189:<\/span>?? <\/pre>\n<pre><span> 190:<\/span>   <span>if<\/span> bAbort = <span>false<\/span> then<\/pre>\n<pre><span> 191:<\/span>?? <\/pre>\n<pre><span> 192:<\/span>     <span>if<\/span> bQuiet = <span>false<\/span> then<\/pre>\n<pre><span> 193:<\/span>       <span>Set Status Bar Value     <\/span><\/pre>\n<pre><span> 194:<\/span>       SetLine1 \"Step 2\/4: Sort Files\"<\/pre>\n<pre><span> 195:<\/span>       SetLine2 \"Processing \" & cstr(iCounter - 1) & \" Files\"<\/pre>\n<pre><span> 196:<\/span>     end if<\/pre>\n<pre><span> 197:<\/span>?? <\/pre>\n<pre><span> 198:<\/span>     Sort the Array by File Name<\/pre>\n<pre><span> 199:<\/span>     Call QuickSort(MyArray,0,ubound(MyArray,1),2)<\/pre>\n<pre><span> 200:<\/span>?? <\/pre>\n<pre><span> 201:<\/span>     <span>if<\/span> bQuiet = <span>false<\/span> then<\/pre>\n<pre><span> 202:<\/span>       <span>Check if Abort Button was pressed<\/span><\/pre>\n<pre><span> 203:<\/span>?? <\/pre>\n<pre><span> 204:<\/span>       If IsQuit() = True Then<\/pre>\n<pre><span> 205:<\/span>         bAbort = true<\/pre>\n<pre><span> 206:<\/span>       End If<\/pre>\n<pre><span> 207:<\/span>?? <\/pre>\n<pre><span> 208:<\/span>     end if<\/pre>\n<pre><span> 209:<\/span>?? <\/pre>\n<pre><span> 210:<\/span>   end if<\/pre>\n<pre><span> 211:<\/span>?? <\/pre>\n<pre><span> 212:<\/span>   if WriteFileList = 1 then<\/pre>\n<pre><span> 213:<\/span>     Write File List <span>out<\/span> into Text File<\/pre>\n<pre><span> 214:<\/span>?? <\/pre>\n<pre><span> 215:<\/span>     <span>if<\/span> bQuiet = <span>false<\/span> then<\/pre>\n<pre><span> 216:<\/span>       <span>Set Status Bar Value<\/span><\/pre>\n<pre><span> 217:<\/span>       SetLine1 \"Step 3\/4: Writing File List\"<\/pre>\n<pre><span> 218:<\/span>       SetLine2 oFso.BuildPath(sFolderPath,FileListFName)<\/pre>\n<pre><span> 219:<\/span>     end if<\/pre>\n<pre><span> 220:<\/span>?? <\/pre>\n<pre><span> 221:<\/span>     Call WriteFile(MyArray)<\/pre>\n<pre><span> 222:<\/span>     Check <span>if<\/span> Abort Button was pressed<\/pre>\n<pre><span> 223:<\/span>?? <\/pre>\n<pre><span> 224:<\/span>     <span>if<\/span> bQuiet = <span>false<\/span> then<\/pre>\n<pre><span> 225:<\/span>?? <\/pre>\n<pre><span> 226:<\/span>       If IsQuit() = True Then<\/pre>\n<pre><span> 227:<\/span>         bAbort = <span>true<\/span><\/pre>\n<pre><span> 228:<\/span>       End If<\/pre>\n<pre><span> 229:<\/span>?? <\/pre>\n<pre><span> 230:<\/span>     end <span>if<\/span><\/pre>\n<pre><span> 231:<\/span>?? <\/pre>\n<pre><span> 232:<\/span>   end <span>if<\/span><\/pre>\n<pre><span> 233:<\/span>?? <\/pre>\n<pre><span> 234:<\/span>   <span>if<\/span> bAbort = <span>false<\/span> then<\/pre>\n<pre><span> 235:<\/span>?? <\/pre>\n<pre><span> 236:<\/span>     <span>if<\/span> bQuiet = <span>false<\/span> then<\/pre>\n<pre><span> 237:<\/span>       <span>Set Status Bar Value<\/span><\/pre>\n<pre><span> 238:<\/span>       SetLine1 \"Step 4\/4: Detect and Process Duplicates\"<\/pre>\n<pre><span> 239:<\/span>       SetLine2 \"\"<\/pre>\n<pre><span> 240:<\/span>     end if<\/pre>\n<pre><span> 241:<\/span>?? <\/pre>\n<pre><span> 242:<\/span>     Detect Duplicates     <\/pre>\n<pre><span> 243:<\/span>     Call FindDupes(MyArray)<\/pre>\n<pre><span> 244:<\/span>?? <\/pre>\n<pre><span> 245:<\/span>     <span>Wrapping up<\/span><\/pre>\n<pre><span> 246:<\/span>     iDupProc = iDupCnt - iDupErr<\/pre>\n<pre><span> 247:<\/span>?? <\/pre>\n<pre><span> 248:<\/span>     if bQuiet = false then<\/pre>\n<pre><span> 249:<\/span>       Close Status Bar<\/pre>\n<pre><span> 250:<\/span>       CloseIE<\/pre>\n<pre><span> 251:<\/span>     end <span>if<\/span><\/pre>\n<pre><span> 252:<\/span>?? <\/pre>\n<pre><span> 253:<\/span>     sMsg = <span>\"Number of Files Found: \"<\/span> & iFilesCnt & vbcrlf & _<\/pre>\n<pre><span> 254:<\/span>     <span>\"Number of MD5 Sum Errors: \"<\/span> & iMD5SumErr & vbcrlf & _<\/pre>\n<pre><span> 255:<\/span>     <span>\"Number of Files Processed: \"<\/span> & iFilesProc & vbcrlf & _<\/pre>\n<pre><span> 256:<\/span>     <span>\"------------------------------------\"<\/span> & vbcrlf & _<\/pre>\n<pre><span> 257:<\/span>     <span>\"Number of Dupes Found: \"<\/span> & iDupCnt & vbcrlf & _<\/pre>\n<pre><span> 258:<\/span>     <span>\"Number of Dupe Processing Errors: \"<\/span> & iDupErr & vbcrlf & _<\/pre>\n<pre><span> 259:<\/span>     <span>\"Number of Dupes Processed: \"<\/span> & iDupProc & vbcrlf<\/pre>\n<pre><span> 260:<\/span>?? <\/pre>\n<pre><span> 261:<\/span>     ErrorLogWrite <span>\"Number of Files Found: \"<\/span> & iFilesCnt<\/pre>\n<pre><span> 262:<\/span>     ErrorLogWrite <span>\"Number of MD5 Sum Errors: \"<\/span> & iMD5SumErr<\/pre>\n<pre><span> 263:<\/span>     ErrorLogWrite <span>\"Number of Files Processed: \"<\/span> & iFilesProc<\/pre>\n<pre><span> 264:<\/span>     ErrorLogWrite <span>\"Number of Dupes Found: \"<\/span> & iDupCnt<\/pre>\n<pre><span> 265:<\/span>     ErrorLogWrite <span>\"Number of Dupe Processing Errors: \"<\/span> & iDupErr<\/pre>\n<pre><span> 266:<\/span>     ErrorLogWrite <span>\"Number of Dupes Processed: \"<\/span> & iDupProc<\/pre>\n<pre><span> 267:<\/span>?? <\/pre>\n<pre><span> 268:<\/span>     <span>if<\/span> WriteFileList = 1 then<\/pre>\n<pre><span> 269:<\/span>       sMsg = sMsg & vbcrlf & <span>\"List of Files Generated at:\"<\/span> & vbcrlf & _<\/pre>\n<pre><span> 270:<\/span>       oFso.BuildPath(sFolderPath,FileListFName) & vbcrlf<\/pre>\n<pre><span> 271:<\/span>       ErrorLogWrite <span>\"List of Files Generated at: \"<\/span> & _<\/pre>\n<pre><span> 272:<\/span>       oFso.BuildPath(sFolderPath,FileListFName)<\/pre>\n<pre><span> 273:<\/span>     end <span>if<\/span><\/pre>\n<pre><span> 274:<\/span>?? <\/pre>\n<pre><span> 275:<\/span>     <span>if<\/span> WriteDeDupeLog = 1 then<\/pre>\n<pre><span> 276:<\/span>       sMsg = sMsg & vbcrlf & <span>\"Log File Generated at: \"<\/span> & vbcrlf & sLogOutput<\/pre>\n<pre><span> 277:<\/span>     end <span>if<\/span><\/pre>\n<pre><span> 278:<\/span>?? <\/pre>\n<pre><span> 279:<\/span>     <span>if<\/span> bQuiet = <span>false<\/span> then<\/pre>\n<pre><span> 280:<\/span>       WScript.echo sMSg<\/pre>\n<pre><span> 281:<\/span>     end <span>if<\/span><\/pre>\n<pre><span> 282:<\/span>?? <\/pre>\n<pre><span> 283:<\/span>   <span>else<\/span><\/pre>\n<pre><span> 284:<\/span>?? <\/pre>\n<pre><span> 285:<\/span>     <span>if<\/span> bQuiet = <span>false<\/span> then<\/pre>\n<pre><span> 286:<\/span>       <span>Close Status Bar<\/span><\/pre>\n<pre><span> 287:<\/span>       CloseIE<\/pre>\n<pre><span> 288:<\/span>     end if<\/pre>\n<pre><span> 289:<\/span>?? <\/pre>\n<pre><span> 290:<\/span>   end if<\/pre>\n<pre><span> 291:<\/span>?? <\/pre>\n<pre><span> 292:<\/span> else<\/pre>\n<pre><span> 293:<\/span>?? <\/pre>\n<pre><span> 294:<\/span>   if bAbort = false then<\/pre>\n<pre><span> 295:<\/span>     No Files Found to dedupe<\/pre>\n<pre><span> 296:<\/span>?? <\/pre>\n<pre><span> 297:<\/span>     <span>if<\/span> bQuiet = <span>false<\/span> then<\/pre>\n<pre><span> 298:<\/span>       Wscript.echo <span>\"No Files to de-dupe found in \"<\/span> & sFolderPath<\/pre>\n<pre><span> 299:<\/span>     end <span>if<\/span><\/pre>\n<pre><span> 300:<\/span>?? <\/pre>\n<pre><span> 301:<\/span>     CleanUpAndQuit 1<\/pre>\n<pre><span> 302:<\/span>   end <span>if<\/span><\/pre>\n<pre><span> 303:<\/span>?? <\/pre>\n<pre><span> 304:<\/span> end <span>if<\/span><\/pre>\n<pre><span> 305:<\/span>?? <\/pre>\n<pre><span> 306:<\/span> <span>if<\/span> bAbort = <span>true<\/span> then<\/pre>\n<pre><span> 307:<\/span>   <span>Aborted Message<\/span><\/pre>\n<pre><span> 308:<\/span>?? <\/pre>\n<pre><span> 309:<\/span>   if bQuiet = false then<\/pre>\n<pre><span> 310:<\/span>     Wscript.echo \"The De-Dupe Script Was abborted.\"<\/pre>\n<pre><span> 311:<\/span>   end if<\/pre>\n<pre><span> 312:<\/span>?? <\/pre>\n<pre><span> 313:<\/span>   CleanUpAndQuit 2<\/pre>\n<pre><span> 314:<\/span> end if<\/pre>\n<pre><span> 315:<\/span>?? <\/pre>\n<pre><span> 316:<\/span> CleanUpAndQuit 0<\/pre>\n<pre><span> 317:<\/span>?? <\/pre>\n<pre><span> 318:<\/span> ==============================================================================<\/pre>\n<pre><span> 319:<\/span> Function GetMd5Sum(ByVal strFile)<\/pre>\n<pre><span> 320:<\/span>   <span> Declare the FileSystemObject object constants and variables.<\/span><\/pre>\n<pre><span> 321:<\/span>   Dim objTS, strTempFile, strCmdLine, objRE<\/pre>\n<pre><span> 322:<\/span>?? <\/pre>\n<pre><span> 323:<\/span>   With oFso<\/pre>\n<pre><span> 324:<\/span>      Construct a temporary filename.<\/pre>\n<pre><span> 325:<\/span>     Do<\/pre>\n<pre><span> 326:<\/span>     strTempFile = .BuildPath(.GetSpecialFolder(TEMP_FOLDER), <span>\"!\"<\/span> & .GetTempName)<\/pre>\n<pre><span> 327:<\/span>   Loop While .FileExists(strTempFile)<\/pre>\n<pre><span> 328:<\/span>?? <\/pre>\n<pre><span> 329:<\/span>   <span>Use cmd.exe to construct a command that will execute md5sum.exe<\/span><\/pre>\n<pre><span> 330:<\/span>   strCmdLine = .BuildPath(.GetSpecialFolder(SYSTEM_FOLDER), \"cmd.exe\") _<\/pre>\n<pre><span> 331:<\/span>    & \" \/c \" & md5sumPath & \"  \"\"\" & strFile & \"\"\">\" & strTempFile<\/pre>\n<pre><span> 332:<\/span>?? <\/pre>\n<pre><span> 333:<\/span> End With<\/pre>\n<pre><span> 334:<\/span>?? <\/pre>\n<pre><span> 335:<\/span>  Execute the command <span>in<\/span> a hidden window. Wait <span>for<\/span> the command<\/pre>\n<pre><span> 336:<\/span> <span> to complete before continuing.<\/span><\/pre>\n<pre><span> 337:<\/span> CreateObject(\"WScript.Shell\").Run strCmdLine, 0, True<\/pre>\n<pre><span> 338:<\/span>?? <\/pre>\n<pre><span> 339:<\/span>  Open the temporary file.<\/pre>\n<pre><span> 340:<\/span> s         = <span>\"\"<\/span><\/pre>\n<pre><span> 341:<\/span> On Error Resume Next<\/pre>\n<pre><span> 342:<\/span> Set objTS = oFso.OpenTextFile(strTempFile, 1)<\/pre>\n<pre><span> 343:<\/span> s         = objTS.ReadAll<\/pre>\n<pre><span> 344:<\/span> On Error Goto 0<\/pre>\n<pre><span> 345:<\/span>?? <\/pre>\n<pre><span> 346:<\/span> <span>check that it didn<\/span>t fail and has the checksum<\/pre>\n<pre><span> 347:<\/span>?? <\/pre>\n<pre><span> 348:<\/span> <span>if<\/span> trim(s) <> <span>\"\"<\/span> and instr(s,<span>\" *\"<\/span>) > 0 then<\/pre>\n<pre><span> 349:<\/span>   GetMD5Sum  = left(s,instr(s,<span>\" *\"<\/span>) - 1)<\/pre>\n<pre><span> 350:<\/span>   iFilesProc = iFilesProc + 1<\/pre>\n<pre><span> 351:<\/span> <span>else<\/span><\/pre>\n<pre><span> 352:<\/span>   <span>Error... not good<\/span><\/pre>\n<pre><span> 353:<\/span>   iMD5SumErr = iMD5SumErr + 1<\/pre>\n<pre><span> 354:<\/span>   GetMD5Sum  = \"\"<\/pre>\n<pre><span> 355:<\/span> end if<\/pre>\n<pre><span> 356:<\/span>?? <\/pre>\n<pre><span> 357:<\/span> objTS.Close<\/pre>\n<pre><span> 358:<\/span> oFso.DeleteFile strTempFile<\/pre>\n<pre><span> 359:<\/span> End Function<\/pre>\n<pre><span> 360:<\/span>?? <\/pre>\n<pre><span> 361:<\/span> ==================================================================================<\/pre>\n<pre><span> 362:<\/span> <span>Array Sort Functions<\/span><\/pre>\n<pre><span> 363:<\/span> Sub SwapRows(ary,row1,row2)<\/pre>\n<pre><span> 364:<\/span> == This proc swaps two rows of an array <\/pre>\n<pre><span> 365:<\/span> Dim x,tempvar<\/pre>\n<pre><span> 366:<\/span>?? <\/pre>\n<pre><span> 367:<\/span> For x = 0 to Ubound(ary,2)<\/pre>\n<pre><span> 368:<\/span>   tempvar     = ary(row1,x)<\/pre>\n<pre><span> 369:<\/span>   ary(row1,x) = ary(row2,x)<\/pre>\n<pre><span> 370:<\/span>   ary(row2,x) = tempvar<\/pre>\n<pre><span> 371:<\/span> Next<\/pre>\n<pre><span> 372:<\/span>?? <\/pre>\n<pre><span> 373:<\/span> End Sub  <span>SwapRows<\/span><\/pre>\n<pre><span> 374:<\/span> Sub QuickSort(vec,loBound,hiBound,SortField)<\/pre>\n<pre><span> 375:<\/span> ==--------------------------------------------------------==<\/pre>\n<pre><span> 376:<\/span> <span>== Sort a 2 dimensional array on SortField        ==<\/span><\/pre>\n<pre><span> 377:<\/span> ==                            ==<\/pre>\n<pre><span> 378:<\/span> <span>== This procedure is adapted from the algorithm given in: ==<\/span><\/pre>\n<pre><span> 379:<\/span> ==  ~ Data Abstractions & Structures <span>using<\/span> C++ by ~   ==<\/pre>\n<pre><span> 380:<\/span> <span>==  ~ Mark Headington and David Riley, pg. 586  ~   ==<\/span><\/pre>\n<pre><span> 381:<\/span> == Quicksort <span>is<\/span> the fastest array sorting routine <span>for<\/span>   ==<\/pre>\n<pre><span> 382:<\/span> <span>== unordered arrays.  Its big O is  n log n         ==<\/span><\/pre>\n<pre><span> 383:<\/span> ==                            ==<\/pre>\n<pre><span> 384:<\/span> <span>== Parameters:                      ==<\/span><\/pre>\n<pre><span> 385:<\/span> == vec     - array to be sorted             ==<\/pre>\n<pre><span> 386:<\/span> <span>== SortField - The field to sort on (2nd dimension value) ==<\/span><\/pre>\n<pre><span> 387:<\/span> == loBound and hiBound are simply the upper and lower   ==<\/pre>\n<pre><span> 388:<\/span> <span>==   bounds of the array<\/span>s 1st dimension.  It<span>s probably  ==<\/span><\/pre>\n<pre><span> 389:<\/span> ==   easiest to use the LBound and UBound functions to  ==<\/pre>\n<pre><span> 390:<\/span> <span>==   set these.                       ==<\/span><\/pre>\n<pre><span> 391:<\/span> ==--------------------------------------------------------==<\/pre>\n<pre><span> 392:<\/span> Dim pivot(),loSwap,hiSwap,temp,counter<\/pre>\n<pre><span> 393:<\/span> Redim pivot (Ubound(vec,2))<\/pre>\n<pre><span> 394:<\/span>?? <\/pre>\n<pre><span> 395:<\/span> <span>== Two items to sort<\/span><\/pre>\n<pre><span> 396:<\/span>?? <\/pre>\n<pre><span> 397:<\/span> if hiBound - loBound = 1 then<\/pre>\n<pre><span> 398:<\/span>?? <\/pre>\n<pre><span> 399:<\/span>   if vec(loBound,SortField) > vec(hiBound,SortField) _<\/pre>\n<pre><span> 400:<\/span>     then Call SwapRows(vec,hiBound,loBound)<\/pre>\n<pre><span> 401:<\/span>   End If<\/pre>\n<pre><span> 402:<\/span>?? <\/pre>\n<pre><span> 403:<\/span>   == Three or more items to sort<\/pre>\n<pre><span> 404:<\/span>?? <\/pre>\n<pre><span> 405:<\/span>   For counter = 0 to Ubound(vec,2)<\/pre>\n<pre><span> 406:<\/span>     pivot(counter)       = vec(<span>int<\/span>((loBound + hiBound) \/ 2),counter)<\/pre>\n<pre><span> 407:<\/span>     vec(<span>int<\/span>((loBound + hiBound) \/ 2),counter) = vec(loBound,counter)<\/pre>\n<pre><span> 408:<\/span>     vec(loBound,counter) = pivot(counter)<\/pre>\n<pre><span> 409:<\/span>   Next<\/pre>\n<pre><span> 410:<\/span>?? <\/pre>\n<pre><span> 411:<\/span>   loSwap = loBound + 1<\/pre>\n<pre><span> 412:<\/span>   hiSwap = hiBound<\/pre>\n<pre><span> 413:<\/span>?? <\/pre>\n<pre><span> 414:<\/span>   <span>do<\/span><\/pre>\n<pre><span> 415:<\/span>   <span>== Find the right loSwap<\/span><\/pre>\n<pre><span> 416:<\/span>   while loSwap < hiSwap and vec(loSwap,SortField) <= pivot(SortField)<\/pre>\n<pre><span> 417:<\/span>   loSwap = loSwap + 1<\/pre>\n<pre><span> 418:<\/span>   wend<\/pre>\n<pre><span> 419:<\/span>   == Find the right hiSwap<\/pre>\n<pre><span> 420:<\/span>   <span>while<\/span> vec(hiSwap,SortField) > pivot(SortField)<\/pre>\n<pre><span> 421:<\/span>   hiSwap = hiSwap - 1<\/pre>\n<pre><span> 422:<\/span>   wend<\/pre>\n<pre><span> 423:<\/span>   <span>== Swap values if loSwap is less then hiSwap<\/span><\/pre>\n<pre><span> 424:<\/span>   if loSwap < hiSwap then Call SwapRows(vec,loSwap,hiSwap)<\/pre>\n<pre><span> 425:<\/span>?? <\/pre>\n<pre><span> 426:<\/span> loop while loSwap < hiSwap<\/pre>\n<pre><span> 427:<\/span>?? <\/pre>\n<pre><span> 428:<\/span> For counter = 0 to Ubound(vec,2)<\/pre>\n<pre><span> 429:<\/span>   vec(loBound,counter) = vec(hiSwap,counter)<\/pre>\n<pre><span> 430:<\/span>   vec(hiSwap,counter)  = pivot(counter)<\/pre>\n<pre><span> 431:<\/span> Next<\/pre>\n<pre><span> 432:<\/span>?? <\/pre>\n<pre><span> 433:<\/span> == Recursively call function .. the beauty of Quicksort<\/pre>\n<pre><span> 434:<\/span> <span>== 2 or more items in first section<\/span><\/pre>\n<pre><span> 435:<\/span> if loBound < (hiSwap - 1) then Call QuickSort(vec,loBound,hiSwap - 1,SortField)<\/pre>\n<pre><span> 436:<\/span> == 2 or more items <span>in<\/span> second section<\/pre>\n<pre><span> 437:<\/span> <span>if<\/span> hiSwap + 1 < hibound then Call QuickSort(vec,hiSwap + 1,hiBound,SortField)<\/pre>\n<pre><span> 438:<\/span>?? <\/pre>\n<pre><span> 439:<\/span> End Sub  <span>QuickSort<\/span><\/pre>\n<pre><span> 440:<\/span> Sub PrintArray(vec,lo,hi,mark)<\/pre>\n<pre><span> 441:<\/span> ==-----------------------------------------==<\/pre>\n<pre><span> 442:<\/span> <span>== Print out an array from the lo bound  ==<\/span><\/pre>\n<pre><span> 443:<\/span> ==  to the hi bound.  Highlight the column ==<\/pre>\n<pre><span> 444:<\/span> <span>==  whose number matches parm mark     ==<\/span><\/pre>\n<pre><span> 445:<\/span> ==-----------------------------------------==<\/pre>\n<pre><span> 446:<\/span> Dim i,j<\/pre>\n<pre><span> 447:<\/span> sRes = <span>\"\"<\/span><\/pre>\n<pre><span> 448:<\/span>?? <\/pre>\n<pre><span> 449:<\/span> For i = lo to hi<\/pre>\n<pre><span> 450:<\/span>?? <\/pre>\n<pre><span> 451:<\/span>   For j = 0 to Ubound(vec,2)<\/pre>\n<pre><span> 452:<\/span>     sRes = sRes & vec(i,j) & vbTab & vbTab<\/pre>\n<pre><span> 453:<\/span>   Next<\/pre>\n<pre><span> 454:<\/span>?? <\/pre>\n<pre><span> 455:<\/span>   sRes   = sRes & vbcrlf<\/pre>\n<pre><span> 456:<\/span> Next<\/pre>\n<pre><span> 457:<\/span>?? <\/pre>\n<pre><span> 458:<\/span> wscript.echo sRes<\/pre>\n<pre><span> 459:<\/span> End Sub<\/pre>\n<pre><span> 460:<\/span>?? <\/pre>\n<pre><span> 461:<\/span> <span>===================================================================================<\/span><\/pre>\n<pre><span> 462:<\/span> Actual De-Duper Functions<\/pre>\n<pre><span> 463:<\/span> Sub FindDupes(Arr)<\/pre>\n<pre><span> 464:<\/span> Dim a, b, s, iCnt, sOrg<\/pre>\n<pre><span> 465:<\/span> sKey = <span>\"\"<\/span><\/pre>\n<pre><span> 466:<\/span> iCnt = Ubound(Arr,1)<\/pre>\n<pre><span> 467:<\/span>?? <\/pre>\n<pre><span> 468:<\/span> For a = 0 to iCnt<\/pre>\n<pre><span> 469:<\/span>?? <\/pre>\n<pre><span> 470:<\/span>   s = trim(Arr(a,0))<\/pre>\n<pre><span> 471:<\/span>?? <\/pre>\n<pre><span> 472:<\/span>   <span>if<\/span> s <> <span>\"\"<\/span> then<\/pre>\n<pre><span> 473:<\/span>?? <\/pre>\n<pre><span> 474:<\/span>     <span>if<\/span> sKey = <span>\"\"<\/span> then<\/pre>\n<pre><span> 475:<\/span>       <span>First CheckSum Value in Array, Set Key, don<\/span>t check further <\/pre>\n<pre><span> 476:<\/span>       sKey = s<\/pre>\n<pre><span> 477:<\/span>       sOrg = Arr(a,1)<\/pre>\n<pre><span> 478:<\/span>     <span>else<\/span><\/pre>\n<pre><span> 479:<\/span>       <span>CheckSum from previous file set, check if identical<\/span><\/pre>\n<pre><span> 480:<\/span>?? <\/pre>\n<pre><span> 481:<\/span>       if s = sKey then<\/pre>\n<pre><span> 482:<\/span>         Dupe<\/pre>\n<pre><span> 483:<\/span>         DupeHandling s,Key, Arr(a,1), sOrg<\/pre>\n<pre><span> 484:<\/span>       <span>else<\/span><\/pre>\n<pre><span> 485:<\/span>         <span>Set key to Checksum of new file, because it is different<\/span><\/pre>\n<pre><span> 486:<\/span>         sKey = s<\/pre>\n<pre><span> 487:<\/span>         sOrg = Arr(a,1)<\/pre>\n<pre><span> 488:<\/span>       end if<\/pre>\n<pre><span> 489:<\/span>?? <\/pre>\n<pre><span> 490:<\/span>     end if<\/pre>\n<pre><span> 491:<\/span>?? <\/pre>\n<pre><span> 492:<\/span>   end if<\/pre>\n<pre><span> 493:<\/span>?? <\/pre>\n<pre><span> 494:<\/span>   if bQuiet = false then<\/pre>\n<pre><span> 495:<\/span>     Set Status Bar Value   <\/pre>\n<pre><span> 496:<\/span>     SetLine2 <span>\"Files Processed: \"<\/span> & CStr(a + 1) & <span>\" of \"<\/span> & cstr(iCnt + 1)<\/pre>\n<pre><span> 497:<\/span>?? <\/pre>\n<pre><span> 498:<\/span>     <span>Check if Abort Button was pressed<\/span><\/pre>\n<pre><span> 499:<\/span>?? <\/pre>\n<pre><span> 500:<\/span>     If IsQuit() = True Then<\/pre>\n<pre><span> 501:<\/span>       Exit For<\/pre>\n<pre><span> 502:<\/span>       bAbort = true<\/pre>\n<pre><span> 503:<\/span>     End If<\/pre>\n<pre><span> 504:<\/span>?? <\/pre>\n<pre><span> 505:<\/span>   end if<\/pre>\n<pre><span> 506:<\/span>?? <\/pre>\n<pre><span> 507:<\/span> Next<\/pre>\n<pre><span> 508:<\/span>?? <\/pre>\n<pre><span> 509:<\/span> End Sub<\/pre>\n<pre><span> 510:<\/span>?? <\/pre>\n<pre><span> 511:<\/span> Sub DupeHandling(MD5dupe, MD5Org, FNameDupe, FNameOrg)<\/pre>\n<pre><span> 512:<\/span> Here <span>is<\/span> <span>where<\/span> You decide what to <span>do<\/span> with the found duplicate<\/pre>\n<pre><span> 513:<\/span> <span>You could for example perform additional checks <\/span><\/pre>\n<pre><span> 514:<\/span> beyond the MD5 Checksum also<\/pre>\n<pre><span> 515:<\/span> Dim sSrc, sOrg, sOrgExt, sOrgBase, sDest, sDestName, sDestExt, sDestBase<\/pre>\n<pre><span> 516:<\/span> <span>Increase Dupe Counter<\/span><\/pre>\n<pre><span> 517:<\/span> iDupCnt = iDupCnt + 1<\/pre>\n<pre><span> 518:<\/span>?? <\/pre>\n<pre><span> 519:<\/span> Determine the action to take<\/pre>\n<pre><span> 520:<\/span>?? <\/pre>\n<pre><span> 521:<\/span> Select Case DupeAction<\/pre>\n<pre><span> 522:<\/span>   Case 1<\/pre>\n<pre><span> 523:<\/span>     <span>Rename Dupe by appending Original File name as prefix with <\/span><\/pre>\n<pre><span> 524:<\/span>     an <span>_<\/span> <span>as<\/span> separator. Also the extension of the original file<\/pre>\n<pre><span> 525:<\/span>     <span>Full Path of Dupe File <\/span><\/pre>\n<pre><span> 526:<\/span>     sSrc    = oFso.BuildPath(sFolderPath,FNameDupe)<\/pre>\n<pre><span> 527:<\/span>     FUll Path of Org File<\/pre>\n<pre><span> 528:<\/span>     sOrg    = oFso.BuildPath(sFolderPath,FNameOrg)<\/pre>\n<pre><span> 529:<\/span>     <span>Get Extension of Org File<\/span><\/pre>\n<pre><span> 530:<\/span>     sOrgExt = oFso.GetExtensionName(sOrg)<\/pre>\n<pre><span> 531:<\/span>?? <\/pre>\n<pre><span> 532:<\/span>     Get Base File Name of Org File without Extension<\/pre>\n<pre><span> 533:<\/span>     sOrgBase = left(FNameOrg,    InStrRev(FNameOrg, <span>\".\"<\/span> & sOrgExt, - 1,1) - 1)<\/pre>\n<pre><span> 534:<\/span>?? <\/pre>\n<pre><span> 535:<\/span>     <span>Build New File name\/path for Dupe Path\\OrgBase_OrgExt_DupeBase.DupeExt<\/span><\/pre>\n<pre><span> 536:<\/span>     sDestExt  = oFso.GetExtensionName(FNameDupe)<\/pre>\n<pre><span> 537:<\/span>     sDestBase = left(FNameDupe,    InStrRev(FNameDupe, \".\" & sDestExt, - 1,1) - 1)<\/pre>\n<pre><span> 538:<\/span>     sDestName = sOrgBase & \"_\" & sOrgExt & \"_\" & sDestBase & \"[DEDUPED]\" & \".\" & sDestExt<\/pre>\n<pre><span> 539:<\/span>     sDest     = oFso.BuildPath(sFolderPath, sDestName)<\/pre>\n<pre><span> 540:<\/span>?? <\/pre>\n<pre><span> 541:<\/span>     Move<\/pre>\n<pre><span> 542:<\/span>?? <\/pre>\n<pre><span> 543:<\/span>     <span>if<\/span> oFso.FileExists(sDest) then<\/pre>\n<pre><span> 544:<\/span>       <span>New File already exist, cannot rename dupe, Increase Dupe Processing Error Count<\/span><\/pre>\n<pre><span> 545:<\/span>       iDupErr = iDupErr + 1<\/pre>\n<pre><span> 546:<\/span>       ErrorLogWrite \"Rename Failed! Org: \" & FNameOrg & \", Dupe Src: , \" & _<\/pre>\n<pre><span> 547:<\/span>       FNameDupe & \", Dest: \" & sDestName<\/pre>\n<pre><span> 548:<\/span>     Else<\/pre>\n<pre><span> 549:<\/span>       oFso.MoveFile sSrc, sDest<\/pre>\n<pre><span> 550:<\/span>       ErrorLogWrite \"Dupe Processed! Org: \" & FNameOrg & \", Dupe Src: , \" & _<\/pre>\n<pre><span> 551:<\/span>       FNameDupe & \", Dest: \" & sDestName<\/pre>\n<pre><span> 552:<\/span>     End if<\/pre>\n<pre><span> 553:<\/span>?? <\/pre>\n<pre><span> 554:<\/span>   Case Else<\/pre>\n<pre><span> 555:<\/span>     Not implemented yet<\/pre>\n<pre><span> 556:<\/span> End Select<\/pre>\n<pre><span> 557:<\/span>?? <\/pre>\n<pre><span> 558:<\/span> End Sub<\/pre>\n<pre><span> 559:<\/span>?? <\/pre>\n<pre><span> 560:<\/span> <span>==============================================================<\/span><\/pre>\n<pre><span> 561:<\/span> Support Funtions<\/pre>\n<pre><span> 562:<\/span> Sub WriteFile(arr)<\/pre>\n<pre><span> 563:<\/span> <span>Write List of Files with their MD5 Sums to a Text file<\/span><\/pre>\n<pre><span> 564:<\/span> Dim a loop count<\/pre>\n<pre><span> 565:<\/span>?? <\/pre>\n<pre><span> 566:<\/span> Dim f: f = oFso.BuildPath(sFolderPath,FileListFName)<\/pre>\n<pre><span> 567:<\/span> <span>Check if an old Listings File Already Exists and Delete it<\/span><\/pre>\n<pre><span> 568:<\/span>?? <\/pre>\n<pre><span> 569:<\/span> if oFso.FileExists(f) then<\/pre>\n<pre><span> 570:<\/span>   oFso.DeleteFile f, true<\/pre>\n<pre><span> 571:<\/span> end if<\/pre>\n<pre><span> 572:<\/span>?? <\/pre>\n<pre><span> 573:<\/span> Dim oF: Set oF = oFso.OpenTextFile(f, ForAppending, true, - 2)<\/pre>\n<pre><span> 574:<\/span>?? <\/pre>\n<pre><span> 575:<\/span> File Name + TAB + MD5 Sum of File<\/pre>\n<pre><span> 576:<\/span>?? <\/pre>\n<pre><span> 577:<\/span> For a = 0 to Ubound(arr,1)<\/pre>\n<pre><span> 578:<\/span>   oF.writeline trim(arr(a,1)) & vbtab & trim(arr(a,0))<\/pre>\n<pre><span> 579:<\/span> Next<\/pre>\n<pre><span> 580:<\/span>?? <\/pre>\n<pre><span> 581:<\/span> oF.Close<\/pre>\n<pre><span> 582:<\/span> Set oF = Nothing<\/pre>\n<pre><span> 583:<\/span> End Sub<\/pre>\n<pre><span> 584:<\/span>?? <\/pre>\n<pre><span> 585:<\/span> Function ErrorLogWrite(sErrLogMsg)<\/pre>\n<pre><span> 586:<\/span>?? <\/pre>\n<pre><span> 587:<\/span> Dim bOpenLog: bOpenLog = <span>false<\/span><\/pre>\n<pre><span> 588:<\/span> Dim sFullErrMsg<\/pre>\n<pre><span> 589:<\/span>?? <\/pre>\n<pre><span> 590:<\/span> <span>if<\/span> WriteDeDupeLog = 1 then<\/pre>\n<pre><span> 591:<\/span>?? <\/pre>\n<pre><span> 592:<\/span>   <span>if<\/span> not isObject(oLogfile) then<\/pre>\n<pre><span> 593:<\/span>     set oLogfile = nothing<\/pre>\n<pre><span> 594:<\/span>   end <span>if<\/span><\/pre>\n<pre><span> 595:<\/span>?? <\/pre>\n<pre><span> 596:<\/span>   <span>if<\/span> not (oLogfile <span>is<\/span> nothing) then<\/pre>\n<pre><span> 597:<\/span>   <span>else<\/span><\/pre>\n<pre><span> 598:<\/span>     bOpenLog = <span>true<\/span><\/pre>\n<pre><span> 599:<\/span>   end <span>if<\/span><\/pre>\n<pre><span> 600:<\/span>?? <\/pre>\n<pre><span> 601:<\/span>   <span>if<\/span>  bOpenLog = <span>true<\/span> then<\/pre>\n<pre><span> 602:<\/span>     Set oLogfile = oFSO.OpenTextFile(sLogOutput, ForWriting, True, - 2)<\/pre>\n<pre><span> 603:<\/span>     ErrorLogWrite(<span>\"----------------------------------------------\"<\/span>)<\/pre>\n<pre><span> 604:<\/span>     ErrorLogWrite(<span>\"New DeDupe Batch Started\"<\/span>)<\/pre>\n<pre><span> 605:<\/span>     ErrorLogWrite(<span>\"Work Path: \"<\/span> & sFolderPath)<\/pre>\n<pre><span> 606:<\/span>     ErrorLogWrite(<span>\"-----------------------------------------------\"<\/span>)<\/pre>\n<pre><span> 607:<\/span>   end <span>if<\/span><\/pre>\n<pre><span> 608:<\/span>?? <\/pre>\n<pre><span> 609:<\/span>   sFullErrMsg = LogDateFormat(now) & chr(9) & sErrLogMsg<\/pre>\n<pre><span> 610:<\/span>?? <\/pre>\n<pre><span> 611:<\/span>   oLogFile.Writeline sFullErrMsg<\/pre>\n<pre><span> 612:<\/span>?? <\/pre>\n<pre><span> 613:<\/span> end <span>if<\/span><\/pre>\n<pre><span> 614:<\/span>?? <\/pre>\n<pre><span> 615:<\/span> end function<\/pre>\n<pre><span> 616:<\/span>?? <\/pre>\n<pre><span> 617:<\/span> function LogDateFormat(dSourceDate)<\/pre>\n<pre><span> 618:<\/span> Const sLogDtNumbers = <span>\"0000\"<\/span><\/pre>\n<pre><span> 619:<\/span> Dim sLgDtYYYY, sLgDtMM, sLgDtDD, sLgDtHH, sLgDtNN, sLgDtSS<\/pre>\n<pre><span> 620:<\/span>?? <\/pre>\n<pre><span> 621:<\/span> sLgDtYYYY     = right(sLogDtNumbers & year(dSourceDate),4)<\/pre>\n<pre><span> 622:<\/span> sLgDtMM       = right(sLogDtNumbers & month(dSourceDate),2)<\/pre>\n<pre><span> 623:<\/span> sLgDtDD       = right(sLogDtNumbers & day(dSourceDate),2)<\/pre>\n<pre><span> 624:<\/span> sLgDtHH       = right(sLogDtNumbers & hour(dSourceDate),2)<\/pre>\n<pre><span> 625:<\/span> sLgDtNN       = right(sLogDtNumbers & minute(dSourceDate),2)<\/pre>\n<pre><span> 626:<\/span> sLgDtSS       = right(sLogDtNumbers & second(dSourceDate),2)<\/pre>\n<pre><span> 627:<\/span> LogDateFormat = sLgDtYYYY & <span>\"-\"<\/span> & sLgDtMM & <span>\"-\"<\/span> & sLgDtDD & _<\/pre>\n<pre><span> 628:<\/span> <span>\" \"<\/span> & sLgDtHH & <span>\":\"<\/span> & sLgDtNN & <span>\":\"<\/span> & sLgDtSS<\/pre>\n<pre><span> 629:<\/span> End Function<\/pre>\n<pre><span> 630:<\/span>?? <\/pre>\n<pre><span> 631:<\/span> <span>=================================================================<\/span><\/pre>\n<pre><span> 632:<\/span> Progress Bar Code<\/pre>\n<pre><span> 633:<\/span>?? <\/pre>\n<pre><span> 634:<\/span> <span>--------------------------------------------------------<\/span><\/pre>\n<pre><span> 635:<\/span>  Function   StartIE<\/pre>\n<pre><span> 636:<\/span> <span> Abstract   Launch IE Dialog Box and Progress bar<\/span><\/pre>\n<pre><span> 637:<\/span>  Parameters Titel of the box<\/pre>\n<pre><span> 638:<\/span> <span>--------------------------------------------------------<\/span><\/pre>\n<pre><span> 639:<\/span>?? <\/pre>\n<pre><span> 640:<\/span> Private Sub StartIE(strTitel)<\/pre>\n<pre><span> 641:<\/span> Dim objDocument<\/pre>\n<pre><span> 642:<\/span> Dim objWshShell<\/pre>\n<pre><span> 643:<\/span>?? <\/pre>\n<pre><span> 644:<\/span> Set objIE        = CreateObject(\"InternetExplorer.Application\")<\/pre>\n<pre><span> 645:<\/span> objIE.height     = 230<\/pre>\n<pre><span> 646:<\/span> objIE.width      = 400<\/pre>\n<pre><span> 647:<\/span> objIE.menubar    = False<\/pre>\n<pre><span> 648:<\/span> objIE.toolbar    = false<\/pre>\n<pre><span> 649:<\/span> objIE.statusbar  = false<\/pre>\n<pre><span> 650:<\/span> objIE.addressbar = false<\/pre>\n<pre><span> 651:<\/span> objIE.resizable  = False<\/pre>\n<pre><span> 652:<\/span> objIE.navigate (\"about:blank\")<\/pre>\n<pre><span> 653:<\/span>?? <\/pre>\n<pre><span> 654:<\/span>  wait till ie <span>is<\/span> loaded<\/pre>\n<pre><span> 655:<\/span> While (objIE.busy)<\/pre>\n<pre><span> 656:<\/span> wend<\/pre>\n<pre><span> 657:<\/span>?? <\/pre>\n<pre><span> 658:<\/span> set objDocument = objIE.document<\/pre>\n<pre><span> 659:<\/span> <span> setup the dialog box  <\/span><\/pre>\n<pre><span> 660:<\/span> WriteHtmlToDialog objDocument, strTitel<\/pre>\n<pre><span> 661:<\/span>?? <\/pre>\n<pre><span> 662:<\/span>  with ie\/html loaded, define assorted objects...<\/pre>\n<pre><span> 663:<\/span> set objTextLine1       = objIE.document.all(<span>\"txtMilestone\"<\/span>)<\/pre>\n<pre><span> 664:<\/span> set objTextLine2       = objIE.document.all(<span>\"txtRemarks\"<\/span>)<\/pre>\n<pre><span> 665:<\/span> Set objProgressBar     = objIE.document.all(<span>\"pbText\"<\/span>)<\/pre>\n<pre><span> 666:<\/span> set objQuitFlag        = objIE.document.Secret.pubFlag<\/pre>\n<pre><span> 667:<\/span>?? <\/pre>\n<pre><span> 668:<\/span> objTextLine1.innerTEXT = <span>\"\"<\/span><\/pre>\n<pre><span> 669:<\/span> objTextLine2.innerTEXT = <span>\"\"<\/span><\/pre>\n<pre><span> 670:<\/span>?? <\/pre>\n<pre><span> 671:<\/span> <span> objIE.document.body.innerHTML = \"Building Document...\"<\/span><\/pre>\n<pre><span> 672:<\/span>  + <span>\"<br \/>load time= \"<\/span> + n<\/pre>\n<pre><span> 673:<\/span> objIE.visible = True<\/pre>\n<pre><span> 674:<\/span>?? <\/pre>\n<pre><span> 675:<\/span> <span> set focus to ie <\/span><\/pre>\n<pre><span> 676:<\/span> Set objWSHShell = WScript.CreateObject(\"WScript.Shell\")<\/pre>\n<pre><span> 677:<\/span> objWshShell.AppActivate(\"Microsoft Internet Explorer\")<\/pre>\n<pre><span> 678:<\/span> End Sub<\/pre>\n<pre><span> 679:<\/span>?? <\/pre>\n<pre><span> 680:<\/span> --------------------------------------------------------<\/pre>\n<pre><span> 681:<\/span> <span> Function CloseIE<\/span><\/pre>\n<pre><span> 682:<\/span>  Abstract Close the IE Browser Windows<\/pre>\n<pre><span> 683:<\/span> <span>--------------------------------------------------------<\/span><\/pre>\n<pre><span> 684:<\/span>?? <\/pre>\n<pre><span> 685:<\/span> Private Function CloseIE()<\/pre>\n<pre><span> 686:<\/span> On Error Resume Next<\/pre>\n<pre><span> 687:<\/span> objIE.quit<\/pre>\n<pre><span> 688:<\/span> End Function<\/pre>\n<pre><span> 689:<\/span>?? <\/pre>\n<pre><span> 690:<\/span> --------------------------------------------------------<\/pre>\n<pre><span> 691:<\/span> <span> Function   SetLine1<\/span><\/pre>\n<pre><span> 692:<\/span>  Abstract   Set Text Line <span>in<\/span> the Progress Bar Dialog Box<\/pre>\n<pre><span> 693:<\/span> <span> Parameters Progress Text<\/span><\/pre>\n<pre><span> 694:<\/span> --------------------------------------------------------<\/pre>\n<pre><span> 695:<\/span>?? <\/pre>\n<pre><span> 696:<\/span> Private sub SetLine1(sNewText)<\/pre>\n<pre><span> 697:<\/span> On Error Resume Next<\/pre>\n<pre><span> 698:<\/span> objTextLine1.innerTEXT = sNewText<\/pre>\n<pre><span> 699:<\/span> End Sub<\/pre>\n<pre><span> 700:<\/span>?? <\/pre>\n<pre><span> 701:<\/span> <span>--------------------------------------------------------<\/span><\/pre>\n<pre><span> 702:<\/span>  Function   SetLine2<\/pre>\n<pre><span> 703:<\/span> <span> Abstract   Set Text Line in the Progress Bar Dialog Box<\/span><\/pre>\n<pre><span> 704:<\/span>  Parameters Progress Text<\/pre>\n<pre><span> 705:<\/span> <span>--------------------------------------------------------<\/span><\/pre>\n<pre><span> 706:<\/span>?? <\/pre>\n<pre><span> 707:<\/span> Private sub SetLine2(sNewText)<\/pre>\n<pre><span> 708:<\/span> On Error Resume Next<\/pre>\n<pre><span> 709:<\/span> objTextLine2.innerTEXT = sNewText<\/pre>\n<pre><span> 710:<\/span> End Sub<\/pre>\n<pre><span> 711:<\/span>?? <\/pre>\n<pre><span> 712:<\/span> --------------------------------------------------------<\/pre>\n<pre><span> 713:<\/span> <span> Function   IsQuit<\/span><\/pre>\n<pre><span> 714:<\/span>  Abstract   Checks <span>if<\/span> the quit button was pressed<\/pre>\n<pre><span> 715:<\/span> <span> Parameters Progress Text<\/span><\/pre>\n<pre><span> 716:<\/span> --------------------------------------------------------<\/pre>\n<pre><span> 717:<\/span>?? <\/pre>\n<pre><span> 718:<\/span> Private function IsQuit()<\/pre>\n<pre><span> 719:<\/span> On Error Resume Next<\/pre>\n<pre><span> 720:<\/span> IsQuit   = False<\/pre>\n<pre><span> 721:<\/span>?? <\/pre>\n<pre><span> 722:<\/span> If objQuitFlag.Value = <span>\"quit\"<\/span> Then<\/pre>\n<pre><span> 723:<\/span>   IsQuit = True<\/pre>\n<pre><span> 724:<\/span> End If<\/pre>\n<pre><span> 725:<\/span>?? <\/pre>\n<pre><span> 726:<\/span> End function<\/pre>\n<pre><span> 727:<\/span>?? <\/pre>\n<pre><span> 728:<\/span> <span>--------------------------------------------------------<\/span><\/pre>\n<pre><span> 729:<\/span>  Function   WriteHtmlToDialog<\/pre>\n<pre><span> 730:<\/span> <span> Abstract   Set HTML Text for the IE Dialog box<\/span><\/pre>\n<pre><span> 731:<\/span>  Parameters IE Document Object, Title Text<\/pre>\n<pre><span> 732:<\/span> <span>--------------------------------------------------------<\/span><\/pre>\n<pre><span> 733:<\/span>?? <\/pre>\n<pre><span> 734:<\/span> Private Sub WriteHtmlToDialog(objDocument, strTitel)<\/pre>\n<pre><span> 735:<\/span> objDocument.Open<\/pre>\n<pre><span> 736:<\/span> objDocument.Writeln \"<title>\" & strTitel & \"<\/title> \"<\/pre>\n<pre><span> 737:<\/span> objDocument.Writeln \"<style>\"<\/style><\/pre>\n<pre><span> 738:<\/span> objDocument.Writeln \" BODY {background: Silver} BODY { overflow:hidden }\"<\/pre>\n<pre><span> 739:<\/span> objDocument.Writeln \" P.txtStyle {color: Black; font-family: Arial; \" _<\/pre>\n<pre><span> 740:<\/span>  & \" font-size: 10pt; font-weight: normal; margin-left: 10px; \" _<\/pre>\n<pre><span> 741:<\/span>  & \" width: 340px } \"<\/pre>\n<pre><span> 742:<\/span> objDocument.Writeln \" input.pbStyle {color: Navy; font-family: Wingdings; \" _<\/pre>\n<pre><span> 743:<\/span>  & \" font-size: 10pt; background: Silver; height: 20px; \" _<\/pre>\n<pre><span> 744:<\/span>  & \" width: 340px } \"<\/pre>\n<pre><span> 745:<\/span> objDocument.Writeln \"\"<\/pre>\n<pre><span> 746:<\/span> objDocument.Writeln \"<div id=\"\"objProgress\"\" class=\"\"Outer\"\"><\/div>\"<\/pre>\n<pre><span> 747:<\/span>  write <span>out<\/span> text lines... <\/pre>\n<pre><span> 748:<\/span> objDocument.Writeln <span>\"<p id=txtMilestone class=txtStyle style=margin-left: 10px> <\/p>\"<\/span><\/pre>\n<pre><span> 749:<\/span> objDocument.Writeln <span>\"<p id=txtRemarks class=txtStyle style=margin-left: 10px ><\/p>\"<\/span><\/pre>\n<pre><span> 750:<\/span> objDocument.Writeln <span>\"<center>\"<\/center><\/span><\/pre>\n<pre><span> 751:<\/span> <span> write progbar<\/span><\/pre>\n<pre><span> 752:<\/span> objDocument.Writeln \"<input type=text<span\/> id=pbText<span> class=<\/span>pbStyle<span> value=<\/span><span> >\"<\/span><\/pre>\n<pre><span> 753:<\/span> objDocument.Writeln \"<br \/><br \/>\"  space down a little<\/pre>\n<pre><span> 754:<\/span> <span> write cancel button...<\/span><\/pre>\n<pre><span> 755:<\/span> objDocument.Writeln \"<input type=button<span\/> value=Cancel<span> \" _<\/span><\/pre>\n<pre><span> 756:<\/span>  & \" onclick=SetReturnFlag(<span>\"\"<\/span>quit<span>\"\"<\/span>)<span> >\"<\/span><\/pre>\n<pre><span> 757:<\/span> objDocument.Writeln \"\"<\/pre>\n<pre><span> 758:<\/span>  write hidden <span>object<\/span>...<\/pre>\n<pre><span> 759:<\/span> objDocument.Writeln <span>\"<form name=secret >\"<\/form><\/span> _<\/pre>\n<pre><span> 760:<\/span>  & <span>\" <input type=hidden name=pubFlag value=run \/>\"<\/span> _<\/pre>\n<pre><span> 761:<\/span>  & <span>\"\"<\/span><\/pre>\n<pre><span> 762:<\/span> objDocument.Writeln <span>\"<script LANGUAGE=VBScript >\"<\/script><\/span><\/pre>\n<pre><span> 763:<\/span> <span> write \"local script\" to handle cmdCancel_Click event...<\/span><\/pre>\n<pre><span> 764:<\/span> objDocument.Writeln \"Sub SetReturnFlag(sFlag)\"<\/pre>\n<pre><span> 765:<\/span> objDocument.Writeln \" secret.pubFlag.Value = sFlag\"<\/pre>\n<pre><span> 766:<\/span> objDocument.Writeln \" txtMileStone.style.color = \"\"Red\"\" \"<\/pre>\n<pre><span> 767:<\/span> objDocument.Writeln \" txtRemarks.style.color = \"\"Red\"\" \"<\/pre>\n<pre><span> 768:<\/span> objDocument.Writeln \"End Sub\"<\/pre>\n<pre><span> 769:<\/span>  progress bar<\/pre>\n<pre><span> 770:<\/span> objDocument.Writeln <span>\"Function PctComplete(nPct)\"<\/span><\/pre>\n<pre><span> 771:<\/span> objDocument.Writeln <span>\"pbText.Value = String(nPct,\"<\/span><span>\" \"<\/span><span>\") & String(4,\"<\/span><span>\"n\"<\/span><span>\")\"<\/span><\/pre>\n<pre><span> 772:<\/span> objDocument.Writeln <span>\"End Function\"<\/span><\/pre>\n<pre><span> 773:<\/span> <span> calc progress bar and direction<\/span><\/pre>\n<pre><span> 774:<\/span> objDocument.Writeln \"Sub UpdateProgress()\"<\/pre>\n<pre><span> 775:<\/span> objDocument.Writeln \"Dim intStep\"<\/pre>\n<pre><span> 776:<\/span> objDocument.Writeln \"Dim intDirection\"<\/pre>\n<pre><span> 777:<\/span> objDocument.Writeln \"If (IsNull(objProgress.getAttribute(\"\"Step\"\")) = True) Then\"<\/pre>\n<pre><span> 778:<\/span> objDocument.Writeln \"intStep = 0\"<\/pre>\n<pre><span> 779:<\/span> objDocument.Writeln \"Else\"<\/pre>\n<pre><span> 780:<\/span> objDocument.Writeln \"intStep = objProgress.Step\"<\/pre>\n<pre><span> 781:<\/span> objDocument.Writeln \"End If\"<\/pre>\n<pre><span> 782:<\/span> objDocument.Writeln \"if (IsNull(objProgress.GetAttribute(\"\"Direction\"\"))=True) Then\"<\/pre>\n<pre><span> 783:<\/span> objDocument.Writeln \"intDirection = 0\"<\/pre>\n<pre><span> 784:<\/span> objDocument.Writeln \"Else\"<\/pre>\n<pre><span> 785:<\/span> objDocument.Writeln \"intDirection = objProgress.Direction\"<\/pre>\n<pre><span> 786:<\/span> objDocument.Writeln \"End If\"<\/pre>\n<pre><span> 787:<\/span> objDocument.Writeln \"if intDirection=0 then\"<\/pre>\n<pre><span> 788:<\/span> objDocument.Writeln \"intStep = intStep + 1\"<\/pre>\n<pre><span> 789:<\/span> objDocument.Writeln \"else\"<\/pre>\n<pre><span> 790:<\/span> objDocument.Writeln \"intStep = intStep - 1\"<\/pre>\n<pre><span> 791:<\/span> objDocument.Writeln \"end if\"<\/pre>\n<pre><span> 792:<\/span> objDocument.Writeln \"Call PctComplete(intStep)\"<\/pre>\n<pre><span> 793:<\/span> objDocument.Writeln \"if intStep>=23 then\"<\/pre>\n<pre><span> 794:<\/span> objDocument.Writeln \"intDirection=1\"<\/pre>\n<pre><span> 795:<\/span> objDocument.Writeln \"end if\"<\/pre>\n<pre><span> 796:<\/span> objDocument.Writeln \"if intStep< =0 then\"<\/pre>\n<pre><span> 797:<\/span> objDocument.Writeln \"intDirection=0\"<\/pre>\n<pre><span> 798:<\/span> objDocument.Writeln \"end if\"<\/pre>\n<pre><span> 799:<\/span> objDocument.Writeln \"objProgress.SetAttribute \"\"Step\"\", intStep\"<\/pre>\n<pre><span> 800:<\/span> objDocument.Writeln \"objProgress.SetAttribute \"\"Direction\"\", intDirection\"<\/pre>\n<pre><span> 801:<\/span> objDocument.Writeln \"Window.setTimeout GetRef(\"\"UpdateProgress\"\"), \" & conBarSpeed<\/pre>\n<pre><span> 802:<\/span> objDocument.Writeln \"End Sub\"<\/pre>\n<pre><span> 803:<\/span>  timeout function<\/pre>\n<pre><span> 804:<\/span> objDocument.Writeln <span>\"Sub DialogHardTimeout()\"<\/span><\/pre>\n<pre><span> 805:<\/span> <span>  objDocument.Writeln \"SetReturnFlag(\"\"quit\"\")\"<\/span><\/pre>\n<pre><span> 806:<\/span> objDocument.Writeln \"End sub\"<\/pre>\n<pre><span> 807:<\/span> objDocument.Writeln \"Sub Window_OnLoad()\"<\/pre>\n<pre><span> 808:<\/span> objDocument.Writeln \"theleft = (screen.availWidth - document.body.clientWidth) \/ 2\"<\/pre>\n<pre><span> 809:<\/span> objDocument.Writeln \"thetop = (screen.availHeight - document.body.clientHeight) \/ 2\"<\/pre>\n<pre><span> 810:<\/span> objDocument.Writeln \"window.moveTo theleft,thetop\"<\/pre>\n<pre><span> 811:<\/span> objDocument.Writeln \"Window.setTimeout GetRef(\"\"UpdateProgress\"\"), \" & conBarSpeed<\/pre>\n<pre><span> 812:<\/span> objDocument.Writeln \"Window.setTimeout GetRef(\"\"DialogHardTimeout\"\"), \" & conForcedTimeOut<\/pre>\n<pre><span> 813:<\/span> objDocument.Writeln \"End Sub\"<\/pre>\n<pre><span> 814:<\/span> objDocument.Writeln \"\"<\/pre>\n<pre><span> 815:<\/span> objDocument.Close<\/pre>\n<pre><span> 816:<\/span> End Sub<\/pre>\n<pre><span> 817:<\/span>?? <\/pre>\n<pre><span> 818:<\/span> Sub CleanUpAndQuit(RetCode)<\/pre>\n<pre><span> 819:<\/span> House Cleaning<\/pre>\n<pre><span> 820:<\/span>?? <\/pre>\n<pre><span> 821:<\/span> <span>if<\/span> not isObject(oLogfile) then<\/pre>\n<pre><span> 822:<\/span>   set oLogfile = nothing<\/pre>\n<pre><span> 823:<\/span> end <span>if<\/span><\/pre>\n<pre><span> 824:<\/span>?? <\/pre>\n<pre><span> 825:<\/span> <span>if<\/span> not (oLogfile <span>is<\/span> nothing) then<\/pre>\n<pre><span> 826:<\/span> <span>else<\/span><\/pre>\n<pre><span> 827:<\/span>   oLogFile.Close<\/pre>\n<pre><span> 828:<\/span>   set oLogfile = nothing<\/pre>\n<pre><span> 829:<\/span> end <span>if<\/span><\/pre>\n<pre><span> 830:<\/span>?? <\/pre>\n<pre><span> 831:<\/span> Set oFso = Nothing<\/pre>\n<pre><span> 832:<\/span> WScript.Quit(RetCode)<\/pre>\n<pre><span> 833:<\/span>?? <\/pre>\n<pre><span> 834:<\/span> End Sub<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p>??<\/p>\n<h4>DeDupeInstall.bat<\/h4>\n<div>\n<div>\n<pre><span>   1:<\/span> @echo off<\/pre>\n<pre><span>   2:<\/span> Cls<\/pre>\n<pre><span>   3:<\/span> echo.<\/pre>\n<pre><span>   4:<\/span> echo  Installing De-dupe Shell Extension and Its Support Tools<\/pre>\n<pre><span>   5:<\/span> echo =============================================================<\/pre>\n<pre><span>   6:<\/span> echo.<\/pre>\n<pre><span>   7:<\/span>?? <\/pre>\n<pre><span>   8:<\/span> echo   1. Copy md5sum.exe to %SystemRoot%\\system32\\<\/pre>\n<pre><span>   9:<\/span> copy md5sum.exe %SystemRoot%\\system32\\md5sum.exe<\/pre>\n<pre><span>  10:<\/span> echo.<\/pre>\n<pre><span>  11:<\/span>?? <\/pre>\n<pre><span>  12:<\/span> echo   2. Copy DedupeFilesInFolder.vbs to %SystemRoot%\\system32\\<\/pre>\n<pre><span>  13:<\/span> copy DedupeFilesInFolder.vbs %SystemRoot%\\system32\\DedupeFilesInFolder.vbs<\/pre>\n<pre><span>  14:<\/span> echo.<\/pre>\n<pre><span>  15:<\/span>?? <\/pre>\n<pre><span>  16:<\/span> echo   3.Register <span>\"DeDupe\"<\/span> Directory Shell Extension<\/pre>\n<pre><span>  17:<\/span> regedit \/s DedupeInstall.reg<\/pre>\n<pre><span>  18:<\/span> echo.<\/pre>\n<pre><span>  19:<\/span>?? <\/pre>\n<pre><span>  20:<\/span> echo   4. done... DeDupe Shell Extension Installed Successfully<\/pre>\n<pre><span>  21:<\/span> echo.<\/pre>\n<pre><span>  22:<\/span> echo.<\/pre>\n<pre><span>  23:<\/span> pause<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<h4>DeDupeInstall.reg<\/h4>\n<p><strong>Note<\/strong> the default registry value in HEX. This was necessary to be able to add the value:     <br \/>???<strong><em>wscript.exe %SystemRoot%\\system32\\DedupeFilesInFolder.vbs<\/em><\/strong>????? to the registry. Notice the <strong><em>%SystemRoot%<\/em><\/strong> environment variable? That needs to be expanded by windows, when you activate the shell extension. If you would create the value as <strong><em>Reg_SZ<\/em><\/strong> string, it would not work. <\/p>\n<p>It needs to be an expandable string (because it will be expanded at runtime), <strong><em>REG_Expand_SZ<\/em><\/strong>. Expandable string values can only be created by the registry import, if you provide the value of a string in hexadecimal format. This tells Windows to create <strong><em>REG_EXPAND_SZ<\/em><\/strong> value instead of the basic <strong><em>REG_SZ<\/em><\/strong>.After each character follows the hex value <strong><em>00<\/em><\/strong> and at the end two more <strong><em>00<\/em><\/strong> are added as well. Why this is necessary, I have no idea, but this is how you have to do it.<\/p>\n<div>\n<div>\n<pre><span>   1:<\/span> Windows Registry Editor Version 5.00<\/pre>\n<pre><span>   2:<\/span>?? <\/pre>\n<pre><span>   3:<\/span> [HKEY_CLASSES_ROOT\\Directory\\shell\\DeDupe]<\/pre>\n<pre><span>   4:<\/span> @=<span>\"DeDupe\"<\/span><\/pre>\n<pre><span>   5:<\/span>?? <\/pre>\n<pre><span>   6:<\/span> [HKEY_CLASSES_ROOT\\Directory\\shell\\DeDupe\\command]<\/pre>\n<pre><span>   7:<\/span> @=hex(2):77,00,73,00,63,00,72,00,69,00,70,00,74,00,2E,00,65,00,78,00,65,00,20,\\<\/pre>\n<pre><span>   8:<\/span>   00,25,00,53,00,79,00,73,00,74,00,65,00,6D,00,52,00,6F,00,6F,00,74,00,25,00,\\<\/pre>\n<pre><span>   9:<\/span>   5C,00,73,00,79,00,73,00,74,00,65,00,6D,00,33,00,32,00,5C,00,44,00,65,00,64,\\<\/pre>\n<pre><span>  10:<\/span>   00,75,00,70,00,65,00,46,00,69,00,6C,00,65,00,73,00,49,00,6E,00,46,00,6F,00,\\<\/pre>\n<pre><span>  11:<\/span>   6C,00,64,00,65,00,72,00,2E,00,76,00,62,00,73,00,00,00<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<h4>DeDupeUnInstall.bat<\/h4>\n<div>\n<div>\n<pre><span>   1:<\/span> @echo off<\/pre>\n<pre><span>   2:<\/span> CLS<\/pre>\n<pre><span>   3:<\/span> echo.<\/pre>\n<pre><span>   4:<\/span> echo  Un-Installing De-dupe Shell Extension and Its Support Tools<\/pre>\n<pre><span>   5:<\/span> echo =============================================================<\/pre>\n<pre><span>   6:<\/span> echo.<\/pre>\n<pre><span>   7:<\/span>?? <\/pre>\n<pre><span>   8:<\/span> echo   1. Delete md5sum.exe from %SystemRoot%\\system32\\<\/pre>\n<pre><span>   9:<\/span> <span>if<\/span> EXIST %SystemRoot%\\system32\\md5sum.exe del \/Q \/F <span>\"%SystemRoot%\\system32\\md5sum.exe\"<\/span><\/pre>\n<pre><span>  10:<\/span> echo.<\/pre>\n<pre><span>  11:<\/span>?? <\/pre>\n<pre><span>  12:<\/span> echo   2. Delete DedupeFilesInFolder.vbs from %SystemRoot%\\system32\\<\/pre>\n<pre><span>  13:<\/span> <span>if<\/span> EXIST %SystemRoot%\\system32\\DedupeFilesInFolder.vbs del \/Q \/F <\/pre>\n<pre><span>  14:<\/span>          <span>\"%SystemRoot%\\system32\\DedupeFilesInFolder.vbs\"<\/span><\/pre>\n<pre><span>  15:<\/span> echo.<\/pre>\n<pre><span>  16:<\/span>?? <\/pre>\n<pre><span>  17:<\/span> echo   3. Unregister <span>\"DeDupe\"<\/span> Directory Shell Extension <\/pre>\n<pre><span>  18:<\/span> regedit \/s DedupeUnInstall.reg<\/pre>\n<pre><span>  19:<\/span> echo.<\/pre>\n<pre><span>  20:<\/span>?? <\/pre>\n<pre><span>  21:<\/span> echo   4. done... DeDupe was Uninstalled Successfully<\/pre>\n<pre><span>  22:<\/span> echo.<\/pre>\n<pre><span>  23:<\/span> echo.<\/pre>\n<pre><span>  24:<\/span> pause<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<h4>DedupeUnInstall.reg<\/h4>\n<div>\n<div>\n<pre><span>   1:<\/span> Windows Registry Editor Version 5.00<\/pre>\n<pre><span>   2:<\/span>?? <\/pre>\n<pre><span>   3:<\/span> [-HKEY_CLASSES_ROOT\\Directory\\shell\\DeDupe]<\/pre>\n<pre><span>   4:<\/span> @=<span>\"DeDupe\"<\/span><\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p>This is another tool created by Carsten Cumbrowski aka Roy\/SAC and I hope that you will find this one helpful as well. For comments, praise or complaints, please use the comments section of the blog below. Thanks.<\/p>\n<p>Cheers!<\/p>\n<p>Carsten aka Roy\/SAC<\/p>\n<\/p>\n<\/li>\n","protected":false},"excerpt":{"rendered":"<p>You can skip the background story about the why, when and how I decided to write this little File De-Duping script, if you are not interested in it and jump right the section about how the script works, what it does, where to download it, how to install and de-install it and the source code [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-94","post","type-post","status-publish","format-standard","hentry","category-tools"],"_links":{"self":[{"href":"http:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/comments?post=94"}],"version-history":[{"count":4,"href":"http:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":643,"href":"http:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/posts\/94\/revisions\/643"}],"wp:attachment":[{"href":"http:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}