Start a program with the caps lock on

G

Guest

Is it possible to start a program enabling the caps lock to on?
I have tried to do this using dos and batchfiles but does not seem to work
with xp?
 
M

Mark F.

Markr said:
Is it possible to start a program enabling the caps lock to on?
I have tried to do this using dos and batchfiles but does not seem to work
with xp?

This is off topic here, however I have a solution for you. Cut and paste the
following into notepad. Save it as "capson.vbs" or whatever you like. Double
click the icon to run the script. When notepad opens start typing in CAPS.

-------- snip ------------------------------------------------------------
Set objShell = WScript.CreateObject("WScript.Shell")

objShell.Run "%windir%\notepad.exe"
objShell.AppActivate "Notepad"

objShell.SendKeys "{CAPSLOCK}"

-------- snip ------------------------------------------------------------

To run your favorite application with the caps on change the "run" path to
that application's path.

Mark
 
M

Mark F.

Sorry, forgot to mention. The AppActivate method should have the title of
the application you are running not "Notepad". You can omit it also.

Mark
 
A

Ayush

[Mark F.] wrote-:
-------- snip ------------------------------------------------------------
Set objShell = WScript.CreateObject("WScript.Shell")

objShell.Run "%windir%\notepad.exe"
objShell.AppActivate "Notepad"

objShell.SendKeys "{CAPSLOCK}"

This will just toggle the CapsLock state so if caps lock is on, then this will
disable it !


To OP, use AutoHotKey. Install:
http://www.autohotkey.com

And use this script:
;---------------
state := GetKeyState("Capslock", "T")
SetCapsLockState , On
RunWait, notepad ; < program path here
SetCapsLockState, % state ? "on" : "off" ; < restore the previous state
;---------------


Good Luck, Ayush.
 
G

Guest

Thanks,
Just the job

Ayush" <"ayushmaan.j[aatt]gmail.com said:
[Mark F.] wrote-:
-------- snip ------------------------------------------------------------
Set objShell = WScript.CreateObject("WScript.Shell")

objShell.Run "%windir%\notepad.exe"
objShell.AppActivate "Notepad"

objShell.SendKeys "{CAPSLOCK}"

This will just toggle the CapsLock state so if caps lock is on, then this will
disable it !


To OP, use AutoHotKey. Install:
http://www.autohotkey.com

And use this script:
;---------------
state := GetKeyState("Capslock", "T")
SetCapsLockState , On
RunWait, notepad ; < program path here
SetCapsLockState, % state ? "on" : "off" ; < restore the previous state
;---------------


Good Luck, Ayush.
 
M

Mark F.

Ayush said:
This will just toggle the CapsLock state so if caps lock is on, then this
will disable it !

You're right. It's been a while since I scripted and that was off the top of
my head. Also running scripts can be disabled by the Administrator so it may
not work on every machine.

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top