Enable Caps Lock (uppercase) key with VBScript implementation _vbs
Source: Internet
Author: User
Ask:
Hey, scripting guy!. I have a script where users enter some information in a Input box. The information needs to being entered in all-capital letters, so I instructions say, "Please make sure the Caps Lock key is On before entering the information. They don ' t always doing that, however. Are there a way to turn the Caps Lock key in and off using a script?
-BW, Medford, or
For:
Hey, BW. We don ' t know of a way to turn the Caps Lock key on and off, but we did know a way to mimic the effect the have the Caps L Ock key on. After all, the whole point of the Caps Lock key was to turn everything your type into uppercase letters. For example, your might type this:
This is my sentence.
But Caps Lock'll make it appear on screens like this:
This is my sentence.
So can we achieve the same affect in a script? Simple: We just use the VBScript function UCase, which switches all the Lette RS in a string to their uppercase equivalent. For example, here's a simple two-line script this gathers information from a user and then uses the UCase function to Swit CH all the letters to uppercase when echoing the "value to" screen:
strmessage = InputBox ("Please enter your message:") WScript.Echo UCase (strmessage)
Incidentally, the above script doesn ' t actually change the case of the letters in the string strmessage; It just displays them in uppercase. If you are really want the letters converted to uppercase, try this script instead:
strmessage = UCase (InputBox ("Please enter your message:") WScript.Echo strmessage
Looks crazy, but it works.
For more information about the UCase function, the Thevbscript document on MSDN.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.