当前位置: 动力学知识库 > 问答 > 编程问答 >

vbscript - How to write ("some text") within ("")?

问题描述:

Probably an easy question for most of you in here, but I cannot seem to get it right.

How do I make this line of code work?

MyFile.WriteLine("Set fso = CreateObject("Scripting.FileSystemObject")")

I understand why I get the error with ')' expected, but I just don´t know how to get around it.

The (" and ") wrapping the string Scripting.FileSystemObject is causing the problem.

In other words, I need to WriteLine EXACTLY the following:

Set fso = CreateObject("Scripting.FileSystemObject")

Thank you in advance:)

网友答案:

Double-up the "...like this:

MyFile.WriteLine("Set fso = CreateObject(""Scripting.FileSystemObject"")")
分享给朋友:
您可能感兴趣的文章:
随机阅读: