Quotation marks in script parameters
Quest Kace SMA 10
How can I control quotation marks in script paramaters in an online kscript? I'm trying to create a SAS 9.4 renewal script that should look like this:
“C:\Program Files\SASHome\SASRenewalUtility\9.4\sasrenew.exe”-s ”:datafile:$(KACE_DEPENDENCY_DIR)\sid-94-WS-x64-2020.txt“
But if I don't add quotes, the -s gets included in the quotes to come out like
"-s :datafile:$(KACE_DEPENDENCY_DIR)\sid-94-WS-x64-2020.txt“
If I add quotes that I want, I get double quotes like this:
“C:\Program Files\SASHome\SASRenewalUtility\9.4\sasrenew.exe” with params “-s ”:datafile:$(KACE_DEPENDENCY_DIR)\sid-94-WS-x64-2020.txt“”
Any tips for controlling? I don't have a sas installation to test on right now, so maybe the double quotes will work. Trying to get a test installation while I'm stuck doing remote work.
Thanks.
Answers (1)
I have substituted double quotes for single quotes:
'C:\Program Files\SASHome\SASRenewalUtility\9.4\sasrenew.exe'-s ':datafile:$(KACE_DEPENDENCY_DIR)\sid-94-WS-x64-2020.txt'
If you are using the Launch a Program: event then it should look like this:
Directory: C:\Program Files\SASHome\SASRenewalUtility\9.4\
File: sasrenew.exe
Parameters: -s ':datafile:$(KACE_DEPENDENCY_DIR)\sid-94-WS-x64-2020.txt'
Just curious about the format of your parameters. Looks like you have a space between -s and the :datafile: Should there be a space?
Comments:
-
On second thought, you may also want to check your :datafile: format. I have a feeling you only need quotes for the PATH itself. Like this:
-s :datafile:'$(KACE_DEPENDENCY_DIR)\sid-94-WS-x64-2020.txt'
or
-s :datafile:"$(KACE_DEPENDENCY_DIR)\sid-94-WS-x64-2020.txt" - JordanNolan 4 years ago-
Thanks. The example from SAS includes the :datafile in the quotes like this:
"C:\Program Files\SASHome\SASRenewalUtility\9.4\SASRenew.exe" -s "datafile:c:\SAS Software Depot\sid_files\SAS94_order-number_site-number_host-platform.txt"
I'll try the single quotes. - tpr 4 years ago