Link to home
Start Free TrialLog in
Avatar of WellingtonIS
WellingtonIS

asked on

Silent Install VB Script

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
Avatar of RobSampson
RobSampson
Flag of Australia image

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.
Avatar of WellingtonIS
WellingtonIS

ASKER

When I use this line the windows installer screen pops up with all the options listed.
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The MSIEXEC is running in the Task Manager however, the program doesn't seem to be installing.  
Here's the error I'm getting and I have administrator rights on the machine.
installerr.bmp
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.
Believe it or not I did that too with my own user name and password and it did the same thing
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!
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?
Basically I used your script and modified it to
something else
Hi, thanks.  I don't know what you did, but I'm glad you got it working.

Rob.
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