Set backup destination based on drive label #

instead of drive letter within a batch file:
   @ECHO OFF

   REM change your_label to your backup drive label

   Set DSTV=your_label
   Set DST=

   For %%a IN (D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) ^
   DO (vol %%a 2> nul|Find /i "%DSTV%" > nul && Set DST=%%a)

   REM if drive label not found, abort

   If "%DST%"=="" Goto END

   REM use %DST%\desired_subdir as destination

   "C:\Program Files\fc\FastCopy.exe" /CMD=diff /force_close "c:\impt" /to="%DST%\impt"

   :END

   Exit

Notes:

/windows | Oct 03, 2013


Subscribe or visit the archives.