Solved

Silent Install VB Script

Posted on 2010-09-21
12
845 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
  • 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
 

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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

929 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now