Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking if .NET is installed from the command line

Tags:

.net

Is there anything similar to the following in Windows that will let me know if .NET is installed from the command line?

$ java -version
$ ruby --version
$ python --version
like image 406
Abdullah Jibaly Avatar asked Feb 06 '09 15:02

Abdullah Jibaly


2 Answers

What OS and command shell are you using?

With Windows from a batch file

if EXIST %WINDIR%\Microsoft.Net\Framework\v1.0.3705\mscorlib.dll
if EXIST %WINDIR%\Microsoft.Net\Framework\v1.1.4322\mscorlib.dll
if EXIST %WINDIR%\Microsoft.Net\Framework\v2.0.50727\mscorlib.dll

With Windows from PowerShell

if (test-path (join-path $env:windir "Microsoft.Net\Framework\v2.0.50727\mscorlib.dll"))){
like image 72
JaredPar Avatar answered Sep 28 '22 07:09

JaredPar


You can use clrver command to check which .net frameworks are installed.

like image 44
Shekhar Avatar answered Sep 28 '22 08:09

Shekhar