On 16/11/2012 02:03, billious wrote:
> On 16/11/2012 03:48, Zak Hipp wrote:
>> I clone various directories to various external devices (without drive
>> letter assignment concerns)
>> My aim is to increment the variable %drv% - e.g. drv=H drv=I ... etc.
>> set drv=H
>> if exist "%drv%:\%batch%%pad%%count%%ext%" goto sync
>> :sync
>> %drv%:
>> "%ffsync%" "%drv%:\%batch%%pad%%count%%ext%"
>
> How about
>
>
> @ECHO OFF
> SETLOCAL
> set ffsync=n:\freefilesync\freefilesync.exe
> FOR /l %%i IN (101,1,119) DO CALL :synch %%i
> GOTO :eof
>
> :: entering SYNCH with parameter 101..119
> :synch
> SET drv=%1
> SET /a count=%1-100
> SET count=SET drv=%%drv:~%count%,1%%:\portable-%drv:~-2%.ffs_batch
> SET drv=xHIJKLMNOPQRSTUVWXYZ
> CALL %count%
> ECHO IF EXIST "%drv%" %drv:~0,2%^&"%ffsync%" "%drv%"
> GOTO :eof
Thank you for the effort you've put in; much appreciated.
There are a couple of things that you could not know about:
1) Must be at drive (H: etc.) for %ffsync% to work:
<FolderPairs>
<Pair>
<Left>N:\Installers</Left>
<Right>\</Right>
</Pair>
</FolderPairs>
2) It must search each drive for all values of %count% (19^2).
I have made organisational changes to the way my backup system is implemented to not need 361 drive searches; simply by
naming them all 'portable.ffs_batch' and ensuring the same file is not copied to more than one device.
Now I know what your translation does; will make it far easier to learn how it does it. Anyway, this is the latest hot
off the press v4.0.1.23 :)
---------------
@ECHO OFF
SET ffsync=n:\freefilesync\freefilesync.exe
SET batch=portable.ffs_batch
FOR %%a IN (H I J K L M N O P Q R S T U V W X Y Z) DO (
IF NOT EXIST %%a:\portable.ffs_batch CALL :skip
%%a:
IF EXIST %%a:\%batch% %ffsync% %batch%
)
:skip
---------------
Grateful.
Zak Hipp