G
G
glazsss2021-12-22 18:34:32
VBScript
glazsss, 2021-12-22 18:34:32

How to correctly place quotes in VBS?

There is a line of vbs code with variables, looks like this

WshShell.Run "CMD.EXE /C """ & SetupLocation & "\" & Setup & """ " & SetupOptions, 0, True


Where SetupLocation, Setup, SetupOptionsare variables.

It needs to be changed to:
CMD.EXE /min /C " set __COMPAT_LAYER=RUNASINVOKER && start " " SetupLocation & "\" & Setup & """ " & SetupOptions "

Bold marked mandatory quotes, as if I were executing this command in the shell without variables, let's say
CMD.EXE /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "   " C:\Windows\notepad.exe"

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question