Why not .SendKeys ?

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
Posts: 1
Last visit: Mon Jan 19, 2015 7:28 am

Why not .SendKeys ?

Post by jragan18 »

Why do most VBScript writers HATE to use SendKeys ?

I use it a lot and I have never had trouble with it.

What I hear most is that it does not work often enough and it bugs out a lot.

I am not sure what "bugs out a lot" means or in what instance it is that it does not work.

Can somebody who has had a lot of experience with this please fill me in?

FYI, I do not use this for pushing server side installs and understand the issues with that.

User avatar
SAPIEN Support Forums
Posts: 945
Last visit: Wed Dec 31, 1969 4:00 pm

Why not .SendKeys ?

Post by SAPIEN Support Forums »

This is an automated post. A real person will respond soon.

Thank you for posting, jragan18.

Here are some hints to help you get an accurate and complete answer to your question.

Ask in the best forum: If you asked in the wrong forum, just copy your question to the right forum.

Anticipate follow-up questions!

Did you remember to include the following?
  • 1. Product, version and build
    2. 32 or 64 bit product
    3. Operating system, e.g. Windows 7 64 bit.
    4. Attach a screenshot, if applicable
    5. Attach logs, crash reports, etc., in a ZIP file
If not, please take a moment to edit your original post or reply to this one.

*** Make sure you do not post any licensing information ***

Posts: 14706
Last visit: Sat Feb 27, 2021 5:46 am
Answers: 9
Has voted: 2 times
Been upvoted: 6 times

Re: Why not .SendKeys ?

Post by jvierra »

SendKeys is not usable in a commercial way because other programs very often interfere with it. There is no way to prevent this. If you are lucky it will work. SendKeys is not supported by Microsoft anymore (deprecated). It was carried over from Windows 98 for compatibility reasons.

The internal SendKeys used in a form to send keys to the form is usable but that is not the same SendKeys.

The issue with SendKeys is that it targets the active window. The active window can change in an instant and the keystroke will end up in the wrong application which could be disastrous.