set EXE='D:gitlabdrivereasy3DriverEasyWPFinReleaseDriverEasy.exe' powershell "(Get-Item -path %EXE%).VersionInfo.ProductVersion" > DE_Version_tmp.txt for /f "tokens=*" %%i in (DE_Version_tmp.txt) do ( setlocal disabledelayedexpansion set version=%%i setlocal enabledelayedexpansion ) del DE_Version_tmp.txt echo %version% pause