Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Silent Install VB Script

Posted on 2010-09-21
12
Medium Priority
?
869 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 2000 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Technology Partners: 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!

Question has a verified solution.

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

Step by step guide to Clean and Sort your windows registry! Introduction: Always remember: A Clean registry = Better performance = Save your invaluable time In this article we're going to clear our registry manually! Yes, manually! The e…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

604 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