topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday June 30, 2025, 1:59 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Recent Posts

Pages: prev1 ... 120 121 122 123 124 [125] 126 127 128 129 130 ... 225next
3101
Living Room / Re: Movies or films you've seen lately
« Last post by 4wd on June 06, 2013, 07:27 AM »
Watched The Millennium Bug a couple of nights ago - fun movie, kind of like a cross between The Evil Dead, The Hills Have Eyes, Wrong Turn, (or any of the prevalent hillbilly films), with a dose of Crawmerax thrown in for good measure.  ;D

the millenium bug.jpg
3102
Finished Programs / Re: DONE: Sync folders by renaming files
« Last post by 4wd on June 06, 2013, 06:50 AM »
Probably the final version.

V9 Added choice between matching Date and Time or matching SHA-1 hash, requires FCIV mentioned above for SHA-1, (it will always match size obviously).
    Changed log output to name the Undo file for each run and match criteria.

eg.
---------------------------
Thu 06/06/2013  21:36:13.35
Matching: SHA-1 hash
Undo file: Undo-20130606213613.cmd
---------------------------
Renamed: "fdv s fds 89ds fdg fd78g 6.jpg" To: "[email protected]"
---------------------------
Thu 06/06/2013  21:36:55.53
Matching: Date and Time
Undo file: Undo-20130606213655.cmd
---------------------------
Renamed files: 0

If it says Renamed files: 0 then there won't be an Undo cmd file even though it lists one.

Broken the 3kB barrier, I suppose I could put in checking for the existence of fciv.exe in the path but maybe someone else wants to do it.

Addendum: Found a fault with v9 - still requires Delayed Expansion for doing the hash values.  I'm going to write a small SHA-1 program to avoid the for loop that causes this problem.  See v9.5 here.
3103
Living Room / Re: DOS Attacks
« Last post by 4wd on June 06, 2013, 02:25 AM »
Looked at the subject and thought, "Does anyone still use DOS for virii?", or that one of my batch files had gone berserk  :P
3104
Finished Programs / Re: DONE: Sync folders by renaming files
« Last post by 4wd on June 05, 2013, 11:34 PM »
choice /c ny /m "View logfile"
is supposed to ask me if i want to view the log, it still doesn't. it echos a "goto" in the CMD window and then closes.

I modified v7 to add the quotes around everything referring to the log file - I normally avoid spaces in folder/file names so I rarely have this problem.

And the line before the choice command now refers to the full path for the log, (which I forgot).

Two minutes might sound like a fair chunk of time, but how long is it going to take you to recreate the photos? - or, if nothing has been lost, just the time spent sorting out the mess? :)

I think the problem with this method regarding photos, is that the EXIF data can vary even between two photos taken at the same time, (ISO speed, etc), which throws off the checksum - if you could checksum just the image data, ignoring any EXIF/extras then it's certainly a viable option.

There's a example on stackoverflow of doing it using python, I might have a play and see what kind of mess I can come up with for a batch file :)

But you have a very valid point about the mucking up of names, even though a file can't be overwritten, (internal DOS ren command just fails) - so you won't lose files.

V8 Generates Undo cmd files in the form of Undo-YYYYMMDDHHMMSS.cmd in the batch file folder.

eg. Here's the log:

---------------------------
Thu 06/06/2013  14:57:24.40
---------------------------
Renamed: "fdv s fds 89ds fdg fd78g 6.jpg" To: "[email protected]"
 

Here's the Undo file, (Undo-20130606145946.cmd):
ren "U:\test\3 8\[email protected]" "fdv s fds 89ds fdg fd78g 6.jpg"

BTW, I'm just adding the latest version to my last posts and leaving the others there in case someone wants some earlier version to valmorphanize into something else.  If that's a problem, let me know and I'll delete all the previous.
3105
Living Room / Re: digitising slides
« Last post by 4wd on June 05, 2013, 10:22 PM »
could be worth looking into firmware 'hacks', though I'm wary of bricking a device :o

In the case of CHDK, firmware is probably a misnomer - it's more like an alternative OS that takes over at hardware level but only as long as the SD card containing it is in the camera and you have initialised it by holding down a button while turning the camera on.

ie. It's a purely temporary thing, there's no way you can brick the camera.

Normally cameras are unable to be real firmware updated after they have left the factory without pulling them apart to get to the JTAG connector, (if they even have one).
EDIT: But it appears Panasonic/Sony do offer updates - learn something everyday - I think I'll shutup now  :-[

Flatbeds aren't generally built to do this kind of work - you need plenty of light on the back of the film/slide and they just don't work that way

Correct, you need transmissive light not reflective.

My flatbed, (Canon D660U), is capable of slides/negatives, it has a CCFL built into the lid that you uncover when you put it into slide mode and it works reasonably well.

However, 2 points:
1) it's abominably slow, (about 2min per slide at a minimum of 600DPI), and
2) because the slide/neg sits in a holder this results in the actual surface of the slide/neg sitting above the glass bed by about 3mm.  The scanner is naturally focused at things lying flat on the glass, ie. the focus is a bit off.
The results were always a bit "softer" than those taken with the flash scanner, they use a CMOS imaging device that is focused at the surface of the slide/negative.

A third reason is that Canon never released drivers for anything later than XP, (or was it Vista?)  :mad:

Unless you're willing to spend a bit more money on a Plustek, (IIRC), or Epson slide scanner, I'd say that the flash type scanners are a good compromise between quality, speed and price.

As long as you don't print the resultant scans on anything bigger than standard photo size, (10cm x 15cm or 12.5cm x 17.5).
3106
General Software Discussion / Re: Samsung device drivers failed to installed
« Last post by 4wd on June 05, 2013, 11:12 AM »
Unless you have some pressing need to use the Kies software, completely uninstall it using RevoUninstaller or similar and then just choose the USB storage option when you plug the phone in.

I used it for all of 3 minutes, then I rooted the Samsung phone I had which gave the added benefit of not allowing Kies to work.
3107
Living Room / Re: Looking for a launcher
« Last post by 4wd on June 05, 2013, 11:03 AM »
That or Everything. It supports regex. But it only works with local NTSF formatted drives. It doesn't do FAT32 or remote disks.

Guess again :)


New features in the beta:
Search Syntax
ETP/FTP Server
HTTP Server
Folder Indexing for indexing network shares and FAT32 volumes
Search History
Everything Service for running Everything with a normal user account
EFU File Lists for indexing USB drives, network shares, DVDRoms etc..

Get it here.

I have it remotely index my WHS machine once a day, (during it's 3 hour backup window), I can then search the index even if the machine is powered down.
3108
General Software Discussion / Re: notepad++
« Last post by 4wd on June 05, 2013, 09:02 AM »
You could try Scintilla, it's what Notepad++ is based on.
3109
Living Room / Re: digitising slides
« Last post by 4wd on June 05, 2013, 03:44 AM »
Just as a matter of interest, what make/model camera?

If it's a Canon, you may be able to run the CHDK firmware, (despite it being called firmware it's not a permanent change), which can add interval exposures.

eg. You set it for an exposure every 15 seconds and then you can just swap the slides while it happily automatically takes photos.

It worked quite well on my A720IS.
3110
Living Room / Re: digitising slides
« Last post by 4wd on June 04, 2013, 11:12 PM »
Only trouble with this solution is that neither of our camera's have a facility trip the shutter remotely, so focusing and shooting is hands on process :o

You use the standard 2 or 10 second delay timer along with manual focus, (if your camera has that).  The camera is fixed in place, (standard thread screw into the tripod thread), so all you do is push the button, no need to hold the camera.

I used one of these, (different brand), feed the slides manually and push a button.  Basic 5MP model that almost all of them are.

41TOgcoBa9L._SL500_AA300_.jpg
3111
Finished Programs / Re: DONE: Sync folders by renaming files
« Last post by 4wd on June 04, 2013, 08:17 PM »
so is it actually checking all 3 criteria, size, date, and checksum?

No - you said it wasn't finding any matches when it used the checksums, so that's not in this version.  It's just size, date and time.

Besides unless I can find a way to get it to work with Delayed Expansion enabled and ! in filenames I can't use the MD5 routine since it relies on Delayed Expansion.

one more request. when RenSS finishes, could it loop back and ask for another extension using the same 2 folders, and only exit when i hit {enter}?

Easy enough.

V6 Added repeatability and fixed cancelling of folder requesters.
V7 Added log file and option to display at end, (written to same folder as batch file), it just keeps getting bigger until you delete it

Code: Text [Select]
  1. @if (@CodeSection == @Batch) @then
  2.  
  3.     @echo off
  4.     color 1a
  5.     setlocal EnableExtensions
  6.     setlocal DisableDelayedExpansion
  7.    
  8.     echo Select SOURCE folder
  9.     for /F "delims=" %%S in ('CScript //nologo //E:JScript "%~F0"') do (
  10.         set srce=%%S
  11.     )
  12.     if "%srce%"=="" goto :End2
  13.     echo Selected folder: "%srce%"
  14.    
  15.     echo Select DESTINATION folder
  16.     for /F "delims=" %%D in ('CScript //nologo //E:JScript "%~F0"') do (
  17.        set dest=%%D
  18.     )
  19.     if "%dest%"=="" goto :End2
  20.    
  21.     echo Selected folder: "%dest%"
  22.    
  23.     :GetExt
  24.     echo.
  25.     set /P ext=Please enter extension [eg. jpg] ENTER to exit:
  26.     if %ext%=="" goto :End2
  27.     set /a totfiles=0
  28.     set /a renfiles=0
  29.  
  30.     echo --------------------------- >>"%~dp0%RenSSDT.log"
  31.     echo %date%  %time% >>"%~dp0%RenSSDT.log"
  32.     echo --------------------------- >>"%~dp0%RenSSDT.log"
  33.  
  34.     for /r "%srce%" %%a in (*.%ext%) do (call :CheckSize "%dest%" %%~za "%%~fa")
  35.  
  36.     :End
  37.     echo Total files:   %totfiles%
  38.     echo Renamed files: %renfiles%
  39.     set totfiles=
  40.     set renfiles=
  41.     set ext=
  42.     if exist "%~dp0%RenSSDT.log" (
  43.         choice /c yn /m "View logfile"
  44.         if errorlevel 2 goto :GetExt
  45.         if errorlevel 1 (start notepad.exe "%~dp0%RenSSDT.log")
  46.     )
  47.     goto :GetExt
  48.     :End2
  49.     set srce=
  50.     set dest=
  51.     pause
  52.     exit
  53.  
  54.     :CheckSize
  55.     set /a totfiles+=1
  56.     for /r %1 %%b in (*.%ext%) do (if %2 equ %%~zb call :CheckDate "%~3" "%%~b")
  57.     goto :EOF
  58.  
  59.     :CheckDate
  60.     if "%~t1" equ "%~t2" (
  61.         pushd "%~dp2"
  62.         ren "%~nx2" "%~nx1"
  63.         if not exist "%~nx2" (
  64.             set /a renfiles+=1
  65.             echo Renamed: "%~nx2" To: "%~nx1" >>"%~dp0%RenSSDT.log"
  66.         )
  67.         popd
  68.     )
  69.     goto :EOF
  70.  
  71.     endlocal
  72.  
  73.     End of Batch section
  74. @end
  75.  
  76.  
  77. // JScript section
  78.  
  79. // Creates a dialog box that enables the user to select a folder and display it.
  80. var title = "Select a folder", rootFolder = 0x11;
  81. var shl = new ActiveXObject("Shell.Application");
  82. var folder = shl.BrowseForFolder(0, title, 0, rootFolder);
  83. WScript.Stdout.WriteLine(folder ? folder.self.path : "");

Log file output:
Code: Text [Select]
  1. ---------------------------
  2. Wed 05/06/2013  23:36:35.97
  3. ---------------------------
  4. Renamed: "gyjkhgjkgh.jpg" To: "20012.jpg"
  5. Renamed: "51jbbjbjk.jpg" To: "[email protected]"

Wow, this thing's getting huge....it's cracked 2kB in size.
3112
Living Room / Re: digitising slides
« Last post by 4wd on June 04, 2013, 07:53 PM »
Article attached.  Regarding their light source, I'd probably try it with a couple of cheap LED torches and see how that turns out.

$50 flash scanner - they all have the same specs at that price, (ebay is flooded with them).

Using the scanner, images turn out a little darker than the original, (to be expected for a low quality device), but for my purposes I think they turned out rather well - a lot of the slides had started to lose contrast anyway so this was a save them before they die exercise.

From memory, after scanning images stayed as TIFF until final stage:
a) Batch run through XnView with Auto-Level to a different folder then checked through to see which ones benefited.
b) The ones that didn't, the original was run through XnView with Auto-Contrast, if that didn't make any difference then a bit of hand tweaking in Gimp, Sagelight (Payware) or Lightbox (free cutdown Sagelight).
c) After that, it was the time consuming PolaDSR, where they were saved as JPG @ 95%.

That's it.

If you can set aside the time, as I said in my original thread, it only took 2-3 days to do 1800 slides, (dead time between Xmas and New Years).  The real time spent comes in cleaning them up afterwards.
3113
Living Room / Re: digitising slides
« Last post by 4wd on June 04, 2013, 07:05 PM »
 Does this count?.

You Umart link just takes you to the main page but I assume you mean something like this.

I used one of the cheap slide flash scanners that you can get for about $50 these days, (even though I have a Canon flatbed scanner that will do slides/negatives - the flash scanner is a lot faster).

A lot depends on the original condition of the slides, in my case they were 25-30 years old and most had some mould/specks/dust/etc.

What kind of archival are they looking for?
BTN, (Better Than Nothing), or the best they can get?

If you don't mind a bit of DIY and you have a digital camera, I've got a Silicon Chip article I can send you.
3114
Living Room / Re: Magnetic North Pole migration seems to be accelerating.
« Last post by 4wd on June 04, 2013, 07:59 AM »
"Reversals typically take about 10,000 years to happen," said Jeffrey Love of the U.S. Geological Survey. "And 10,000 years ago civilisation did not exist. These processes are slow, and therefore we don't have anything to worry about."

That's what Cthulhu thought too, now his whole city is underwater.
3115
Screenshot Captor / A couple of things with SSC 4.03.0
« Last post by 4wd on June 04, 2013, 02:56 AM »
First off, don't really use Screenshot Captor, (sorry), but I thought I'd have a play with the latest version 4.03.0 and found a couple of small things:

1) In the options under Image File Format, a slight mis-alignment of the Compression Level text w.r.t. slider, I think the text max needs to be a bit more to the right.

Screenshot - 4_06_2013 , 17_33_56.png

I'm not using any Display scaling or weird fonts, DPI, etc - just boring old Win7 default.

2) In the process of playing with the arrow object to do the above I found that if I drew an arrow in, then hit Ctrl+Z so I could put it elsewhere what would happen is:
a) the arrow gets removed,
b) the arrow object controls are still visible so you believe you're still trying to draw an arrow,
c) when you go to place an arrow you find yourself selecting an area and the arrow object controls vanish.

I would think that upon hitting Ctrl+Z either:
1) the object gets removed and you are still in the object drawing mode, (preferable), or
2) the object gets removed and the object controls get hidden at the same time so you know you're still not in that mode.
3116
Finished Programs / Re: DONE: Sync folders by renaming files
« Last post by 4wd on June 03, 2013, 09:13 PM »
is there any way it can announce how many files were checksummed and how many were renamed?

Yes, the more direct way would however require you to stop using ! in filenames since Delayed Expansion would need to be enabled.

But there's probably a more creative way around the problem.

V5 with statistics and colour!  ;D

I fixed the reversed srce/dest in the rename section where I had it backwards.

Code: Text [Select]
  1. @if (@CodeSection == @Batch) @then
  2.  
  3.     @echo off
  4.     color 1a
  5.     setlocal EnableExtensions
  6.     setlocal DisableDelayedExpansion
  7.    
  8.     echo Select SOURCE folder
  9.     for /F "delims=" %%S in ('CScript //nologo //E:JScript "%~F0"') do (
  10.         if %%S=="" exit
  11.         set srce=%%S
  12.     )
  13.     echo Selected folder: "%srce%"
  14.    
  15.     echo Select DESTINATION folder
  16.     for /F "delims=" %%D in ('CScript //nologo //E:JScript "%~F0"') do (
  17.         if %%D=="" exit
  18.        set dest=%%D
  19.     )
  20.     echo Selected folder: "%dest%"
  21.    
  22.     set /P ext=Please enter extension [eg. jpg]:
  23.     if %ext%=="" exit
  24.     set /a totfiles=0
  25.     set /a renfiles=0
  26.    
  27.     for /r "%srce%" %%a in (*.%ext%) do (call :CheckSize "%dest%" %%~za "%%~fa")
  28. :End
  29.     echo Total files:   %totfiles%
  30.     echo Renamed files: %renfiles%
  31.     set totfiles=
  32.     set renfiles=
  33.     set srce=
  34.     set dest=
  35.     set ext=
  36.     pause
  37.     exit
  38.  
  39.     :CheckSize
  40.     set /a totfiles+=1
  41.     for /r %1 %%b in (*.%ext%) do (if %2 equ %%~zb call :CheckDate "%~3" "%%~b")
  42.     goto :EOF
  43.  
  44.     :CheckDate
  45.     if "%~t1" equ "%~t2" (
  46.         pushd "%~dp2"
  47.         ren "%~nx2" "%~nx1"
  48.         if not exist "%~nx2" (set /a renfiles+=1)
  49.         popd
  50.     )
  51.     goto :EOF
  52.  
  53.     endlocal
  54.  
  55.     End of Batch section
  56. @end
  57.  
  58.  
  59. // JScript section
  60.  
  61. // Creates a dialog box that enables the user to select a folder and display it.
  62. var title = "Select a folder", rootFolder = 0x11;
  63. var shl = new ActiveXObject("Shell.Application");
  64. var folder = shl.BrowseForFolder(0, title, 0, rootFolder);
  65. WScript.Stdout.WriteLine(folder ? folder.self.path : "");
3117
Finished Programs / Re: DONE: Sync folders by renaming files
« Last post by 4wd on June 03, 2013, 12:03 PM »
cuz it is indeed backwards from v3 which i was just using 7 hours ago!

i also put in prompts when choosing the folders:
    echo Choose Source Folder
so i don't lose track of what i'm doing. would it be presumptuous of me to post here the whole file of my minor changes?

That's fine but I may as well add them to V4 above, (later when I wake up - that's right, I'm technically supposed to be asleep - it's 0300).

Thanx!

No problem, quite a fun small script - certainly beats wracking my brain over Dll calls in AutoIt  :-\
3118
Living Room / Re: Possibly the ultimate $21,000 computer desk/chair combo?
« Last post by 4wd on June 03, 2013, 08:52 AM »
It would be an absolute PITA to take to LAN nights but you can be sure of winning every game....since everyone else will be drooling over your chair  ;D
3119
Finished Programs / Re: DONE: Sync folders by renaming files
« Last post by 4wd on June 03, 2013, 03:39 AM »
there's a way to pass the extension to the batch file too, isn't there?

No, but who knows, there may be a way to hack it in.

then i tried RenSSv3 on a folder with 110 videos = 29.6gigs, and it's backup, of which only about a dozen files actually needed renaming. 22 .mp4s = 8gigs took about 15 minutes. 75 .wmvs = 16.8gigs took about 25minutes. does the program detect whether the file needs renaming?

It checks the size, if they are the same then it generates an MD5 checksum for each file, if they are the same it will rename one.  Generating MD5 checksums take time on large files.

is there anything in the process that would balk at that?

It uses the standard DOS rename command, so if it can't handle it then it will fail.  However, maybe I forgot something, I'll check.

V4 RenSSDT.cmd - matches size, date and time and asks for an extension.

Code: Text [Select]
  1. @if (@CodeSection == @Batch) @then
  2.  
  3.     @echo off
  4.     setlocal EnableExtensions
  5.     setlocal DisableDelayedExpansion
  6.    
  7.     for /F "delims=" %%S in ('CScript //nologo //E:JScript "%~F0"') do (
  8.         if %%S=="" exit
  9.         set srce=%%S
  10.     )
  11.     for /F "delims=" %%D in ('CScript //nologo //E:JScript "%~F0"') do (
  12.         if %%D=="" exit
  13.        set dest=%%D
  14.     )
  15.     echo Source folder: "%srce%"
  16.     echo Destination folder: "%dest%"
  17.     set /P ext=Please enter extension [eg. jpg]:
  18.     if %ext%=="" exit
  19.    
  20.     for /r "%srce%" %%a in (*.%ext%) do (call :CheckSize "%dest%" %%~za "%%~fa")
  21. :End
  22.     set srce=
  23.     set dest=
  24.     set ext=
  25.     pause
  26.     exit
  27.  
  28.     :CheckSize
  29.     for /r %1 %%b in (*.%ext%) do (if %2 equ %%~zb call :CheckDate "%~3" "%%~b")
  30.     goto :EOF
  31.  
  32.     :CheckDate
  33.     if "%~t1" equ "%~t2" (
  34.         pushd "%~dp1"
  35.         ren "%~nx2" "%~nx1"
  36.     )
  37.     popd
  38.     goto :EOF
  39.    
  40.     endlocal
  41.  
  42.     End of Batch section
  43. @end
  44.  
  45.  
  46. // JScript section
  47.  
  48. // Creates a dialog box that enables the user to select a folder and display it.
  49. var title = "Select a folder", rootFolder = 0x11;
  50. var shl = new ActiveXObject("Shell.Application");
  51. var folder = shl.BrowseForFolder(0, title, 0, rootFolder);
  52. WScript.Stdout.WriteLine(folder ? folder.self.path : "");

It seems to handle files with ! in the name now, (! doesn't get passed if Delayed Expansion is enabled).

BTW, I hope you're trying these out on copies of your files before you let it run for real over your real files.  As I said, it works for me with the limited testing I do but then my machine is not your machine.

EDIT: I just realised after doing all these different versions that I think I've got the source and destination around the wrong way - won't change it now, it'll only be confusing, (as if I aren't already).  FIXED!
3120
Finished Programs / Re: DONE: Sync folders by renaming files
« Last post by 4wd on June 03, 2013, 02:59 AM »
It's good to have a checksum option, but i just checked a couple hundred .jpgs and videos and couldn't find a single pair of files that were exactly the same size, even pix taken within seconds of each other.

I didn't think it would work to well due to the EXIF data contained within the JPG possibly being different even though the image data and size might be identical.

i do have lots of videos too, and i'm afraid checksums would take a long time. before i asked this question, i tried a few sync programs and dupe finders; FreeFileSync when given 2 dozen videos on each side to examine estimated it would take 2 hours. can it check the date and time instead of checksum?

Should be doable, so you want size, date and time to be matched ?
3121
Post New Requests Here / Re: IDEA: Bring back the BEEP!
« Last post by 4wd on June 02, 2013, 08:37 PM »
Whether or not you can control the motherboard beeper/speaker might come down to your hardware.  The only time I get a beep, (besides fault codes and I'm not sure about that since the board has a diagnostic LED display), is when I enter the BIOS.

No beep for successful POST which is handy for when you fire it up in the middle of the night.

Since the onboard beeper is really only required for POST codes these days there may be no hardware connection on your board which allows it to be driven by the OS.

One way to check would be to load a Linux LiveCD and try the beep command.
3122
Finished Programs / Re: SOLVED: GUI for DISM
« Last post by 4wd on June 02, 2013, 08:21 PM »
Something along the lines of DISMUI then but that also has descriptions, (DISMUI already does dependencies).

DISMUI is free, you need to register at the site before you can download it though.

DISMUI is available for free. If you need a special branded version of DISMUI please contact us for more details.
The tool now supports Windows Embedded 8 Standard!

clip_image002[6].jpg
3123
Finished Programs / Re: DONE: Sync folders by renaming files
« Last post by 4wd on June 02, 2013, 08:05 PM »
As an aside, I think basing the rename off of file sizes is just asking for trouble since the chance of a collision does exist, however small.  On any modern computer, generating any kind of checksum for such small files wouldn't be much of a price to pay to better guard against collisions.

V2 with MD5 checksum, requires MS File Checksum Integrity Verifier in your path somewhere:

Code: Text [Select]
  1. @echo off
  2. rem RenSS.cmd
  3. rem Rename files in dest with same size as files in source
  4. rem
  5. rem RenSS.cmd <srce> <dest>
  6.  
  7. setlocal EnableExtensions
  8. setlocal EnableDelayedExpansion
  9.  
  10. for /r %1 %%a in (*.jpg) do (call :CheckSize "%2" %%~za "%%~fa")
  11. goto End
  12.  
  13. :CheckSize
  14. for /r %1 %%b in (*.jpg) do (if %2 equ %%~zb call :CheckMD5 "%~3" "%%~b")
  15. goto :EOF
  16.  
  17. :CheckMD5
  18. for /f "skip=3 delims= " %%i in ('fciv -md5 %1') do set md5_1=%%i
  19. for /f "skip=3 delims= " %%i in ('fciv -md5 %2') do set md5_2=%%i
  20.  
  21. if "!md5_1!"=="!md5_2!" (ren "%~2" "%~nx1")
  22. set md5_1=
  23. set md5_2=
  24. goto :EOF
  25.  
  26. :End
  27. endlocal

Still has built in overwrite safeguard, (ie. you can't rename to a name that already exists).

Had to find it again, the MD5 check routine came from here courtesy of James L.

V3 adds folder requesters so you can now just double-click on the cmd file :D

Code: Text [Select]
  1. @if (@CodeSection == @Batch) @then
  2.  
  3.     @echo off
  4.     setlocal EnableExtensions
  5.     setlocal EnableDelayedExpansion
  6.    
  7.     for /F "delims=" %%S in ('CScript //nologo //E:JScript "%~F0"') do (
  8.         if %%S=="" exit
  9.         set srce=%%S
  10.     )
  11.     for /F "delims=" %%D in ('CScript //nologo //E:JScript "%~F0"') do (
  12.         if %%D=="" exit
  13.        set dest=%%D
  14.     )
  15.     echo Source folder: "%srce%"
  16.     echo Destination folder: "%dest%"
  17.  
  18.     for /r "%srce%" %%a in (*.jpg) do (call :CheckSize "%dest%" %%~za "%%~fa")
  19. :End
  20.     set srce=
  21.     set dest=
  22.     pause
  23.     exit
  24.  
  25.     :CheckSize
  26.     for /r %1 %%b in (*.jpg) do (if %2 equ %%~zb call :CheckMD5 "%~3" "%%~b")
  27.     goto :EOF
  28.  
  29.     :CheckMD5
  30.     for /f "skip=3 delims= " %%i in ('fciv -md5 %1') do set md5_1=%%i
  31.     for /f "skip=3 delims= " %%i in ('fciv -md5 %2') do set md5_2=%%i
  32.  
  33.     if "!md5_1!"=="!md5_2!" (ren "%~2" "%~nx1")
  34.     set md5_1=
  35.     set md5_2=
  36.     goto :EOF
  37.  
  38.     endlocal
  39.  
  40.     End of Batch section
  41. @end
  42.  
  43.  
  44. // JScript section
  45.  
  46. // Creates a dialog box that enables the user to select a folder and display it.
  47. var title = "Select a folder", rootFolder = 0x11;
  48. var shl = new ActiveXObject("Shell.Application");
  49. var folder = shl.BrowseForFolder(0, title, 0, rootFolder);
  50. WScript.Stdout.WriteLine(folder ? folder.self.path : "");

That particular bit of sorcery came from Antonio at DosTips.

I'm starting to wonder why I bother with AutoIt  :P

EDIT: Renamed to RenSSMD5.cmd to differentiate it from V4.

NOTE: Because of the EnableDelayedExpansion setting in V4, any filename that has an exclamation mark (!) in it will NOT be renamed.  Use V9 below if you want hash comparison and you use ! in filenames.
3124
Finished Programs / Re: DONE: Sync folders by renaming files
« Last post by 4wd on June 01, 2013, 11:49 PM »
NOTE: Latest version down there.

If your only matching criteria is size then this should do what you want.

Save it as RenSS.cmd and then at a command prompt type RenSS.cmd <source> <dest> - put quote around things with spaces in.

It'll only do *.jpg, (unless you change the appropriate parameter), and it's recursive - so if your destination is a sub-directory of your source then you're in deep shit.

Code: Text [Select]
  1. @echo off
  2. rem RenSS.cmd
  3. rem Rename files in dest with same size as files in source
  4. rem
  5. rem RenSS.cmd <srce> <dest>
  6.  
  7. setlocal EnableExtensions
  8.  
  9. for /r %1 %%a in (*.jpg) do (call :CheckB "%~2" %%~za "%%~nxa")
  10. goto End
  11.  
  12. :CheckB
  13. for /r %1 %%b in (*.jpg) do (if %2 equ %%~zb ren "%%b" "%~3")
  14. goto :EOF
  15.  
  16. :End

So using your example above:

RenSS.cmd "C:\Users\Norm\Documents\My Pictures XP\Vacation 2012" "O:\DyNama Collection 2\Pix - not backed up\Vacation 2012 Backup"

Yes, I know, it's not as easy as clicking buttons, (see V3 below), but then most people would use a dual pane filemanager and just do something like RenSS.cmd %s %d

NOTE: Worked here on my small test scenario but who knows what might happen on your machine, ie. test it first on some duplicated files.

If there happens to be more than two files with the same size then subsequent rename operations for them will fail after the first, (ie. file already exists).
3125
I think that's what he meant by #6... the picture was originally a lot smaller, so he might not have noticed that there were two semi-autos on there.

I took SJ's comment to mean the 6th player in a round of Russian Roulette using the traditional 6 shot revolver, as I do with the tag beneath the image.

It's just that the person who put the tag there either has no knowledge of firearms, couldn't find an image depicting all 6 shot revolvers or, (most likely), couldn't give a !@#$!, thus making it confusing rather than witty.

But there I go, over-analysing silliness again.....time for a coffee methinks.
Pages: prev1 ... 120 121 122 123 124 [125] 126 127 128 129 130 ... 225next