Extract MSI vbs script

Source: Internet
Author: User

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 "assumer.exe/e," & msidestination

Download
/Files/CN/extractmsi.zip

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.