Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- set value=%1
- if "%value%"=="." (
- echo Uncorrect file name
- Goto F
- )
- if "%value%"==".." (
- echo Uncorrect file name
- Goto F
- )
- for %%j in (%pathext%) do (
- for %%i in (%value%%%j) do (
- if Exist %%~$Path:i (
- echo %%~$Path:i
- Goto F
- )
- )
- )
- for %%i in (%1) do (
- if Exist %%~$Path:i (
- echo %%~$Path:i
- Goto F
- )
- )
- if "%value%"=="/?" (
- echo search.bat pattern...
- echo Displays the location of files matching the search pattern.
- echo By default, searches are performed in the current directory and in the directories
- echo specified in the PATH environment variable.
- Goto F
- )
- if "%value%"=="" (
- echo Uncorrect file name
- Goto F
- )
- start /b %value% 1>nul 2>nul
- if %ErrorLevel% equ 0 (
- echo this is internal comand
- Goto F
- )
- echo File not found
- :F
- exit /B
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement