How to Check File Exists or not Using Batch File

  1. set var=%cd%  
  2. set buildexePath="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319"  
  3. If Exist "C:\Program Files (x86)\MSBuild\12.0\Bin" set buildexePath="C:\Program Files (x86)\MSBuild\12.0\Bin"  
  4. If Exist "C:\Program Files\MSBuild\12.0\Bin" set buildexePath="C:\Program Files\MSBuild\12.0\Bin"  
  5.   
  6.   
  7. ECHO Process completed  
  8. pause