when i execute H:\>filever c:\ee\ee.exe /B /D /A W32i APP ENU 5.4.0.32 shp c:\ee\ee.exe i want to get the 5.4.0.32 from the for loop. for /f "delims= tokens=8" %%I in ('filever /b /d /a c:\ee\ee.exe') do @echo %%I results displayed is always W32i APP ENU 5.4.0.32 how can i *ONLY* retrieve 5.4.0.32 ?
for /f "Tokens=4" %%i in ('filever /b /d /a c:\ee\ee.exe') do ( @echo %%i ) or for /f "Tokens=1-5*" %%I in ('filever /b /d /a c:\ee\ee.exe') do ( @echo %%L ) Jerold Schulman Windows Server MVP JSI, Inc. http://www.jsiinc.com
Usage Issue... So, when I run this code on a machine that is running IE 8.0.6001.18702... Code: if exist "c:\program files\internet explorer\iexplore.exe" ( for /f "tokens=4" %%i in ('"c:\filever.exe" /b /a /d "c:\program files\internet explorer\iexplore.exe"') do set appver=%%i ) if "%appver%" == "8.0.6001.18702" ( echo YOUR BROWSER IS CURRENT goto end ) echo YOUR BROWSER NEEDS TO BE UPGRADED :end I get a "The filename, directory name, or volume label syntax is incorrect." error and then the "YOUR BROWSER NEEDS TO BE UPGRADED" is displayed. What am I doing wrong? Thanx.