Main Area and Open Discussion > General Software Discussion
Dumb question but maybe somebody knows how. Probably a form of Sync.
Stoic Joker:
One of my techs has one of these: C2G 30504 33in USB 2.0 to IDE/Serial ATA Drive Adapter Cable
It has proven to be about twice as handy as it looks...and it looks pretty handy to start with.. ;)
questorfla:
What I DO have is a 2.5" IDE enclosure that I might be able to modify for a 3.5" drive.
On my side a tool that I NEVER believed I would ever use is my WORMHOLE switch from by j5create. It sat sealed up for probably 2 months before I ever even tried it.
Claimed to have 5 GBPS data transfer rate and don't have to install anything other than the drivers that are built into the ends od the cable The first time I used it I swear I thought it was some kind of trick. Fastest file transfer I have ever seen: Even drive to drive transfer! Won't be without one again!
REQUESTS from all of you who have been so helpful on this:
I have been looking for the fix to the issue that 4WD caught with the "quote marks" and I am sure I have seen one somewhere. it is a patch or setting or something that makes ALL Quotes be the RIGHT quotes for someone who works on scripts not for people typing letters. I am not sure but it may be a windows thing where you tell it not to use "smart-quotes" anywhere. I never want to have to deal with the DUMB QUOTES again. That was too much. :-[
I also need ways to modify the specs on this nifty "junk cleaner" script. What is the right way to tell it to look for all files ending in (for example) .tmp"???"
For this type of Archive I would love to search for/review/(and probably delete) all the ".exe" or ".com" files. I have found during my transfers that there are quite a few and some are being scanned and removed by MalwareBytes or AVAST anyway. OLD viruses and Malware that were, at the time, not in the database but are now.
And there are other extensions that if could find them ALL just like I am finding the zero length files and have the option of removing them ALL Or I could change the first echo command to "xcopy" so I could copy them to elsewhere before I ran the DEL version to get rid of them.
If I had been doing these from the start I hate to think how many junk files I now have in my nice clean 5TB Complete Documents Archive.
I need to come up with list of "JUNK" like that and create a statement to cover each. Another is those files created by WORD with the " ~ " as the first character to be a "ghost" copy of the file you are working on.
Honestly, I have seen some where it looks like the people copied everything on their hard drive including the entire Windows folder plus ProgramfilesX86 etc. (Not many Thank God).
The purpose of this whole effort is to create a massive database of every DOCUMENT type doesn't matter who wrote it. I don't want to get too specific but almost anything that isn't a document is not even supposed to be here. I have been making good use of a program called "Everything" from the people at "Voidtools" as it is the absolute fastest "search and find" utility I have ever seen. Finding all the ".exe" and removing them.
Still, I like the current scripted setup more because it allows me to have a list of all the files I moved or got rid of and what I did with ( to ) them. ;)
Thanks for all the input this has been an extremely helpful thread. :Thmbsup:
4wd:
I would have thought that the type of files you want to keep would be a much shorter list than the type of files you want to remove.
But if you want to check on file extension just use that for the comparison instead of file size, eg.
"%%~xF"==".tmp"
IIRC, the ~ Word files all have an extension of .tmp so will be picked up using extension comparison providing you've also searched for hidden files.
Shades:
--- Code: Text ---@echo off echo @ECHO OFF>> zerobytefilesremover.bat for /r %%F in (*) do (if %%~zF==0 echo DEL /F /Q "%%F">> zerobytefilesremover.bat ) else ( if %%~zF==".tmp" echo DEL /F /Q "%%F">> tempfilesremover.bat ) else ( <fill in other arguments/conditions if you like> )
IF...ELSE... structure is allowed in batch script. But it makes the execution of it (a lot) slower. Just make sure that when you use the () characters in a script, you terminate each condition properly with a ). Decent text editors light these characters up when a set is terminated properly...so if you select one such character and it doesn't light up, you have to investigate your code. Although this lighting up is a great help, it won't save you from all possible error scenarios with the use of () characters.
But that is something you learn best the hard way... ;)
Code indentation is your friend. It makes working with IF...ELSE... structures easier.
Another word to the wise, don't start the holy war between the use of spaces or tabs for indentation back up... :D
4wd:
if %%~zF==".tmp" echo DEL /F /Q "%%F">> tempfilesremover.bat-Shades (June 08, 2015, 09:21 PM)
--- End quote ---
Should be %%~xF ;)
ScaryCmdFile.cmd:
--- Code: Text ---@echo offrem ScaryCmdFile.cmd <path>remrem eg. ScaryCmdFile.cmd U:\silly\files rem Extensions to eliminate besides 0 byte files, just add them to the line below separated by arem semi-colonrem LINE HAS TO END WITH SEMI-COLONset ext=.tmp;.exe;.com;.bak; for /r "%~1" %%F in (*) do ( if %%~zF==0 echo DEL /F /Q "%%F">> zerobytefilesremover.bat echo.%ext% | findstr /C:"%%~xF;">nul && echo del /f /q "%%F">> naughtyextensionfileremover.bat )
Doesn't do the hidden temporary Word files naturally but that should just be a matter of dir /b /s /a+h "~*.*" > TempWordFiles.txt to get a list.
You could also turn ScaryCmdFile.cmd into SaveOurFiles.cmd by just specifying what extensions you want to keep and changing the last del /f /q to xcopy/robocopy/etc.
eg.
SaveOurFiles.cmd:
--- Code: Text ---@echo offrem SaveOurFiles.cmd <path>remrem eg. SaveOurFiles.cmd U:\silly\files rem Extensions to keep, just add them to the line below separated by a semi-colonrem Still removes 0 byte filesrem LINE HAS TO END WITH SEMI-COLONset ext=.doc;.jpg;.xls; for /r "%~1" %%F in (*) do ( if %%~zF==0 echo DEL /F /Q "%%F">> zerobytefilesremover.bat echo.%ext% | findstr /C:"%%~xF;">nul && echo xcopy "%%F" c:\savedfiles\ >> filessavedfromextinction.bat )
NOTE: I've only tested the ScaryCmdFile.cmd.
Another word to the wise, don't start the holy war between the use of spaces or tabs for indentation back up... :D-Shades (June 08, 2015, 09:21 PM)
--- End quote ---
TABs?! We don't need no steenkin' TABs!!
Navigation
[0] Message Index
[*] Previous page
Go to full version