Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem for /F "delims=;" %%a in ('%PATH%') do
- call :main %1
- exit /b
- :main
- setlocal ENABLEDELAYEDEXPANSION
- for /l %%e in (1,1,10) do call :pathext %%e "" %1
- for /l %%a in (1,1,10) do (
- rem echo %%a
- call :parsepath %%a %1
- rem echo afasf !ERRORLEVEL!
- IF ERRORLEVEL 1 (
- endlocal
- goto :eof
- )
- )
- exit /b
- :parsepath
- for /F "delims=;" %%b in ("%PATH%") do (
- rem echo %%b
- for /l %%e in (1,1,50) do call :pathext %%e "%%b" %2
- rem call :pathext %%e %%b %2
- rem exit /b 2
- )
- goto :eof
- :pathext
- for /F "delims=;" %%d in ("%PATHEXT%") do (
- rem echo %2\%3%%d
- if exist %2\%3%%d echo aaaaaa
- rem exit /b 4
- )
- goto :eof
- endlocal
- @echo off
- echo *****************************
- echo (c) Michael Plusnin, 2010
- echo *****************************
- echo %*
- call :sc %*\
- goto :eof
- :sc
- rem echo %*
- for /F %%x in ('dir %* /a:-D /B') do (
- echo %*%%x
- )
- for /F "tokens=3,*" %%i in ('dir %* /a:D ^| findstr "<DIR>"') DO (
- if NOT %%j==. (
- if NOT %%j==.. (
- echo %*%%j
- call :sc %*%%j\
- )
- )
- )
- goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement