现在的位置: 首页 > 综合 > 正文

Extract MSI VBS Script

2012年05月02日 ⁄ 综合 ⁄ 共 884字 ⁄ 字号 评论关闭

Set objDialog = CreateObject("UserAccounts.CommonDialog")
objDialog.Filter = "MSI Files|*.Msi"
intResult = objDialog.ShowOpen
If intResult = 0 Then
Wscript.Quit
Else
End If
MsiSource = objDialog.FileName

Const My_Computer = &H11&
Const Window_Handle = 0
Const Options = 0
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(My_Computer)
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(Window_Handle, "Extract Msi To :", Options, strPath)
If objFolder Is Nothing Then
Wscript.Quit
End If
Set objFolderItem = objFolder.Self
objPath = objFolderItem.Path
MsiDestination = objPath

Set objShell = CreateObject("Wscript.Shell")
objCommand = "MsiExec.exe /a " & Chr(34) & MsiSource & Chr(34) & " /qn TargetDir=" & Chr(34) & MsiDestination & Chr(34)
objShell.Run(objCommand)

MsgBox "Done"
objShell.Run "Explorer.exe /e," & MsiDestination

Download
/Files/CN/ExtractMSI.zip

抱歉!评论已关闭.