Solved

Silent Install VB Script

Posted on 2010-09-21
12
857 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
Industry Leaders: 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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