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

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.
Who is Participating?
Justin OwensConnect With a Mentor ITIL Problem ManagerCommented:
Well, rather than detect, why not just script it to be off regardless?  That is much easier to code:

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.

BFanguyAuthor Commented:
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.

All Courses

From novice to tech pro — start learning today.