Need some help with """"" in vbscript
It has been a long day and I'm having some trouble with this section within my script. The *** are just for the forum but do have real information in them.
If FSO.FolderExists(Folder_Path) = true then
Wscript.Quit
Else
WshShell.Run "msiexec /i ""****_***.msi"" /qb UPERFORM_COMPANY_NAME="*****, LLC"
UPERFORM_PRODUCT_ID=Q3GUID-M3QW3X-YVU6KU-P6YQQ7-APYFU-A8U4AF REBOOT=ReallySuppress", 1, True
Any help would be great and the ERROR: Expected end of statement.
If FSO.FolderExists(Folder_Path) = true then
Wscript.Quit
Else
Any help would be great and the ERROR: Expected end of statement.
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
Pudsey
15 years ago
Maybe something like this
Dim Quotes
Quotes = Chr(34)
If FSO.FolderExists(Folder_Path) = true then
Wscript.Quit
Else
WshShell.Run "msiexec /i " & "****_***.msi" & " /qb UPERFORM_COMPANY_NAME=" & Quotes & "*****, LLC" & Quotes & " UPERFORM_PRODUCT_ID=Q3GUID-M3QW3X-YVU6KU-P6YQQ7-APYFU-A8U4AF REBOOT=ReallySuppress", 1, True
End If
Dim Quotes
Quotes = Chr(34)
If FSO.FolderExists(Folder_Path) = true then
Wscript.Quit
Else
WshShell.Run "msiexec /i " & "****_***.msi" & " /qb UPERFORM_COMPANY_NAME=" & Quotes & "*****, LLC" & Quotes & " UPERFORM_PRODUCT_ID=Q3GUID-M3QW3X-YVU6KU-P6YQQ7-APYFU-A8U4AF REBOOT=ReallySuppress", 1, True
End If
Posted by:
anonymous_9363
15 years ago
You'll find your code easier to maintain if you break lengthy lines like this into even smaller chunks. I use this "technique" for things like command lines, SQL statements, stuff like that. Note the use of this forum's CODE tag, BTW:
Dim strCommandLine
Const strQuoteMarks = Chr(34)
strCommandLine = ""
strCommandLine = strCommandLine & "msiexec /i"
strCommandLine = strCommandLine & " "
strCommandLine = strCommandLine & "****_***.msi"
strCommandLine = strCommandLine & "/qb"
strCommandLine = strCommandLine & " "
strCommandLine = strCommandLine & "UPERFORM_COMPANY_NAME=" & strQuoteMarks & "*****, LLC" & strQuoteMarks
strCommandLine = strCommandLine & " "
strCommandLine = strCommandLine & "UPERFORM_PRODUCT_ID=Q3GUID-M3QW3X-YVU6KU-P6YQQ7-APYFU-A8U4AF"
strCommandLine = strCommandLine & " "
strCommandLine = strCommandLine & "REBOOT=ReallySuppress"
WshShell.Run strCommandLine, 1, True
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.