• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 476
  • Last Modified:

How-to lock keyboard and mouse with WSH

How can we lock the keyboard and the mouse (or prevent all user input) while executing some operations with WSH (windows scripting host : VBScript or JavaScript) ?

Context:

I have to start an application in WSH and use the sendKey fonction to automate its configuration. I don't want the user to be able to interfere with the process.
The WSH will run under Win2k professional.
I will preferably do it without having to install any third party components.

Thank you,
Claude
0
cml
Asked:
cml
1 Solution
 
TimCotteeHead of Software ServicesCommented:
Claude, even if you can lock keyboard and mouse, how will the application receive the sendkeys as these are keyboard inputs. You defeat the object by attempting this. You should look at another way of passing this configuration that cannot be interfered with by the user.
0
 
VincentLawlorCommented:
Have a look at the Application.Lock method for VB script.

This might do what you want.

Vin.
0
 
cmlAuthor Commented:

Someone could trap all mouse and keyboard events, and drop all events except those you generate your self.

0
 
DanRollinsCommented:
Hi cml,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept TimCottee's comment(s) as an answer.

cml, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
Computer101Commented:
Comment from expert accepted as answer

Computer101
E-E Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now