How can I set a batch file to find a file and show its emplacement? -


i need basic program. can far track if predefined file exists, not more. i'm trying this:

  1. select file
  2. see if exists
  3. find path it
  4. save path under variable, or that
  5. show path user
  6. (execute file, optional)

is there way it, , script? please tell me if not clear. in advance

@echo off setlocal set /p file=choose file:  set /p option=do want execute file?[y/n] if "%option%" equ "y" set /p directory=directory want execute file: if "%option%" equ "y" set /p directory=directory want execute file:  if not exist "%directory%\" echo directory not exist %% exit /b 3       if not exist %file% echo file not exists && exit /b 1 %%f in (%file%) (    set file_atr=%%f   set full_path=%%~ff ) if "%file_atr::~0,1%" equ "d"  echo directory && exit /b 2  echo full path : %full_path% if "%option%" equ "y" (   pushd %directory%   call  %full_path%   popd  ) if "%option%" equ "y" (   pushd %directory%   call  %full_path%   popd  ) endlocal 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -