Solved

Silent Install VB Script

Posted on 2010-09-21
12
855 Views
Last Modified: 2012-05-10
I have an MSI file to install a firewall client.  I have a bat file that copies the exe to the C drive and then starts the VB script.  The exe stops so you can click next.  Is there a way to tell the VB script to take care of that.  This is what I have so far.  I'm new to the VB game so I'm still learning...

Option Explicit
Run "C:\MS_FWC.MSI"

Sub Run(ByVal sFile)
      'Usage: Run "C:\Program Files\MyFile.exe"
      Dim shell

    Set shell = CreateObject("WScript.Shell")
    shell.Run Chr(34) & sFile & Chr(34), 1, false
    Set shell = Nothing
End Sub
0
Comment
Question by:WellingtonIS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 4
12 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 33730409
Hi, as this an MSI, and not an EXE, can you try changing this line:
    shell.Run Chr(34) & sFile & Chr(34), 1, false

to this
    shell.Run "msiexec /i /qn " & Chr(34) & sFile & Chr(34), 1, false

That should make the MSI install silently.

Rob.
0
 

Author Comment

by:WellingtonIS
ID: 33733513
When I use this line the windows installer screen pops up with all the options listed.
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 33739320
Is the file you're passing an MSI or an EXE?

If it's an MSI, that line should work....try running it at a command prompt
msiexec /i /qn "C:\Temp\YourMSI.msi"

Rob.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:WellingtonIS
ID: 33743327
The MSIEXEC is running in the Task Manager however, the program doesn't seem to be installing.  
0
 

Author Comment

by:WellingtonIS
ID: 33743399
Here's the error I'm getting and I have administrator rights on the machine.
installerr.bmp
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 33750869
Hmmm, so the EXE is running.....it looks like some sort of profile migration / copying program.  NTUser.dat is a locked file whenever that profile is loaded.  So if the script is running as administrator.WELLINGTON (ie Wellington/administrator) then NTUser.dat will be locked, and it will never copy successfully.  You need to reboot, and log in as another administrative user to copy that file successfully.

Regards,

Rob.
0
 

Author Comment

by:WellingtonIS
ID: 33752942
Believe it or not I did that too with my own user name and password and it did the same thing
0
 

Author Comment

by:WellingtonIS
ID: 33753528
OK I found the problem however the bat still isn't working... Here's what I have... You have to copy the entire folder, not just the MSI  So the 1st bat file says the following:
MKDIR c:\FirewallClient
xcopy /y FirewallClient /s  "C:\FirewallClient"
Start C:\firewallclient\MSI.bat

The MSI bat has
msiexec.exe /i"C:\FirewallClient\MS_FWC.MSI" /passive

Nothing happens!
0
 

Author Comment

by:WellingtonIS
ID: 33753741
OK I fixed this issue however how to I get the screen to close after it installs.  In otherwords I have the DOS screen left.. Can I added Exit?
0
 

Author Closing Comment

by:WellingtonIS
ID: 33755060
Basically I used your script and modified it to
something else
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 33763643
Hi, thanks.  I don't know what you did, but I'm glad you got it working.

Rob.
0
 

Author Comment

by:WellingtonIS
ID: 33768938
I created 2 bat files. One to copy the entire folder because the MSI file I was given wasn't enough. I the 1st bat file I wrote instruction to start the 2nd bat file
that read:
MSIexec /i"C:\firewallClient\MS_FWC.MSI" /passive
Exit
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question