是否有一个命令行命令来检查安装的是什么版本的.NET的 [英] Is there a command line command for verifying what version of .NET is installed

查看:242
本文介绍了是否有一个命令行命令来检查安装的是什么版本的.NET的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了一个脚本做脚本安装。您可以在任何服务器2008计算机使用的脚本。不过,我需要使用DOS批处理文件来检查.NET 3.5已安装(脚本运行之前)。那可能吗?

I have set of scripts for doing scripted installs. You can use the scripts on any server 2008 machine. However, I need to check if .NET 3.5 has been installed (before the scripts run) using a dos batch file. Is that possible?

我知道我可以检查,如果在℃的文件:\ WINDOWS \ Microsoft.NET \框架\器v3.5 的存在,但它会是不错的东西稍微更可靠。

I know I can check if a file in the C:\WINDOWS\Microsoft.NET\Framework\v3.5 exists, but it would be nice to have something a little more reliable.

我要检查,如果它的实际安装,不只是如果目录/文件存在。

I would like to check if it's actually installed, not just if the dir/file exists.

感谢

推荐答案

不幸的是,最好的办法是检查该目录。我不知道你的意思,但实际安装作为.NET 3.5使用相同的CLR的.NET 3.0和.NET 2.0,因此所有新功能都包裹在那住在该目录中的新组件。基本上,如果该目录是有那么3.5的安装。

Unfortunately the best way would be to check for that directory. I am not sure what you mean but "actually installed" as .NET 3.5 uses the same CLR as .NET 3.0 and .NET 2.0 so all new functionality is wrapped up in new assemblies that live in that directory. Basically, if the directory is there then 3.5 is installed.

我唯一会补充的是找到DIR这种方式最大的灵活性:

Only thing I would add is to find the dir this way for maximum flexibility:

%windir%\Microsoft.NET\Framework\v3.5

这篇关于是否有一个命令行命令来检查安装的是什么版本的.NET的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆