How to avoid this WriteLine failure in TextPad tool?

111 Views Asked by At

Cscript.exe with this script

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

works fine in a CMD window but in a TextPad tool fails with

Microsoft VBScript runtime error: Invalid procedure call or argument

How can I remedy this?

Changing Tool Output default encoding does not remedy this. https://i.stack.imgur.com/0xFqH.png https://i.stack.imgur.com/wBy3u.png https://i.stack.imgur.com/f7FZJ.png

I am running TextPad 7.5.1 in Windows 7 Pro 64-bit.

1

There are 1 best solutions below

1
On BEST ANSWER

I reproduced your error by running your command via WScript.

Change your code to use the WScript.Echo command instead of the WScript.StdOut.WriteLine command. E.g.

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

This command works in both CScript and WScript. So, this should work for you in your TextPad tool as a valid VBA command.