04-deletinganapp.vbs
来自「Chapter12-Administration.rar com example」· VBS 代码 · 共 33 行
VBS
33 行
option explicit
Dim applicationName
applicationName = "My Test Application"
' Create the catalog object
Dim catalog
Set catalog = CreateObject("COMAdmin.COMAdminCatalog")
' Get the applications collection
Dim applications
Set applications = catalog.GetCollection("Applications")
applications.Populate
' Remove any applications that has the same name as the new one
Dim i, numPackages, bChanged
bChanged = False
numPackages = applications.Count
For i = numPackages - 1 To 0 Step -1
If applications.Item(i).Value("Name") = applicationName Then
applications.Remove (i)
bChanged = True
End If
Next
' Commit our deletions
If (bChanged = true) Then
applications.SaveChanges
End If
MsgBox "Done"
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?