CGRemakes Posted January 31, 2011 Share Posted January 31, 2011 (edited) Great little tool! I'm unable to get it to work verifying by date. It simply crashes, and exits with a code -1073741819. I tried compiling it, but failed as well. I'm using AutoIT v3.3.6.1. I also can't figure out how to make copy right if the source is a file. It looks like you at least partially accounted for that, but it doesn't work quite right. EDIT: @nitekram, it looks like you already figured out a fix for the verify by date bug? Where did you stick the check(s)? Mind posting the syntax? Edited January 31, 2011 by CGRemakes Link to comment Share on other sites More sharing options...
llewxam Posted January 31, 2011 Author Share Posted January 31, 2011 I appreciate hearing that you like it, I just finished a couple of large projects and will be able to get back on this in the next couple of days. There are a couple of bugs that I mean to correct, and who knows, maybe I'll find something to add!! Ian My projects: IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged. INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them. PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses. Sync Tool - Folder sync tool with lots of real time information and several checking methods. USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions. Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent. CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction. MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app. 2048 Game - My version of 2048, fun tile game. Juice Lab - Ecigarette liquid making calculator. Data Protector - Secure notes to save sensitive information. VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive. Find in File - Searches files containing a specified phrase. Link to comment Share on other sites More sharing options...
CGRemakes Posted January 31, 2011 Share Posted January 31, 2011 Sounds good. 1 feature that I would like to see, and I think would qualify this program as more of a true "sync" program is that if the file has been deleted from the source, but exists on the destination, it should be deleted from the destination. Right now, it's more of just a mass-copier program than a sync program. Link to comment Share on other sites More sharing options...
llewxam Posted February 2, 2011 Author Share Posted February 2, 2011 Okeedoke, I have corrected the Sync by Date options, OMG what was I thinking??!????!?!?! I guess I didn't test that code AT ALL and that was a real bear to figure out how to do properly!!!! The examples in the Help docs were rough to figure out, and I don't think I made it harder on myself than I had to but of course if anyone can suggest a better (simpler) way then I am all ears! I also threw in a quick "Mirror" mode like Robocopy /MIR, as requested. Beside that, not a lot of changes were made. Code in first post has been updated, please let me know any issues/suggestions! Ian My projects: IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged. INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them. PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses. Sync Tool - Folder sync tool with lots of real time information and several checking methods. USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions. Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent. CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction. MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app. 2048 Game - My version of 2048, fun tile game. Juice Lab - Ecigarette liquid making calculator. Data Protector - Secure notes to save sensitive information. VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive. Find in File - Searches files containing a specified phrase. Link to comment Share on other sites More sharing options...
CGRemakes Posted February 2, 2011 Share Posted February 2, 2011 (edited) The mirror doesn't work, and looking at the code, I see why: If Not FileExists($source & "\" & $file) Then If StringInStr(FileGetAttrib($source & "\" & $file), "D") > 0 Then DirRemove($source & "\" & $file, 1) Else FileDelete($source & "\" & $file) EndIf EndIf It checks to see if the file exists on the source, then attempts to delete it from the source if it doesn't (which is both impossible and undesirable). Changing it to the following works better: ;~ mirror option check If GUICtrlRead($yesMirror) == 1 Then $destinationList = _FileListToArrayXT($put, Default, 1, 2, True) For $a = 1 To $destinationList[0] Step 2 $file = StringTrimLeft($destinationList[$a], StringLen($put)) If Not FileExists($source & "\" & $file) Then If StringInStr(FileGetAttrib($destinationList[$a]), "D") > 0 Then DirRemove($destinationList[$a], 1) Else FileDelete($destinationList[$a]) EndIf EndIf Next EndIf ;~ done... As far as doing the date, would a combination of FileGetTime and _DateDiff be a better approach? Edited February 2, 2011 by CGRemakes Link to comment Share on other sites More sharing options...
llewxam Posted February 3, 2011 Author Share Posted February 3, 2011 Thanks to Danny35d for catching a goof, first post updated with Mirror error fixed! Ian My projects: IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged. INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them. PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses. Sync Tool - Folder sync tool with lots of real time information and several checking methods. USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions. Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent. CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction. MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app. 2048 Game - My version of 2048, fun tile game. Juice Lab - Ecigarette liquid making calculator. Data Protector - Secure notes to save sensitive information. VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive. Find in File - Searches files containing a specified phrase. Link to comment Share on other sites More sharing options...
t0nZ Posted June 16, 2011 Share Posted June 16, 2011 This syncing script simply rocks ! I have executed some benchmarks versus Microsoft Synctoy, and your program is faaaster !! Over lan I tested with folders containing 30000+ images, and it's 5x faster . Now i think to include your code in a program that I use from two years, that now uses brute copy functions that simply overwrites older file, but this isn't much efficient. I 'll adapt your script to act like a sort of UDF. My advice is : make an UDF !! for autoit sync capabilities are important I think ! Greetings and keep up the great work. Link to comment Share on other sites More sharing options...
llewxam Posted June 17, 2011 Author Share Posted June 17, 2011 This syncing script simply rocks !I have executed some benchmarks versus Microsoft Synctoy, and your program is faaaster !!Over lan I tested with folders containing 30000+ images, and it's 5x faster .Now i think to include your code in a program that I use from two years, that now uses brute copy functions that simply overwrites older file, but this isn't much efficient.I 'll adapt your script to act like a sort of UDF.My advice is : make an UDF !! for autoit sync capabilities are important I think !Greetings and keep up the great work.Very nice words, thanks! BUT, I can't take the credit for the speed that the files copy at! For that you would need to credit wraithdu for _LargeFileCopy, which I do credit in the code. That code handles lots of small files extremely well, though the standard Windows copy will handle very large files faster. It seems that using the WinAPI calls has lower overhead than other copying methods.So again, thanks for the kind words but we all need to thank wraithdu for his work as well! IanPS - this is LONG overdue to have some changes made! Maybe sometime soon I can get to it..... My projects: IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged. INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them. PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses. Sync Tool - Folder sync tool with lots of real time information and several checking methods. USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions. Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent. CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction. MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app. 2048 Game - My version of 2048, fun tile game. Juice Lab - Ecigarette liquid making calculator. Data Protector - Secure notes to save sensitive information. VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive. Find in File - Searches files containing a specified phrase. Link to comment Share on other sites More sharing options...
darthwhatever Posted July 28, 2011 Share Posted July 28, 2011 (edited) wow this script is really cool do you think it would be possible to make this a kind of automated script.. have it run off a command line or an ini file or something? e.g. If $cmdline[0] > 0 Then For $i = 1 To $cmdline[0] If $cmdline[$i] = 'sync' Then $iHideGUI = True ;don't need the GUI, we already know the source and dest $copySource = $cmdline[$i + 1] $copyDestination = $cmdline[$i + 2] ExitLoop EndIf NextEndIf edit:typo Edited July 28, 2011 by darthwhatever [font=arial, sans-serif]How is education supposed to make me feel smarter? Besides, every time I learn something new, it pushes some old stuff out of my brain. Remember when I took that home winemaking course, and I forgot how to drive?[/font][font=arial, sans-serif]<div>This is how you annoy a web developer.</span>[/font] Link to comment Share on other sites More sharing options...
llewxam Posted July 29, 2011 Author Share Posted July 29, 2011 wow this script is really cool do you think it would be possible to make this a kind of automated script.. have it run off a command line or an ini file or something? e.g. If $cmdline[0] > 0 Then For $i = 1 To $cmdline[0] If $cmdline[$i] = 'sync' Then $iHideGUI = True ;don't need the GUI, we already know the source and dest $copySource = $cmdline[$i + 1] $copyDestination = $cmdline[$i + 2] ExitLoop EndIf NextEndIf edit:typo That is something I had in Sync V2, but never implemented it in 3. I would like to, so will add it to my mental to-do list. However, be warned - my mental capability for remembering is about as good as one of those.....whatchacallits.....what are they called?....errrrr, what were we talking about?? Seriously, this app is something I use ALL THE TIME and have other items I want to add/change, but have too many other projects going on right now. As soon as possible though, this will be the first script I pick back up! Thanks Ian My projects: IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged. INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them. PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses. Sync Tool - Folder sync tool with lots of real time information and several checking methods. USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions. Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent. CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction. MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app. 2048 Game - My version of 2048, fun tile game. Juice Lab - Ecigarette liquid making calculator. Data Protector - Secure notes to save sensitive information. VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive. Find in File - Searches files containing a specified phrase. Link to comment Share on other sites More sharing options...
llewxam Posted September 4, 2011 Author Share Posted September 4, 2011 (edited) After some good feature requests, lots of rewriting, and forcing myself to live with the app for a week after I "finished" it in order to have enough time to correct any issues, I am ready to release the latest build of the Sync tool. Pretty few new features, but they include:Full Command Line configuration to make automation easy (thanks darthwhatever)Optional file Create, Modify, and Access timestamp preservationRevised Mirror method that assures proper function even when used in conjunction with the "Delete After Sync" optionThe only persisting annoyance is with the Mirror function though, it is SLOW when dealing with a lot of files. In order to be able to delete extraneous files and folders from the Destination location AFTER potentially deleting the Source files is an array comparison, and in my test of backing up my entire NAS to my backup server, using the Verify by Exist method 139,000 files were verified in only 5 minutes, but the Mirror took almost 6 hours! Of course that is a slow PC dealing with FileExist 139,000 times over a gigabit LAN, far from an ideal situation, but never the less it shows that if you want to use that feature, you will need patience! And the only reason it has to be done this way is because I can't do something simple like a DirRemove on the Source after the sync has finished in case anything did not copy properly. I have other ideas that would be much quicker, but honestly don't expect this feature to be one of the more commonly used ones, so I am putting further work on it aside for now. Please follow the links provided at the top of the script for required UDFs. And as always, any questions or suggestions please let me know!Ian Edited September 4, 2011 by llewxam My projects: IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged. INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them. PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses. Sync Tool - Folder sync tool with lots of real time information and several checking methods. USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions. Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent. CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction. MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app. 2048 Game - My version of 2048, fun tile game. Juice Lab - Ecigarette liquid making calculator. Data Protector - Secure notes to save sensitive information. VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive. Find in File - Searches files containing a specified phrase. Link to comment Share on other sites More sharing options...
BrewManNH Posted September 4, 2011 Share Posted September 4, 2011 Instead of using FileExists for every file couldn't you just put the 2 file lists into an array and search the arrays against each other? That way you're only going over the LAN connection to get the list once, and then doing the comparisons locally. Something like Melba's RecFileListToArray would be handy to get the 2 listings. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
llewxam Posted September 4, 2011 Author Share Posted September 4, 2011 (edited) Instead of using FileExists for every file couldn't you just put the 2 file lists into an array and search the arrays against each other? That way you're only going over the LAN connection to get the list once, and then doing the comparisons locally. Something like Melba's RecFileListToArray would be handy to get the 2 listings.That is what I have done, but that is also the problem - _ArraySearch is kinda slow, so when the file count is high, the arrays get huge and the searches begin to take a long time. For a large folder of even 10,000 items it isn't that bad, but back up a whole drive, or whole shared folder on a server, and it gets nasty. My code builds a new array of the Destination, then compares that array to the original array from the Source, after a bit of trimming. See lines 425-453 Ian Edited September 4, 2011 by llewxam My projects: IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged. INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them. PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses. Sync Tool - Folder sync tool with lots of real time information and several checking methods. USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions. Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent. CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction. MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app. 2048 Game - My version of 2048, fun tile game. Juice Lab - Ecigarette liquid making calculator. Data Protector - Secure notes to save sensitive information. VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive. Find in File - Searches files containing a specified phrase. Link to comment Share on other sites More sharing options...
BrewManNH Posted September 4, 2011 Share Posted September 4, 2011 If your array is a 1D array, you could sort the array and use _ArrayBinarySearch which is a LOT faster to find items in a large array. If it's a 2D array, you could use the _Array.au3 file (Linked in my signature) which has a 1D and 2D version of _ArrayBinarySearch which can do the same thing. The difference in speed between the 2 searches is amazing once the array has been sorted. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
llewxam Posted September 4, 2011 Author Share Posted September 4, 2011 (edited) I followed BrewManNh's advice and did an _ArraySort, then used _ArrayBinarySearch - no doubt an impressive speed improvement for such a simple change!! Thank you BrewManNH!! Other suggestions/ideas please share! Ian (updated first link with the new version) Edited September 5, 2011 by llewxam My projects: IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged. INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them. PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses. Sync Tool - Folder sync tool with lots of real time information and several checking methods. USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions. Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent. CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction. MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app. 2048 Game - My version of 2048, fun tile game. Juice Lab - Ecigarette liquid making calculator. Data Protector - Secure notes to save sensitive information. VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive. Find in File - Searches files containing a specified phrase. Link to comment Share on other sites More sharing options...
llewxam Posted November 12, 2011 Author Share Posted November 12, 2011 Updated code in first post, the paths are now all converted to UNC internally to avoid failures when path lengths exceed 260 characters. This isn't an issue I face at home, probably the same with many of you, but I do encounter it a lot at work when doing data backups and moving that data around to and from fileservers. Enjoy Ian My projects: IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged. INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them. PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses. Sync Tool - Folder sync tool with lots of real time information and several checking methods. USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions. Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent. CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction. MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app. 2048 Game - My version of 2048, fun tile game. Juice Lab - Ecigarette liquid making calculator. Data Protector - Secure notes to save sensitive information. VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive. Find in File - Searches files containing a specified phrase. Link to comment Share on other sites More sharing options...
storme Posted November 13, 2011 Share Posted November 13, 2011 I've been using SYNC for a while and it's replaced robocopy for me. (well except for one thing - Below) The big problem I get is when I'm running from a Win environment on one of the diagnostic CDs I have here it crashes because it can't find GDI. I guess you are using it for progress bars or something but it stops the script dead. Then I have to resort to cut and paste....primitive LOL The other enhancement I'd love to see is the ability to add exclusions (and inclusions) if possible. I was thinking a comma separated list (so it can be used from command line. The WHY of it.... I use sync to copy the entire hard drive of a customers computer to a USB hard drive then back to there system "c:_old_computer" after a rebuild. Believe me its saved a lot of trouble over the years when customers put "stuff" in weird places then insist that I should have known it was there to restore. With Robocopy I set up a list of folders and files that I didn't want to copy and it would ignore them. eg *Temporary Internet Files *Temporary Internet Files* *Local SettingsTemp hiberfil.sys pagefile.sys I haven't had a look at your code but I wouldn't think it would be that hard to add using regex. Pretty please Anyway keep up the great work! Thanks John Morrison Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E Link to comment Share on other sites More sharing options...
llewxam Posted November 13, 2011 Author Share Posted November 13, 2011 I've been using SYNC for a while and it's replaced robocopy for me. (well except for one thing - Below)The big problem I get is when I'm running from a Win environment on one of the diagnostic CDs I have here it crashes because it can't find GDI. I guess you are using it for progress bars or something but it stops the script dead. Then I have to resort to cut and paste....primitive LOLThe other enhancement I'd love to see is the ability to add exclusions (and inclusions) if possible.I was thinking a comma separated list (so it can be used from command line.The WHY of it....I use sync to copy the entire hard drive of a customers computer to a USB hard drive then back to there system "c:_old_computer" after a rebuild. Believe me its saved a lot of trouble over the years when customers put "stuff" in weird places then insist that I should have known it was there to restore. With Robocopy I set up a list of folders and files that I didn't want to copy and it would ignore them.eg*Temporary Internet Files*Temporary Internet Files**Local SettingsTemphiberfil.syspagefile.sysI haven't had a look at your code but I wouldn't think it would be that hard to add using regex. Pretty please Anyway keep up the great work! ThanksJohn MorrisonThe exclusion would be very simple, all I would have to do is replace my chopped-up _FileListToArrayXT with the original and then add the variable. I'll think on it As for the GDI problem, I'm lost on that one. What environment are you in when that happens? If it was in a PE I would maybe understand, I don't know if PE 2 supports GDI but I would think 3 does. But I have used Sync on opticals before with no issue.... Do me a favor and reproduce your problem with the uncompiled code and see what kind of error comes up, then I might have a path to fixing it.ThanksIan My projects: IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged. INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them. PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses. Sync Tool - Folder sync tool with lots of real time information and several checking methods. USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions. Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent. CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction. MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app. 2048 Game - My version of 2048, fun tile game. Juice Lab - Ecigarette liquid making calculator. Data Protector - Secure notes to save sensitive information. VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive. Find in File - Searches files containing a specified phrase. Link to comment Share on other sites More sharing options...
BrewManNH Posted November 14, 2011 Share Posted November 14, 2011 I'm not sure how much it affects speed in your script, but changing this code: Func _CompareFileTimeEx($hSource, $hDestination, $iMethod) ;Parameters ....: $hSource - Full path to the first file ; $hDestination - Full path to the second file ; $iMethod - 0 The date and time the file was modified ; 1 The date and time the file was created ; 2 The date and time the file was accessed ;Return values .: -1 The Source file time is earlier than the Destination file time ; 0 The Source file time is equal to the Destination file time ; 1 The Source file time is later than the Destination file time ;Author ........: Ian Maxwell (llewxam @ AutoIt forum) $aSource = FileGetTime($hSource, $iMethod, 0) $aDestination = FileGetTime($hDestination, $iMethod, 0) For $a = 0 To 5 If $aSource[$a] <> $aDestination[$a] Then If $aSource[$a] < $aDestination[$a] Then Return -1 Else Return 1 EndIf EndIf Next Return 0 EndFunc ;==>_CompareFileTimeEx To something like the code below might speed things up a small amount because you're comparing them in a more straight-forward manner. Func _CompareFileTimeEx($hSource, $hDestination, $iMethod) ;Parameters ....: $hSource - Full path to the first file ; $hDestination - Full path to the second file ; $iMethod - 0 The date and time the file was modified ; 1 The date and time the file was created ; 2 The date and time the file was accessed ;Return values .: -1 The Source file time is earlier than the Destination file time ; 0 The Source file time is equal to the Destination file time ; 1 The Source file time is later than the Destination file time ;Author ........: Ian Maxwell (llewxam @ AutoIt forum) $aSource = FileGetTime($hSource, $iMethod, 0, 1) $aDestination = FileGetTime($hDestination, $iMethod, 0, 1) If $aSource < $aDestination Then Return -1 ElseIf $aSource > $aDestination Return 1 Else Return 0 EndIf EndFunc ;==>_CompareFileTimeEx ;~ For $a = 0 To 5 ;~ If $aSource[$a] <> $aDestination[$a] Then ;~ If $aSource[$a] < $aDestination[$a] Then ;~ Return -1 ;~ Else ;~ Return 1 ;~ EndIf ;~ EndIf ;~ Next This is doing a string comparison on the whole date at the same time, rather than separating each piece of the date into an array, then comparing each chunk of it to another chunk of an array. On a large list of files it might be faster. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
llewxam Posted November 14, 2011 Author Share Posted November 14, 2011 Hmm, interesting, I didn't think of that! I overcomplicated it......... Thanks! Ian My projects: IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged. INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them. PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses. Sync Tool - Folder sync tool with lots of real time information and several checking methods. USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions. Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent. CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction. MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app. 2048 Game - My version of 2048, fun tile game. Juice Lab - Ecigarette liquid making calculator. Data Protector - Secure notes to save sensitive information. VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive. Find in File - Searches files containing a specified phrase. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now