如何避免 TextPad 工具中的 WriteLine 失败?

How to avoid this WriteLine failure in TextPad tool?

Cscript.exe 使用此脚本

 Wscript.StdOut.WriteLine( "Test " & ChrW(&H2460))

在 CMD window 中工作正常,但在 TextPad 工具中失败

Microsoft VBScript runtime error: Invalid procedure call or argument

我该如何补救?

更改工具输出默认编码并不能解决这个问题。 http://i.imgur.com/dSF1XEt.png http://i.imgur.com/UIxh5cU.png http://i.imgur.com/80qob5n.png

我是 运行 TextPad 7.5.1 Windows 7 Pro 64 位。

我通过 WScript 运行 你的命令重现了你的错误。

更改您的代码以使用 WScript.Echo 命令而不是 WScript.StdOut.WriteLine 命令。例如

WScript.Echo "Test " & ChrW(&H2460)

此命令适用于 CScript 和 WScript。因此,这应该作为有效的 VBA 命令在您的 TextPad 工具中为您工作。