/build/static/layout/Breadcrumb_cap_w.png

Command line switch test script

Sometimes, when i'm re-packaging an app, i run into problems and start to google / looking here for simular issues. And sometimes, i run into a commandline to install the app i'm repacking silently, ergo, there wasn't any need to repackage the app @ the first place. I decided to write a script in VB that executes a number of commandlines based on input. But i can't get the execution of the actual commandline to work. The script thusfar:

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
Dim ProgName

On Error Resume Next

Msgbox "remember to copy this script to program dir!"

ProgName=Inputbox("Provide the executable name:")
If ProgName = "" Then Wscript.Quit
WSHShell.Run "ProgName /s"
Msgbox "Trying /s commandline.."

WSHShell.Run "ProgName /silent"
Msgbox "Trying /silent commandline.."

WSHShell.Run "ProgName /verysilent"
Msgbox "Trying /verysilent commandline.."

WSHShell.Run "ProgName /q"
Msgbox "Trying /q commandline.."

WSHShell.Run "ProgName /quiet"
Msgbox "Trying /quiet commandline.."

WSHShell.Run "ProgName /veryquiet"
Msgbox "Trying /veryquiet commandline.."

WSHShell.Run "ProgName /u"
Msgbox "Trying /u commandline.."

WSHShell.Run "ProgName /unattended"
Msgbox "Trying /unattended commandline.."

WSHShell.Run "ProgName -s"
Msgbox "Trying -s commandline.."

Wscript.Quit(0)

The idea of the script is that, when an installation starts off with setup.exe, the user should copy the script to the folder with setup.exe, starting it off, then entering setup.exe in the messagebox and the script would try a number of "silent" switches. The script does ask for the input, but it doens't seem to run the input + the switch afterwards. I think the problems' in the "WSHShell.Run "ProgName /s"" line.. Tried omitting the quotes and using brackets, but no luck.. Any suggestions/comments would be greatly appreciated.. TIA and kind regards!

0 Comments   [ + ] Show comments

Answers (3)

Posted by: WiseUser 19 years ago
Fourth Degree Brown Belt
0
Try this...

WSHShell.Run ProgName & " /s"
Posted by: WiseUser 19 years ago
Fourth Degree Brown Belt
0
Btw, a nice feature of VBScript is that you can drag and drop files onto them and then read their path from within the script.

Thus you wouldn't have to copy the script to the application folder or type in the exe file's name.

ProgName = Wscript.Arguments(0)
If ProgName = "" Then Wscript.Quit
WSHShell.Run Chr(34) & ProgName & Chr(34) & " /s"
Msgbox "Trying /s commandline.."

Hope this helps.[;)]
Posted by: neo2000 19 years ago
Purple Belt
0
Allright.. Gonna try that.. Thanks all!
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ