0

Possible Duplicate:
Is there a way to determine the .NET Framework version from the command line?

How to identify if .net framework is installed in a system and it version using command prompt? Thanks in advance.

Community
  • 1
  • 1
HotTester
  • 5,620
  • 15
  • 63
  • 97
  • Dup: http://stackoverflow.com/questions/2238696/is-there-a-way-to-determine-the-net-framework-version-from-the-command-line – Joe Feb 13 '10 at 13:29
  • I finally got it--> if exist "%WINDIR%\Microsoft.Net\Framework\v3.5" goto end start /wait .\Framework\dotnetfx.exe /q /norestart" :end – HotTester Feb 13 '10 at 14:08
  • this script will check if .net framework 3.5 is already installed. If yes then it would skip otherwise it would run the dotnetframework3.5 exe in silent mode (no ui and no user interaction install) This is what i was looking for. – HotTester Feb 13 '10 at 14:12

3 Answers3

1

the best way to do this is simply by issuing the following command from cmd

dir /Ad %systemroot%\Microsoft.NET\Framework

this will give you a list of .net frameworks installed.

more info can be found here:

MindFold
  • 771
  • 5
  • 16
0

In cmd

reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP"

or in powershell

gci "HKLM:Software\Microsoft\NET Framework Setup\NDP"

These registry keys, and those top detect particular service packs, are described in the accepted answer to this question.

Community
  • 1
  • 1
Lachlan Roche
  • 25,678
  • 5
  • 79
  • 77
0

Another alternative is to check if %systemroot%\Assembly exists, as there will always be an assembly cache (GAC) folder.

Chris S
  • 64,770
  • 52
  • 221
  • 239