当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 用jscript实现列出安装的软件列表

Javascript
javascript js cookie的存储,获取和删除
得到元素真实的背景颜色的js代码
js获取url参数的使用扩展实例
javascript 屏蔽鼠标键盘的几段代码
兼容IE FF Opera的javascript最短的拖动代码
创建一个复制UBB软件信息的链接或按钮的js代码
js实现iframe动态调整高度的代码
浏览器无法运行JAVA脚本的解决方法
js让弹出新窗口居中显示的脚本
js常见表单应用技巧
javascript 点击整页变灰的效果(可做退出效果)。
制作符合用户体验的漂亮的input输入框
img的onload的另类用法
解读IE和firefox下JScript和HREF的执行顺序
用javascrpt将指定网页保存为Excel的代码
语义化 H1 标签
JavaScript中Math对象使用说明
JavaScipt基本教程之前言
JavaScipt基本教程之JavaScript语言的基础
JavaScipt对象的基本知识

Javascript 中的 用jscript实现列出安装的软件列表


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 167 ::
收藏到网摘: n/a

Returns a list of software that was installed on a computer
using Windows Installer. This information is then
written to a text file. This script requires both Windows
PowerShell and the corresponding version of
the .NET Framework. For more information on downloading
these items see the Windows PowerShell download page (right).
复制代码 代码如下:

$strComputer = "."
$colItems = get-wmiobject -class "Win32_Product" -namespace "root\CIMV2" `
-computername $strComputer
foreach ($objItem in $colItems) {
write-host "Caption: " $objItem.Caption
write-host "Description: " $objItem.Description
write-host "Identifying Number: " $objItem.IdentifyingNumber
write-host "Installation Date: " $objItem.InstallDate
write-host "Installation Date 2: " $objItem.InstallDate2
write-host "Installation Location: " $objItem.InstallLocation
write-host "Installation State: " $objItem.InstallState
write-host "Name: " $objItem.Name
write-host "Package Cache: " $objItem.PackageCache
write-host "SKU Number: " $objItem.SKUNumber
write-host "Vendor: " $objItem.Vendor
write-host "Version: " $objItem.Version
write-host
}