Link to home
Start Free TrialLog in
Avatar of brookesm
brookesm

asked on

How do i install software with silent command on vbscript?

Hello,
I am new in this category if you can call it like that.
I have a little piece of software that i need to install on quite a few machines on the network. I have wrote a little vbscrip that opens the setup file, but i couldnt manage to make it silent. I have also tryed to create a batch file which would open the setup file, but that didint work eather.

This is my batch file
rd \\Server\folder\setup.exe /s

and this is my vbscript to open the setup.exe file:
Set WSHShell = CreateObject("Wscript.Shell")
WSHShell.Run ("\\server\folder\batch.bat")
ASKER CERTIFIED SOLUTION
Avatar of merowinger
merowinger
Flag of Germany 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
Avatar of brookesm
brookesm

ASKER

I have made the changes and now when i run my script nothing happens. I have tryed running throught cmd and nothing. Then i have tried to run the batch file on cmd, and i got told that "Network access is denied" Also its the first time when i see this: ,0,true <----------- could you explain what this means please.

Thank you
brookesm,
0 means run the program silent (only the .bat process would be visible
true means wait in vbscript progressing until the bat process has ended!
Why do your start the comman "rd" (remove dir)?

Could you try starting the command directly in vbscript without the bat file

Either...
WSHShell.Run "\\Server\folder\setup.exe /s",0,true

or

WSHShell.Run "\\Server\folder\setup.exe",0,true



merowinger
I just tried to run it. I have loaded your exaple onto the Startup script. The good thing is that the script worked, because it loaded the setup.exe file, but the bad thing is that i still have to press "NExt" buttons to fully install it...
what happens with this?
WSHShell.Run "\\Server\folder\setup.exe /s",0,true
it displayed a path file top a log file. I have opened it and there we go...

Launching Application.
Using MsiInstallProduct with package path '\\server\folder\setup.msi' and command line ' /s'
MsiInstallProduct returned '1639'
Error: Invalid command line argument.  Consult the Windows Installer SDK for detailed command line help.
brookesm,

one further question..what kind of setup is it....maybe the setup progress does not support a silent installation....can you install it silent manually without vbscript?

Start -> Run -> \\Server\folder\setup.exe /s

merowinger
well i have a setup.exe file and another msi package and they both are the same software
brookesm,

then try to start the msi file as follows:

Start->Run ... and type:
msiexec /i \yourmsi.msi /qb-!

example:
msiexec /i C:\folder\setup.msi /qb-!

merowinger
But this means i would have to go on over 300+ PCs to do it manually...
no if this works you can execute this command vis vbscript :)

WSHShell.Run "msiexec /i C:\folder\setup.msi /qb-!",0,true

customize it and give it a try!
Wow...that really worked...you can still see how it loads up but that will do...i just need to make an IF function so it checks if the folder is created in Program Files. If not install the setup.exe if yes then end it...
brookesm,

customize the serverpath and the install location folder name in program files in the script...this should do the trick!

merowinger
Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objShell : Set objShell = CreateObject("WScript.Shell")
Dim MSILocation : MSILocation = "\\server\share\setup.msi"
Dim InstallFolder : InstallFolder = "MyApplication" 
If Not objFSO.FolderExists(objShell.ExpandEnvironmentStrings("%PROGRAMFILES%") &"\" &InstallFolder) Then
	objShell.Run objShell.ExpandEnvironmentStrings("%WINDIR%") &"\System32\msiexec /I " &MSILocation &" /qb-!",0,True
End If

Open in new window

Yes it works now...thank you alot.
Works for me too, thanks!