Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. @echo off
  2. set value=%1
  3. if "%value%"=="." (
  4. echo Uncorrect file name
  5. Goto F
  6. )
  7. if "%value%"==".." (
  8. echo Uncorrect file name
  9. Goto F
  10. )
  11. for %%j in (%pathext%) do (
  12. for %%i in (%value%%%j) do (
  13. if Exist %%~$Path:i (
  14. echo %%~$Path:i
  15. Goto F
  16. )
  17. )
  18. )
  19. for %%i in (%1) do (
  20. if Exist %%~$Path:i (
  21. echo %%~$Path:i
  22. Goto F
  23. )
  24. )
  25. if "%value%"=="/?" (
  26. echo search.bat pattern...
  27. echo Displays the location of files matching the search pattern.
  28. echo By default, searches are performed in the current directory and in the directories
  29. echo specified in the PATH environment variable.
  30. Goto F
  31. )
  32. if "%value%"=="" (
  33. echo Uncorrect file name
  34. Goto F
  35. )
  36. start /b %value% 1>nul 2>nul
  37. if %ErrorLevel% equ 0 (
  38. echo this is internal comand
  39. Goto F
  40. )
  41. echo File not found
  42. :F
  43. exit /B
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement