@ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION SET Verbose=0 IF NOT "%~1"=="" ( FOR %%A IN (%*) DO ( ECHO "%%~A" | FINDSTR.EXE /R /C:"[&<>]" >NUL && GOTO Syntax ECHO.%%~A | FINDSTR.EXE /R /B /C:"/" >NUL IF ERRORLEVEL 1 ( REM Abort if a remote computer was already specified before ECHO.!SystemRoot! | FINDSTR.EXE /L /B "\\" && GOTO Syntax REM Check if the specified computer can be reached PING.EXE %~1 -n 2 -4 2>NUL | FIND.EXE "TTL=" >NUL || GOTO Syntax REM Use remote ADMIN$ share instead of %windir%\system32 SET SystemRoot=\\%~1\ADMIN$ ) ELSE ( REM Check validity of command line switch IF /I "%%~A"=="/V" ( IF "!Verbose!"=="0" ( SET Verbose=1 ) ELSE ( REM Duplicate /V switch GOTO Syntax ) ) ELSE ( REM Invalid command line switch GOTO Syntax ) ) ) ) SET Framework=Framework REM Check if system is 64-bit IF EXIST %SystemRoot%\Microsoft.NET\Framework64\*.* SET Framework=Framework64 REM List all installed .NET Framework versions FOR /D %%A IN (%SystemRoot%\Microsoft.NET\%Framework%\v?.*) DO ( FOR /F "tokens=5" %%B IN ('FILEVER.EXE "%%~fA\mscorlib.dll"') DO ( IF "%Verbose%"=="1" ( CALL :VerboseName %%~B ) ELSE ( ECHO.%%~B ) ) ) ENDLOCAL GOTO:EOF :Syntax ECHO. ECHO %~nx0, Version 1.01 for Windows 2000 and later ECHO List installed .NET Framework versions for any computer ECHO. ECHO Usage: %~nx0 [ remote_computer ] [ /V ] ECHO. ECHO Where: "remote_computer" is an optional remote computer name ECHO ^(default is the local computer^) ECHO /V Verbose mode: the batch file will try to return ECHO a description instead of just the version, e.g. ECHO ".NET Framework 3.5 Service Pack 1 ^(3.5.30729.01^)" ECHO instead of "3.5.30729.01" ^(see Notes^) ECHO. ECHO Notes: The descriptions are based on listings from ECHO http://support.microsoft.com/kb/318785 and ECHO https://jonathanparker.wordpress.com/2014/12/05/ ECHO These listings are not complete. ECHO In case a description does not exist for a version, the batch ECHO file returns ".NET Framework" followed by the full version, ECHO e.g. ".NET Framework 4.7.2053.0". ECHO. ECHO Written by Rob van der Woude ECHO http://www.robvandereoude.com ENDLOCAL GOTO:EOF :VerboseName :: This "translation" is based on listings from http://support.microsoft.com/kb/318785 :: and https://jonathanparker.wordpress.com/2014/12/05/ :: It is by no means complete SET VerboseName=%~1 IF "%~1"=="1.0.2204.21" SET VerboseName=1.0 Beta release 1 ^(1.0.2204.21^) IF "%~1"=="1.0.2914.0" SET VerboseName=1.0 Beta release 2 ^(1.0.2914.0^) IF "%~1"=="1.0.3705.0" SET VerboseName=1.0 Original release ^(1.0.3705.0^) IF "%~1"=="1.0.3705.209" SET VerboseName=1.0 Service Pack 1 ^(1.0.3705.209^) IF "%~1"=="1.0.3705.288" SET VerboseName=1.0 Service Pack 2 ^(1.0.3705.288^) IF "%~1"=="1.0.3705.6018" SET VerboseName=1.0 Service Pack 3 ^(1.0.3705.6018^) IF "%~1"=="1.1.4322.510" SET VerboseName=1.1 Final Beta release ^(1.1.4322.510^) IF "%~1"=="1.1.4322.573" SET VerboseName=1.1 Original release ^(1.1.4322.573^) IF "%~1"=="1.1.4322.2032" SET VerboseName=1.1 Service Pack 1 ^(1.1.4322.2032^) IF "%~1"=="1.1.4322.2300" SET VerboseName=1.1 Service Pack 1 Windows Server 2003 32-bit version ^(1.1.4322.2300^) IF "%~1"=="1.1.4322.2310" SET VerboseName=1.1 KB893251 ^(1.1.4322.2310^) IF "%~1"=="1.1.4322.2407" SET VerboseName=1.1 KB927495 ^(1.1.4322.2407^) IF "%~1"=="1.1.4322.2443" SET VerboseName=1.1 KB953297 ^(1.1.4322.2443^) IF "%~1"=="2.0.40607.16" SET VerboseName=2.0 Beta release 1 ^(2.0.40607.16^) IF "%~1"=="2.0.50215.44" SET VerboseName=2.0 Beta release 2 ^(2.0.50215.44^) IF "%~1"=="2.0.50727.42" SET VerboseName=2.0 Original release ^(2.0.50727.42^) IF "%~1"=="2.0.50727.312" SET VerboseName=2.0 Original release Vista ^(2.0.50727.312^) IF "%~1"=="2.0.50727.832" SET VerboseName=2.0 KB928365 ^(2.0.50727.832^) IF "%~1"=="2.0.50727.1433" SET VerboseName=2.0 Service Pack 1 ^(2.0.50727.1433^) IF "%~1"=="2.0.50727.1434" SET VerboseName=2.0 Service Pack 1 Windows Server 2008 and Windows Vista Service Pack 1 ^(2.0.50727.1434^) IF "%~1"=="2.0.50727.3053" SET VerboseName=2.0 Service Pack 2 ^(2.0.50727.3053^) IF "%~1"=="2.0.50727.3082" SET VerboseName=2.0 Service Pack 2 ^(2.0.50727.3082^) IF "%~1"=="2.0.50727.3603" SET VerboseName=2.0 Service Pack 2 KB974417 ^(2.0.50727.3603^) IF "%~1"=="2.0.50727.3607" SET VerboseName=2.0 Service Pack 2 KB976569 ^(2.0.50727.3607^) IF "%~1"=="2.0.50727.3615" SET VerboseName=2.0 Service Pack 2 KB983583 ^(2.0.50727.3615^) IF "%~1"=="2.0.50727.4016" SET VerboseName=2.0 Service Pack 2 Windows Vista Service Pack 2 and Windows Server 2008 Service Pack 2 ^(2.0.50727.4016^) IF "%~1"=="2.0.50727.4918" SET VerboseName=2.0 Service Pack 2 Windows 7 Release Candidate ^(2.0.50727.4918^) IF "%~1"=="2.0.50727.4927" SET VerboseName=2.0 Service Pack 2 Windows 7 Original release ^(2.0.50727.4927^) IF "%~1"=="2.0.50727.4952" SET VerboseName=2.0 Service Pack 2 KB983590 ^(2.0.50727.4952^) IF "%~1"=="2.0.50727.3649" SET VerboseName=2.0 Service Pack 2 KB2833940 Windows XP and Windows Server 2003 ^(2.0.50727.3649^) IF "%~1"=="3.0.4506.26" SET VerboseName=3.0 Original release Windows Vista ^(3.0.4506.26^) IF "%~1"=="3.0.4506.30" SET VerboseName=3.0 Original release (3.0.4506.30^) IF "%~1"=="3.0.4506.590" SET VerboseName=3.0 Service Pack 1 Beta release ^(3.0.4506.590^) IF "%~1"=="3.0.4506.648" SET VerboseName=3.0 Service Pack 1 ^(3.0.4506.648^) IF "%~1"=="3.0.4506.2123" SET VerboseName=3.0 Service Pack 2 ^(3.0.4506.2123^) IF "%~1"=="3.0.4506.2152" SET VerboseName=3.0 Service Pack 2 ^(3.0.4506.2152^) IF "%~1"=="3.0.4506.2254" SET VerboseName=3.0 Service Pack 2 ^(3.0.4506.2254^) IF "%~1"=="3.5.20404.0" SET VerboseName=3.5 Beta release 1 ^(3.5.20404.0^) IF "%~1"=="3.5.20706.1" SET VerboseName=3.5 Beta release 2 ^(3.5.20706.1^() IF "%~1"=="3.5.21022.8" SET VerboseName=3.5 Original release ^(3.5.21022.8^) IF "%~1"=="3.5.30428.1" SET VerboseName=3.5 Service Pack 1 Beta release ^(3.5.30428.1^) IF "%~1"=="3.5.30729.1" SET VerboseName=3.5 Service Pack 1 ^(3.5.30729.1^) IF "%~1"=="3.5.30729.01" SET VerboseName=3.5 Service Pack 1 ^(3.5.30729.01^) IF "%~1"=="3.5.30729.4926" SET VerboseName=3.5 Service Pack 1 Windows 7 ^(3.5.30729.4926^) IF "%~1"=="4.0.20506" SET VerboseName=4.0 Beta release 1 ^(4.0.20506^) IF "%~1"=="4.0.21006" SET VerboseName=4.0 Beta release 2 ^(4.0.21006^) IF "%~1"=="4.0.30128.1" SET VerboseName=4.0 Release Candidate ^(4.0.30128.1^) IF "%~1"=="4.0.30319.0" SET VerboseName=4.0 Original release ^(4.0.30319.0^) IF "%~1"=="4.0.30319.1" SET VerboseName=4.0 Original release ^(4.0.30319.1^) IF "%~1"=="4.0.30319.17020" SET VerboseName=4.5 Developer Preview ^(4.0.30319.17020^) IF "%~1"=="4.0.30319.17379" SET VerboseName=4.5 Beta release Consumer Preview ^(4.0.30319.17379^) IF "%~1"=="4.0.30319.17626" SET VerboseName=4.5 Release Candidate ^(4.0.30319.17626^) IF "%~1"=="4.0.30319.17929" SET VerboseName=4.5 Original release ^(4.0.30319.17929^) IF "%~1"=="4.0.30319.18033" SET VerboseName=4.5 January 2013 Update ^(4.0.30319.18033^) IF "%~1"=="4.0.30319.18046" SET VerboseName=4.5 May 2013 Update ^(4.0.30319.18046^) IF "%~1"=="4.0.30319.18408" SET VerboseName=4.5.1 October 2013 Update ^(4.0.30319.18408^) IF "%~1"=="4.0.30319.18444" SET VerboseName=4.5.1 February 2014 Update ^(4.0.30319.18444^) IF "%~1"=="4.0.30319.34209" SET VerboseName=4.5.2 May 2014 Update ^(4.0.30319.34209^) IF "%~1"=="4.5.40805" SET VerboseName=4.5 Developer Preview ^(4.5.40805^) IF "%~1"=="4.5.50131" SET VerboseName=4.5 Beta release Consumer Preview ^(4.5.50131^) IF "%~1"=="4.5.50501" SET VerboseName=4.5 Release Candidate ^(4.5.50501^) IF "%~1"=="4.5.50709" SET VerboseName=4.5 Original release ^(4.5.50709^) IF "%~1"=="4.5.51641" SET VerboseName=4.5.1 October 2013 Update ^(4.5.51641^) IF "%~1"=="4.5.51641" SET VerboseName=4.5.1 February 2014 Update ^(4.5.51641^) IF "%~1"=="4.5.51650" SET VerboseName=4.5.2 May 2014 Update ^(4.5.51650^) ECHO .NET Framework %VerboseName% SET VerboseName= GOTO:EOF