@echo off
setlocal enabledelayedexpansion
set old=
for /f "tokens=1-2 delims=." %%v in ('cmd /c ver') do (
   set majv=%%v
   set maj=!majv:~-1!
   set min=%%w
   )
if !maj!==5 (set old=old\) else if !maj!==6 if !min!==0 (set old=old\)
for %%h in ("%~dp0%old%*haspdinst*.exe") do "%%h" /i