bat 获取 exe 文件中 产品版本号并存储到变量中
set EXE='D:\gitlab\drivereasy3\DriverEasyWPF\bin\Release\DriverEasy.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