Page 1 of 1

[help]Batch Script to Toggle Numlock?

Posted: 05 Jun 2012 09:07
by Dos_Probie
Calling all Dos Guru's!!

Am using Windows 7 and need the ability to toggle the {NUMLOCK} on and off from the commandline via batch.
I know there are .vbs scripts, 3rd party apps and possible registry entries
that will do this but would Perfer doing this via a batch file.The only documentation I could find was a Microsoft support site at: http://support.microsoft.com/kb/151715
but this uses a 16-bit debug.com file that W7 does not support.

Thanks again for your help in this..

Dos_Probie :shock:

Re: [help]Batch Script to Toggle Numlock?

Posted: 05 Jun 2012 23:40
by foxidrive
Dos_Probie wrote:I know there are .vbs scripts, 3rd party apps and possible registry entries
that will do this but would Perfer doing this via a batch file.


What is wrong with using a third party tool or scripts or registry entries?
How do you think a batch file is doing to do it?

There are no native batch commands to do this - possibly a debug script can do it but then you are still using scripts.

Re: [help]Batch Script to Toggle Numlock?

Posted: 06 Jun 2012 03:10
by Dos_Probie
There are no native batch commands to do this - possibly a debug script can do it but then you are still using scripts.


Good answer Foxi..I came to the same conclusion, that dos by itself can't do the keystrokes natively, but since
this is a Dos forum I wanted to use dos as much as possible without relying on other methods. I personally like to
do as much "hands free" as possible and dos seems to allow that over the other methods.The 3rd party apps usually
require user interaction and mouse clicks unless I use AutoIt, Vbs is great but if there is an error it will
stall out on you waiting for a response unlike dos that is more forgiving and registry hacks work but I perfer using reg add and reg delete
when possible via commandline. Finally someone on here has a Helpful answer without the sarcasm like some other members.

Thanks, again
Dos_Probie 8)

Re: [help]Batch Script to Toggle Numlock?

Posted: 06 Jun 2012 06:36
by foxidrive
The point about VBS scripts is not valid, as you will presumably be running a script that is tested and will never fail.

We *do* aim for command line options here and not gui programs unless you need to get input - when you can opt for several styles of getting input.
So don't knock a VBS script if someone offers you one that solves your task...

Re: [help]Batch Script to Toggle Numlock?

Posted: 06 Jun 2012 07:27
by Dos_Probie
The point about VBS scripts is not valid


Point taken, I Do use .vbs a lot and ALWAYS fully test before I go Live, but what I should HAVE said is if for example the .vbs is dependent on another .exe file to install so it can do its job and for whatever reason the .exe does not then the .vbs will stall out with a line code etc and will fail as with dos it will contintue to run and complete.

Re: [help]Batch Script to Toggle Numlock?

Posted: 07 Jun 2012 14:45
by Ed Dyreen
'
STACKEY, a utility from the makers of CTRLALT, will automatically place keystrokes in your keyboard buffer. It is intended for use in connection with BATch files.

You can stack any function key or legal Alt-key combination; you can even stack today's date or the current directory name. You can stack commands to turn the Num Lock state on and off. You can stack commands to set colors on the CGA and remap colors on the EGA or VGA. You can stack a PrtSc. You can stack commands to call up SIDEKICK, SIDEKICK PLUS or any other program that pops up on pairs of shifts. You can invoke CTRLALT PLUS, CAROUSEL or DESQVIEW. STACKEY has numerous methods for controlling the flow of a STACKEY "script". You can put delays in or have STACKEY delay its playback until a given message appears on the screen or you can have script playback pause until you hit a key. You can pause playback and later restart it with appropriate hotkeys and even flush STACKEY's buffer that way. STACKEY scripts can even branch depending on what hot key is hit or what message appears on the screen.