I'm trying to get this VBScript working, but the quotation marks needed are throwing me off. I was hoping I could get some help with the placement of quotations.

Set WshShell = CreateObject("WScript.Shell")
' Uninstall Adobe 5 Reader
WshShell.Run ISUNINST.EXE -y -a -f"C:\Program Files\Common Files\Adobe\Acrobat 5.0\NT\Uninst.isu",1,True

Right now, that command is how it should be formatted if I was inserting it into a batch file. I know there needs to be a lot more quotations, but I'm not exactly sure where. I think there are a pair that go around ISUNINST.EXE and I think the parameter passed to that command needs 3 pairs because of the space in the path, but the middle options are what have me thrown for a loop right now.

If I was going to guess, ths is how I would guess:

WshShell.Run "ISUNINST.EXE" -y -a -f"""C:\Program Files\Common Files\Adobe\Acrobat 5.0\NT\Uninst.isu""",1,True

Is that right or wrong? If it's wrong, can someone show me the correct placement of quotations.

0 Comments   [ + ] Show Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.



Set WshShell = CreateObject("WScript.Shell")
' Uninstall Adobe 5 Reader
WshShell.Run "ISUNINST.EXE -y -a -f" & Chr(34) & "C:\Program Files\Common Files\Adobe\Acrobat 5.0\NT\Uninst.isu" & Chr(34),1,True

Chr(34) = "
Answered 06/23/2005 by: Garrett
Orange Belt

Please log in to comment
The best thing to use is Chr(34), That is the ASCII code for ". You may also need the path to the ISUNINST.EXE file.

So for example:

Dim WshShell
Dim command
Dim WindowsFolder,CommonFiles

Set WshShell = CreateObject("WScript.Shell")
WindowsFolder = wso.ExpandEnvironmentStrings("%SystemRoot%")
CommonFiles = wso.ExpandEnvironmentStrings("%CommonProgramFiles%")

Command = WindowsFolder & "\ISUNINST.EXE -y -a -f" & Chr(34) & CommonFiles & "\Adobe\Acrobat 5.0\NT\Uninst.isu" & Chr(34)

WshShell.Run Command,1,True
Answered 06/23/2005 by: TomB
Orange Belt

Please log in to comment
Thanks for the replies. I had read some other posts about the Chr(34), but wasn't sure about it's placement.

Well, without that, I continued to play with the quotation placement and finally got it before I read your responses.

WshShell.Run "ISUNINST.EXE -y -a -f""C:\Program Files\Common Files\Adobe\Acrobat 5.0\NT\Uninst.isu""",1,True

This is what ended up making it work.

Once again, thanks. This is a great resource for my new job requirements. :)
Answered 06/23/2005 by: sigtau66
Senior Yellow Belt

Please log in to comment
Finally got the hang of this myself.

Lets break this command down. The /v switch tells the installer to use msiexec switches for the wrapped msi file.
setup32.exe /S /v"/passive/ REBOOT=REALLYSUPPRESS"

First of all we need to quation mark the full command

"setup32.exe /S /v"/passive/ REBOOT=REALLYSUPPRESS""
At this point the VB script doesnt understand the "/passive/ REBOOT=REALLYSUPPRESS"

What we have to do is to put another pair of quotation marks around it like below.

If we put it togheter it will look like this.
"setup32.exe /S /v""/passive/ REBOOT=REALLYSUPPRESS"""

Simply quote your quotes!
Answered 11/26/2008 by: Jolly
Yellow Belt

Please log in to comment
Simply quote your quotes!
But can you see how hard that it is to read, especially for blind old duffers like me? Using Chr(34) - that is, the ASCII character for quote mark - makes it crystal-clear what's going on, so that the actual quote marks in the script enclose strings and the quote marks required by the command line are clearly defined:

strCommandLine = "setup32.exe /S /v" & Chr(34) & "/passive/ REBOOT=REALLYSUPPRESS" & Chr(34)
objShell.Run strCommandLine
Answered 11/26/2008 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity