Jump to content

tCP

Member
  • Posts

    1
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Italy

About tCP

tCP's Achievements

0

Reputation

  1. I wrote this batch to delete unwanted files. Just copy and paste in a "finish_slipstream.bat" file the following code and replace <path to original CD|folder> and <path to slipstreamed CD|folder> to suit your needs. Run the batch from a folder OUTSIDE the slipstreamed CD|folder and burn the slipstreamed version. Example: original Office CD in drive E, slipstreamed folder in d:\office replace <path to original CD|folder> with e:\ <= ENDING SLASH NEEDED FOR ROOTS (DRIVES) replace <path to slipstreamed CD|folder> with d:\office <= NO ENDING SLASH (FOLDERS) run the batch from outside d:\office @echo off echo Removing useless Folders and Files rem SUBST creates a temp. virtual HD for folders and files listing rem This is needed to have the same path prefix on folders and files rem when comparing the differences between the two versions rem Creates folders and files lists of the original version SUBST w: "<path to original CD|folder>" DIR /A /AD /ON /B /S w:\ >CD_dirs.txt DIR /A /A-D /ON /B /S w:\ >CD_files.txt SUBST w: /D rem Creates folders list of the slipstreamed version SUBST w: "<path to slipstreamed CD|folder>" DIR /A /AD /ON /B /S w:\ >CDSP2_dirs.txt rem Finds and deletes folders not existing in the original version FOR /f "tokens=*" %%i IN (CDSP2_dirs.txt) DO ( FIND /I "%%i" CD_dirs.txt >nul If ErrorLevel 1 IF EXIST "%%i" RD /S /Q "%%i" ) rem Creates remaining files list of the slipstreamed version DIR /A /A-D /ON /B /S w:\ >CDSP2_files.txt rem Finds and deletes remaining files not existing in the original version FOR /f "tokens=*" %%i IN (CDSP2_files.txt) DO ( FIND /I "%%i" CD_files.txt >nul If ErrorLevel 1 DEL /Q "%%i" ) SUBST w: /D rem Removes temp. files used DEL CD*.txt echo Finished! pause NOTE 1: if you have the W: drive letter already in use, change it in the batch code with someone free NOTE 2: if you have any CD*.txt file in your folder running the batch they will be deleted, so rename them or back up somewhere before running the batch. NOTE 3: the batch deletes EVERITHING inside the <path to slipstreamed CD|folder> not found in the <path to original CD|folder> (as needed), so if u have some folders inside DO A BACKUP COPY before running the batch.
×
×
  • Create New...