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.Shel l")
WSHShell.Run ("\\server\folder\batch.ba t")
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.Shel
WSHShell.Run ("\\server\folder\batch.ba
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
or
WSHShell.Run "\\Server\folder\setup.exe
merowinger
ASKER
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
WSHShell.Run "\\Server\folder\setup.exe
ASKER
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.
Launching Application.
Using MsiInstallProduct with package path '\\server\folder\setup.msi
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
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
ASKER
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
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
ASKER
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!
WSHShell.Run "msiexec /i C:\folder\setup.msi /qb-!",0,true
customize it and give it a try!
ASKER
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
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
ASKER
Yes it works now...thank you alot.
Works for me too, thanks!
ASKER
Thank you