Skip to content

Instantly share code, notes, and snippets.

@manuc66
Created June 7, 2016 15:00
Show Gist options
  • Save manuc66/b362efd4e104d581b616cb6a09885c9e to your computer and use it in GitHub Desktop.
Save manuc66/b362efd4e104d581b616cb6a09885c9e to your computer and use it in GitHub Desktop.
@ECHO OFF
SetLocal EnableDelayedExpansion
SET dir1=%1
SET dir2=%2
ECHO. 2>dir1.txt
ECHO. 2>dir2.txt
FOR /f "tokens=*" %%F IN ('DIR /s /b /o:n %dir1%') DO (
SET tmp=%%F
ECHO !tmp:%dir1%\=! >> dir1.txt
)
FOR /f "tokens=*" %%F IN ('DIR /s /b /o:n %dir2%') DO (
SET tmp=%%F
ECHO !tmp:%dir2%\=! >> dir2.txt
)
EndLocal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment