rem @ECHO OFF
SET targetPath="%~1"
SET ToolPath=%~dp0
REM Method 0: work fine
REM FOR /F "delims=" %%I IN ('cmd /c echo %targetPath%') do SET deepest_folderName=%%~nxI
FOR /F "delims=" %%I IN (%targetPath%) do SET deepest_folderName=%%~nxI
dir %targetPath% /b /s /a-d > "%ToolPath%%deepest_folderName%-list.txt"
pause
-------------------------
tree /f>filelist.txt
-------------------------
reference:
https://superuser.com/questions/32771/list-all-files-in-all-subfolders
沒有留言:
張貼留言