Solved

Detect if a 2008R2 Remote Desktop user has caps lock on or off in vbscript

Posted on 2012-04-03
2
647 Views
Last Modified: 2012-04-03
I have scripts that read an ini file and sendkeys for user id and password to open programs.  The data in the ini file is uppercase, but when I use sendkeys it only works if the user does not have caps lock on.  i.e.  it reads BFANGUY from the ini file, but if i have my caps lock on, the script sends bfanguy to the login screen.  This behavior did not happen on 2003R2 terminal server.

I am guessing I need to check to see if the user has caps lock on, turn it off, sendkeys, then turn it back on.

any help would be greatly appreciated.
0
Comment
Question by:BFanguy
2 Comments
 
LVL 31

Accepted Solution

by:
DrUltima earned 500 total points
ID: 37802500
Well, rather than detect, why not just script it to be off regardless?  That is much easier to code:

http://www.computing.net/answers/programming/command-turn-onoff-capslock-key-in-bat-file/21542.html

Look in the first half of the included script (before the BATCHSCRIPT). The second half was on how to make a batch file run the vbscript code in the first half.

DrUltima
0
 

Author Closing Comment

by:BFanguy
ID: 37803292
thanks
0

Featured Post

Want to promote your upcoming event?

Attending an event? Speaking at a conference? Or exhibiting at a tradeshow? Easily inform your contacts by using a promotional banner in your email signature. This will ensure your organization’s most important contacts are in the know.

Join & Write a Comment

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now