Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2.  
  3. rem for /F "delims=;" %%a in ('%PATH%') do
  4. call :main %1
  5. exit /b
  6.  
  7. :main
  8. setlocal ENABLEDELAYEDEXPANSION
  9.     for /l %%e in (1,1,10) do call :pathext %%e "" %1
  10.     for /l %%a in (1,1,10) do (
  11.         rem echo %%a
  12.         call :parsepath %%a %1
  13.         rem echo afasf !ERRORLEVEL!
  14.         IF ERRORLEVEL 1 (
  15.             endlocal
  16.             goto :eof
  17.         )  
  18.     )
  19.  
  20. exit /b
  21.  
  22. :parsepath
  23.     for /F "delims=;" %%b in ("%PATH%") do (
  24.         rem echo %%b
  25.         for /l %%e in (1,1,50) do call :pathext %%e "%%b" %2
  26.         rem call :pathext %%e %%b %2
  27.         rem exit /b 2
  28.     )
  29. goto :eof
  30.    
  31. :pathext
  32.     for /F "delims=;" %%d in ("%PATHEXT%") do (
  33.         rem echo %2\%3%%d
  34.         if exist %2\%3%%d echo aaaaaa
  35.         rem exit /b 4
  36.     )
  37. goto :eof
  38.  
  39. endlocal
  40.  
  41. @echo off
  42. echo *****************************
  43. echo (c) Michael Plusnin, 2010
  44. echo *****************************
  45.  
  46.  
  47.  
  48. echo %*
  49. call :sc %*\
  50. goto :eof
  51.  
  52.  
  53. :sc
  54. rem echo %*
  55. for /F %%x in ('dir %* /a:-D /B') do (
  56.     echo %*%%x
  57. )
  58. for /F "tokens=3,*" %%i in ('dir %* /a:D ^| findstr "<DIR>"') DO (
  59.     if NOT %%j==. (
  60.         if NOT %%j==.. (
  61.             echo %*%%j
  62.             call :sc %*%%j\
  63.         )
  64.     )
  65. )
  66. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement