[VBScript] vbs error unfinished error string constant

Contents of this article

1. Problem description

2. Cause of the problem

3. Solution


1. Problem description

Today, when I was reading Chapter 10 of "How Computers Run" (try to encrypt data), when I used VBScript to write a pop-up window on a Windows 10 computer, I clearly copied it according to the sample program in the book. Editing Tool It's Notepad++. After copying, just save it with the .vbs suffix. But when running, an "unterminated string constant" error is reported.

  

2. Cause of the problem

The default character encoding when using Notepad ++ is UTF-8. I checked it several times against the sample program and there was no problem. However, when I checked online, the reason turned out to be a problem with the character encoding.

3. Solution

The solution is simple, just change the default character encoding UTF-8 to  ANSI encoding  . You can refer to the method shown in the figure below:

end!

Supongo que te gusta

Origin blog.csdn.net/xiaowang_lj/article/details/135220628
Recomendado
Clasificación