1

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.

ChrisJJ
  • 2,191
  • 1
  • 25
  • 38

1 Answers1

3

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.

ManoDestra
  • 6,325
  • 6
  • 26
  • 50
  • 1
    Thanks. That works so well that I'm not even going to ask why :) The bounty is well deserved. – ChrisJJ Apr 08 '16 at 18:59