批处理判断是否有.net环境

@echo off

set checked=0

if exist "%windir%\Microsoft.NET\Framework\v1.0*" set checked=1
if exist "%windir%\Microsoft.NET\Framework\v1.1*" set checked=1
if exist "%windir%\Microsoft.NET\Framework\v2.0*" set checked=1
if exist "%windir%\Microsoft.NET\Framework\v3.0*" set checked=1
if exist "%windir%\Microsoft.NET\Framework\v3.5*" set checked=1

if %checked% EQU 1 (echo 已安装.NET Framework) else (echo 未安装.NET Framework)

pause>nul

 

你可能感兴趣的:(批处理判断是否有.net环境)