How to Output Quotation Marks in VBS
VisualBasic Script, or VBS, is a powerful scripting language designed to make it easy to automate simple, but repetitive, tasks on a Windows computer. It is distinct from the Visual Basic programming language and, unlike that language, comes installed automatically on all Windows computers. This means you can write and run VBS commands on any Windows computer without special software. However, one early problem faced by many new VBS scripters is how to output quotation marks within a string of characters. This is because VBS uses the quotation marks for its own purposes to tell when the string begins and ends.
Instructions
-
-
1
Open a text editor.
-
2
Paste the following:
WScript.Echo "A single quote - ' "
Everything is as expected: to post a single-quote, simply type the single-quote character on your keyboard. If you save this as "quote.vbs" and double-click the file on your desktop, a message will appear with the following text:
A single quote - '
The double-quote is a little more tricky, however.
-
-
3
Paste the following:
WScript.Echo "A double quote - "" "
Save your work in a file named "quote.vbs" and double-click it. The following dialog will appear on your screen immediately:
A double quote - "
As you can see, to output a double quotation mark in VBS, you must place two double-quotation marks directly next to one another.
-
1