1
votes

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.

1
SendKeys wants a String argument use shell.SendKeys "{ENTER}". { and } are invalid characters that's what the error is. - engineersmnky

1 Answers

3
votes

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

shell.SendKeys "{ENTER}"