I'm stuck on writing a VBScript file that can call an executable. Stuck on syntax for double-quotes in string literal.
This line is supposed to correctly write the line that calls the executable:
Print #PayLoadFile, " WshShell.Run """ & exePath & """ "
exePath
is variable holding path to executable, and it is correct.
Trying to get the line above to write to the vbs with the following:
WshShell.Run """C:\Users\John Doe\test.exe"""
When I run VBScript manually editing the file with """
between the executable, I do get correct results.
But instead it writes it as it gets error of System cannot find file specified:
WshShell.Run "C:\John Doe\test.exe"
Chr(34)
to get the"
" ? try"WshShell.Run" & Chr(34) & "C:\Users\John Doe\test.exe" & Chr(34)
– Shai RadoWshShell.Run """C:\Users\John Doe\test.exe"""
, Use three double quotes in one side here! – GTAVLoverWshShell.Run"""C:\Users\John Doe\test.exe"""
– Robert