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.Shel l")
shell.Run Chr(34) & sFile & Chr(34), 1, false
Set shell = Nothing
End Sub
Option Explicit
Run "C:\MS_FWC.MSI"
Sub Run(ByVal sFile)
'Usage: Run "C:\Program Files\MyFile.exe"
Dim shell
Set shell = CreateObject("WScript.Shel
shell.Run Chr(34) & sFile & Chr(34), 1, false
Set shell = Nothing
End Sub
ASKER
When I use this line the windows installer screen pops up with all the options listed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The MSIEXEC is running in the Task Manager however, the program doesn't seem to be installing.
ASKER
Here's the error I'm getting and I have administrator rights on the machine.
installerr.bmp
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.
Regards,
Rob.
ASKER
Believe it or not I did that too with my own user name and password and it did the same thing
ASKER
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_FW C.MSI" /passive
Nothing happens!
MKDIR c:\FirewallClient
xcopy /y FirewallClient /s "C:\FirewallClient"
Start C:\firewallclient\MSI.bat
The MSI bat has
msiexec.exe /i"C:\FirewallClient\MS_FW
Nothing happens!
ASKER
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?
ASKER
Basically I used your script and modified it to
something else
something else
Hi, thanks. I don't know what you did, but I'm glad you got it working.
Rob.
Rob.
ASKER
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_FW C.MSI" /passive
Exit
that read:
MSIexec /i"C:\firewallClient\MS_FW
Exit
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.