user4971720
user4971720

Reputation:

VBScript SendKeys 800A0408 Invalid Character

I'm getting this compilation error with a script I was working on using WScript.SendKeys. Yes, I have saved the .vbs file to be encoded as ANSI. It says the error is on Line 48, which is this:

shell.SendKeys {ENTER}

The rest of the script works just fine if I take this line out, in case that's important.

Upvotes: 1

Views: 888

Answers (1)

Bond
Bond

Reputation: 16311

You need to enclose {ENTER} in quotes. SendKeys expects a string parameter.

shell.SendKeys "{ENTER}"

Upvotes: 3

Related Questions