I'm currently trying to find out if .NET 4.0 is installed on different PC via command-line. The command I'm using is:
REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" /v Version
If 4.0 is installed I get 4.0..... as a result while if nothing is installed at all I get a registry key error.
Now my question is (as I can't reproduce it here):
Is that secure enough, or could I run into troubles in case 2.0 is installed or 3.0 but NOT 4.0? Thus would I still get the registry key not found error or would I have to use something different here?