Solved

Silent Install VB Script

Posted on 2010-09-21
12
840 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

cPanel is a Unix based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site. cPanel utilizes a 3 tier structure that provides functionality for administrators, rese…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 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

13 Experts available now in Live!

Get 1:1 Help Now