I've got this code in vbscript that launches a batch script with some arguments.
CreateObject("WScript.Shell").Run "printTR.bat " & jsfunction() & " " & amount & " " & printer
The problem is, sometimes the jsfunction()
has spaces, so as you could see the 2nd word would be counted as nother variable. I've tried things like """ & jsfunction() & """"
and """ & jsfunction() & """
, which stopped the script from working at all.
The jsfunction()
is basically just a return of a user input field in the same page. It could contain anything that can be typed on a keyboard.
How can I pass the variable as a single string?
jsfunction()
does as Alex has done in their answer? - "assumingjsfunction()
does not itself return a string that contains quotes". So, because you don't provide enough information people are left to second guess you.