How do I put quotation marks into quotation mark (vbs, sendkeys)

315 views Asked by At

I need to type " into notepad with VBS script.

I have this code:

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "notepad"
wscript.sleep 500
WshShell.sendkeys "some "text""

But it shows an error.

1

There are 1 answers

5
NickSlash On BEST ANSWER

You need to double up the quotes inside or you can use chr(34)

Text = "my ""example"" of doubled quotes"
Text = "use " & Chr(34) & "chr ()" & Chr(34) & " function"