Can someone make me a quick batch file that loops through file list.

Discussion in 'Scripting' started by CODYQX4, Oct 5, 2010.

  1. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,804
    45,138
    150
    OK I have used dir command to create 2 files list, which I compare with bsdiff to make a patch file.

    the syntax is
    bsdiff oldfile newfile patchfile

    One list will be oldfile, one will be new file, and I make a third list for patchfiles names.

    I need a loop that will read through these three files lists making patches until end. This is needed for a feature I am seeing if it is feasible for Toolkit (that will use these patch files).
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,256
    670
    60
    #2 MasterDisaster, Oct 5, 2010
    Last edited by a moderator: Apr 20, 2017
    The following batch will do the job
    Code:
    @echo off
    setlocal enabledelayedexpansion
    set /a n=1
    for /f "tokens=*" %%A IN ('"dir /b C:\oldfiles"') do ( call :for2 !n! "%%A"
    set /a n=!n!+1
    )
    pause
    exit
    
    :for2
    set str=%2
    set str=%str:~1,-1%
    for /f "skip=%1 tokens=*" %%a IN ('"dir /b C:\newfiles"') do echo %str% %%a & exit /b
    
    Eg. file structure
    Code:
    C:\>dir /b C:\oldfiles
    0 - Copy (2).txt
    0 - Copy (3).txt
    0 - Copy (4).txt
    0 - Copy (5).txt
    0 - Copy (6).txt
    0 - Copy (7).txt
    0 - Copy (8).txt
    0 - Copy (9).txt
    0 - Copy.txt
    0.txt
    
    C:\>dir /b C:\newfiles
    1 - Copy (10).txt
    1 - Copy (2).txt
    1 - Copy (3).txt
    1 - Copy (4).txt
    1 - Copy (5).txt
    1 - Copy (6).txt
    1 - Copy (7).txt
    1 - Copy (8).txt
    1 - Copy (9).txt
    1 - Copy.txt
    1.txt
    
    Output of above batch
    Code:
    0 - Copy (2).txt 1 - Copy (2).txt
    0 - Copy (3).txt 1 - Copy (3).txt
    0 - Copy (4).txt 1 - Copy (4).txt
    0 - Copy (5).txt 1 - Copy (5).txt
    0 - Copy (6).txt 1 - Copy (6).txt
    0 - Copy (7).txt 1 - Copy (7).txt
    0 - Copy (8).txt 1 - Copy (8).txt
    0 - Copy (9).txt 1 - Copy (9).txt
    0 - Copy.txt 1 - Copy.txt
    0.txt 1.txt
    Press any key to continue . . .
    
    1 - Copy (10).txt is an additional file in newfiles folder. It is a dummy file that needs to be on top of the list so that the second for loop runs as expected.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,804
    45,138
    150
    #3 CODYQX4, Oct 5, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    How do I use this with bsdiff?

    I got these 3 files:

    OldFilesList
    Code:
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\AccessR.WW\AccessRWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\AccessR.WW\AccessRWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\AccessR.WW\AccRWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\AccessR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\AccessR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\ExcelR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\ExcelR.WW\ExcelRWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\ExcelR.WW\ExcelRWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\ExcelR.WW\ExcelRWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\ExcelR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\GrooveR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\GrooveR.WW\GrooverWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\GrooveR.WW\GrooverWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\GrooveR.WW\GroovrWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\GrooveR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\InfoPathR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\InfoPathR.WW\InfoPathRWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\InfoPathR.WW\InfoPathRWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\InfoPathR.WW\InfrWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\InfoPathR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\OneNoteR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\OneNoteR.WW\OneNoteRWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\OneNoteR.WW\OneNoteRWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\OneNoteR.WW\OnoteRWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\OneNoteR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\OutlookR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\OutlookR.WW\OlkrWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\OutlookR.WW\OutlookRWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\OutlookR.WW\OutlookRWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\OutlookR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PowerPointR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PowerPointR.WW\PowerPointRWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PowerPointR.WW\PowerPointRWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PowerPointR.WW\PptRWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PowerPointR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PrjProR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PrjProR.WW\PrjProrWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PrjProR.WW\PrjProrWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PrjProR.WW\PrjPrrWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PrjProR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PrjStdR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PrjStdR.WW\PjStdrWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PrjStdR.WW\PrjStdrWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PrjStdR.WW\PrjStdrWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PrjStdR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\ProPlusR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\ProPlusR.WW\ProPlusrWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\ProPlusR.WW\ProPlusrWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\ProPlusR.WW\ProPrWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\ProPlusR.WW\ProPrWW2.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\ProPlusR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PublisherR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PublisherR.WW\PublisherRWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PublisherR.WW\PublisherRWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PublisherR.WW\PubRWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\PublisherR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\SmallBusBasicsR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\SmallBusBasicsR.WW\SBBrWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\SmallBusBasicsR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\SmallBusBasicsR.WW\SmallBusBasicsrWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\SmallBusBasicsR.WW\SmallBusBasicsrWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\StandardR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\StandardR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\StandardR.WW\StandardrWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\StandardR.WW\StandardrWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\StandardR.WW\StdrWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\VisioR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\VisioR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\VisioR.WW\VisiorWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\VisioR.WW\VisiorWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\VisioR.WW\VisiorWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\WordR.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\WordR.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\WordR.WW\WordRWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\WordR.WW\WordRWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\Retail\32\WordR.WW\WordRWW.xml
    
    NewFilesList:
    Code:
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Access.WW\AccessWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Access.WW\AccessWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Access.WW\AccWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Access.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Access.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Excel.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Excel.WW\ExcelWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Excel.WW\ExcelWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Excel.WW\ExcelWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Excel.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Groove.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Groove.WW\GrooveWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Groove.WW\GrooveWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Groove.WW\GrooveWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Groove.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\InfoPath.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\InfoPath.WW\InfoPathWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\InfoPath.WW\InfoPathWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\InfoPath.WW\InfWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\InfoPath.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\OneNote.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\OneNote.WW\OneNoteWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\OneNote.WW\OneNoteWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\OneNote.WW\OnoteWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\OneNote.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Outlook.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Outlook.WW\OlkWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Outlook.WW\OutlookWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Outlook.WW\OutlookWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Outlook.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PowerPoint.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PowerPoint.WW\PowerPointWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PowerPoint.WW\PowerPointWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PowerPoint.WW\PptWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PowerPoint.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PrjPro.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PrjPro.WW\PrjProWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PrjPro.WW\PrjProWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PrjPro.WW\PrjProWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PrjPro.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PrjStd.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PrjStd.WW\PrjStdWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PrjStd.WW\PrjStdWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PrjStd.WW\PrjStdWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\PrjStd.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\ProPlus.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\ProPlus.WW\ProPlusWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\ProPlus.WW\ProPlusWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\ProPlus.WW\ProPsWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\ProPlus.WW\ProPsWW2.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\ProPlus.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Publisher.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Publisher.WW\PublisherWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Publisher.WW\PublisherWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Publisher.WW\PubWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Publisher.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\SmallBusBasics.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\SmallBusBasics.WW\SBBWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\SmallBusBasics.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\SmallBusBasics.WW\SmallBusBasicsWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\SmallBusBasics.WW\SmallBusBasicsWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Standard.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Standard.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Standard.WW\StandardWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Standard.WW\StandardWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Standard.WW\StdWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Visio.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Visio.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Visio.WW\VisioWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Visio.WW\VisioWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Visio.WW\VisioWW.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Word.WW\config.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Word.WW\setup.xml
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Word.WW\WordWW.cab
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Word.WW\WordWW.msi
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\VL\32\Word.WW\WordWW.xml
    
    and
    PatchList (These are the names bsdiff should use for each line Haven't made this yet but it would be a full path like other two)


    bsdiff oldfile newfile patchfile

    It should on each loop iteration read each parameter from the necessary line (like everything on first line, then next loop everything on second line).
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,256
    670
    60
    #4 MasterDisaster, Oct 5, 2010
    Last edited by a moderator: Apr 20, 2017
    Code:
    @echo off
    setlocal enabledelayedexpansion
    set /a n=1
    for /f "tokens=*" %%A IN (oldfilelist.txt) do (
    call :for2 !n! %%A
    set /a n=!n!+1
    )
    exit
    :for2
    for /f "skip=%1 tokens=*" %%a IN (newfilelist.txt) do echo %2 %%a & exit /b
    
    Change the highlighted part to bspatch syntax.
     

    Attached Files:

    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,804
    45,138
    150
    Close. It must read a third file, that follows same rules as the other two.

    the old file is thr original file, new is the file we compare against the old, the third file is where we save the patch file generated by bsdiff.

    I assume it would end up do echo bsdiff %%a %%b %%c where b is new and c is generated file save path?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,256
    670
    60
    %2 is the name of the old file
    %%a is the name of the file to be compared

    What do you want the third file name to be?
    H:\My Data\My Programs\Windows\Microsoft\Microsoft Office 2010\Crack\My Tools\Channel Switch\patched\*.patched
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,804
    45,138
    150
    I was gonna make it myself, but, you could simply take the name of the file in newfile list and append the .patch extension to it (like AccessWW.msi.patch).
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,256
    670
    60
    #8 MasterDisaster, Oct 5, 2010
    Last edited by a moderator: Apr 20, 2017
    I think this will do it
    Code:
    @echo off
    setlocal enabledelayedexpansion
    set /a n=1
    for /f "tokens=*" %%A IN (oldfilelist.txt) do (
    call :for2 !n! %%A
    set /a n=!n!+1
    )
    pause
    exit
    :for2
    for /f "skip=%1 tokens=*" %%a IN (newfilelist.txt) do (
    set str=%%a
    set str=!str:~0,-1!.patched"
    bspatch %2 %%a !str!
    exit /b
    )
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,804
    45,138
    150
    The loop is out of sync, it winds up comparing wrong files resulting in bad patches.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,804
    45,138
    150
    OK, rather than a loop reading those 3 files and running the exe, could you add everything on one line in one new file?

    I mean like (Outputfile)

    Line 1 "OldPath" "NewPath" "PatchFilePath"
    Line 2 "OldPath" "NewPath" "PatchFilePath"

    So I could just add bspatch to front of each line and it would have all parameters.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,804
    45,138
    150
    #11 CODYQX4, Oct 5, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    I believe I've simplified it

    Code:
    :Loop
    @echo off
    :Loop
    set /p old= <Old.txt
    set /p new= <New.txt
    set /p patchfile= <PatchFile.txt
    if %old% NEQ "EOF" (
    Echo %old%
    Echo %new%
    Echo %patchfile%
    bsdiff %old% %new% %patchfile%
    goto loop
    )
    exit
    Anyone know how to break the loop when at end of file (File lengths are all the same).


    EDIT: Got way to end loop, but the code reads the first line of each file EVERY single time. I added the text "EOF" at each file end but it reads first line every loop, probably because I read multiple files.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Stannieman

    Stannieman MDL Guru

    Sep 4, 2009
    2,232
    1,800
    90
    CODYQX4, did you get the volume files from wzor select?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,804
    45,138
    150
    If you mean the files I am patching, I got all my VL from wzor, and all my retail from MSDN exe files.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,804
    45,138
    150
    Managed to do this in a much more sane way. I looped through each file taking the contents, putting them on one line, then delete top line, then do again till end of file. I then get a file like "OldFilePath" "NewFilePath" "PatchFilePath" on each line and simply use this one file in a loop.

    Its a matter of how long the crappy celeron processor in this cheap laptop can bsdiff 11.2gb of data.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,256
    670
    60
    The newfilelist.txt has empty line in the beginning. There are exactly 76 lines in the oldfilelist and 77 lines in the newfilelist. If you look at the second for loop you will notice that I skip a number of lines and process only the first line and break from the loop. If you try to echo the three file names you will get exactly 76 lines of output.

    Its good that you got it working in another way. Can you post your batch file here?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,804
    45,138
    150
    I deleted some of what I had, but I found a batchfile called NoFirstLine, that removed first line after reading first line of each file.

    Then wrote the read stuff on one line to a new file, then I added bsdiff to front of every line, changed extension to .bat, and ran it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...