是否有用于验证安装的 .NET 版本的命令行命令 [英] Is there a command line command for verifying what version of .NET is installed

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

问题描述

我有一套脚本来进行脚本化安装.您可以在任何 server 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?

我知道我可以检查 C:WINDOWSMicrosoft.NETFrameworkv3.5 中的文件是否存在,但是如果有更可靠的东西会更好.

I know I can check if a file in the C:WINDOWSMicrosoft.NETFrameworkv3.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 使用与 .NET 3.0 和 .NET 2.0 相同的 CLR,因此所有新功能都包含在该目录中的新程序集中.基本上,如果目录在那里,则安装 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.

我唯一要补充的是以这种方式找到目录以获得最大的灵活性:

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

%windir%Microsoft.NETFrameworkv3.5

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

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