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

Javascript
javascript动画效果类封装代码
javascript关于复选框的实用脚本代码
javascript使用Dom改变超链接前面文本框的值
javascript select列表内容按字母倒序排序与按列表倒序排列
(兼容ff/ie)td点击背景变色特效
javascript跟随滚动条滚动的层(浮动AD效果)
javascript按指定格式输出文件最后更新时间
javascript实现的一个自定义长度的文本自动换行的函数。
javascript模仿百万格子小的一小段代码
兼容FireFox 用javascript写的一个画图函数
javascript写的一个表单动态输入提示的代码
不错的用resizeTo和moveTo两个函数实现窗口的“打乒乓球”效果
javascript一个判断浏览器类型的函数(类)
不错的用外部Javascript修正特定网页内容
找到了一篇jQuery与Prototype并存的冲突的解决方法
070823更新的一个[消息提示框]组件 兼容ie7
错误剖析之JavaScript的9个陷阱及评点
推荐一些非常不错的javascript学习资源站点
出现“不能执行已释放的Script代码”错误的原因及解决办法
给Javascript数组插入一条记录的代码

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 110 ::
收藏到网摘: 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
}