Skip to content

Instantly share code, notes, and snippets.

@lxfly2000
Created November 19, 2024 07:34
Show Gist options
  • Save lxfly2000/14ec9cbd19bd4e78e92fc4214a335d90 to your computer and use it in GitHub Desktop.
Save lxfly2000/14ec9cbd19bd4e78e92fc4214a335d90 to your computer and use it in GitHub Desktop.
@echo off
setlocal ENABLEDELAYEDEXPANSION
if "%~1"=="" (
echo No path specified.
goto:eof
)
call:listcd %1
goto:eof
:listcd
pushd %1
for /f %%i in ('dir/b') do (
dir/b/a:d %%i 1>NUL 2>NUL
if !errorlevel!==0 (
call:listcd %%i
) else (
echo %%~dpnxi
:: Add something to do with each file here...
)
)
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment