(view source code of dnfxver.bat as plain text)
@ECHO OFF
IF NOT "%OS%"=="Windows_NT" GOTO Syntax
IF NOT "%~1"=="" GOTO Syntax
IF NOT EXIST GetUnIns.vbs GOTO Syntax
FINDSTR.EXE /? 2>NUL | FIND.EXE /I "expression" >NUL || GOTO Syntax
REG.EXE /? 2>NUL | FIND.EXE /I "query" >NUL || GOTO Syntax
SETLOCAL
:: Variable thjat holds the results and is used to prevent duplicates
SET AllLines=;
:: Use GetUnIns.vbs to list all programs with ".NET Framework" in their
:: names, and FIND.EXE and FINDSTR.EXE to filter out hotfixes and SDKs
FOR /F "tokens=3*" %%A IN ('CSCRIPT.EXE //NoLogo "%~dp0GetUnIns.vbs" /F:".NET Framework" ^| FINDSTR.EXE /R /I /C:"Program Name *= .*\.NET Framework [1-9]" ^| FIND.EXE /I /V "Hotfix" ^| FIND.EXE /I /V "SDK" ^| SORT.EXE') DO CALL :Display %%B
ENDLOCAL
GOTO:EOF
:Display
:: Skip duplicates
ECHO.%AllLines% | FIND.EXE /I ";%*;" >NUL && GOTO:EOF
:: Add version to list, to check for duplicates later
SET AllLines=%AllLines%%*;
:: Display the version found
ECHO.%*
GOTO:EOF
:Syntax
ECHO dNFxVer.bat, Version 1.01 for Windows 2000 and XP
ECHO List installed .NET Framework versions
ECHO.
ECHO Usage: DNFXVER.BAT
ECHO.
ECHO Note: This batch file requires my GETUNINS.VBS script in its parent folder.
ECHO.
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com
page last modified: 2024-04-16; loaded in 0.0071 seconds