Previous in Forum: Image Recognition   Next in Forum: Spam Obfuscation
Close
Close
Close
2 comments
Rate Comments: Nested
Guru
Popular Science - Weaponology - bwire Hobbies - Car Customizing - New Member

Join Date: Dec 2007
Location: Upper Mid-west USA
Posts: 7498
Good Answers: 97

VBS Program Question

03/08/2011 2:26 PM

I have this script that I run prior to running one program. 'VBScript Example Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.SendKeys "{CAPSLOCK}" This will turn the caps lock on and the database that I built uses all caps. The program that I wrote used to turn on caps but that doesn't work in Vista for some reason. The above script is a simple work around. The problem is sometimes the caps lock is already on and then the script turns it off. I don't know how to write a script that would check first to see if caps lock is on and if it is leave it alone but if it's off then turn it on. Any help appreciated.

__________________
If death came with a warning there would be a whole lot less of it.
Register to Reply
Pathfinder Tags: VBS
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Good Answers:

These comments received enough positive votes to make them "good answers".
2
Guru
Popular Science - Cosmology - New Member Engineering Fields - Civil Engineering - New Member Engineering Fields - Nuclear Engineering - New Member United States - Member - New Member

Join Date: Aug 2010
Posts: 714
Good Answers: 38
#1

Re: VBS Program Question

03/08/2011 5:06 PM

hope this helps....

My.Computer.Keyboard.CapsLock this is a boolean that returns true if the caps is on and false if it is off.

adding an if/then statement sounds like it would do the trick... something like...

if My.Computer.Keyboard.CapsLock then

else if

<Your scripting>

end if

__________________
Sometimes my thoughts are in a degree of order so high even I don't get it...
Register to Reply Good Answer (Score 2)
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#2
In reply to #1

Re: VBS Program Question

03/08/2011 6:18 PM

Sounds good to me.

Like to hear whether it works .

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply Off Topic (Score 5)
Register to Reply 2 comments

Good Answers:

These comments received enough positive votes to make them "good answers".

Previous in Forum: Image Recognition   Next in Forum: Spam Obfuscation

Advertisement