CODE: [Copy to clipboard]
:: M-bkup.cmd - Backup files and directories preserving their full pathnames by Drag&Drop
:: Will Sort - 2005-09-18 - CMD@WinXP
:: Wrote according to request of Michael Ngen
:: Link: Chine DOS Union Forum - http://www.cn-dos.net/forum/viewthread.php?tid=16947
:: Update: 2005-10-26
@echo off & setlocal EnableExtensions
if not '%1'=='' goto GetPath
:Help
echo NO ACTION TAKEN
echo Usage: Drag and drop files or directories over this file.
echo.
goto End
:GetPath
for %%p in (%0) do set _base=%%~dpp
:Backup
for %%p in (%1.*) do echo File: %%~nxp && xcopy /d /f /g /h /k /r %1 %_base%%%~pp
for /d %%p in (%1.*) do echo Directory: %%~nxp && xcopy /d /e /f /g /h /i /k /r %1 "%_base%%%~pnxp"
if errorlevel 2 goto End
shift
if not '%1'=='' goto Backup
:End
pause
[