Toggle NumLock in batch file
Results 1 to 6 of 6

Thread: Toggle NumLock in batch file

  1. #1
    Join Date
    Jun 2001
    Location
    Jacksonville,Fl,USA
    Posts
    341

    Toggle NumLock in batch file

    Is there a way to toggle the NumLock key in a batch file?

    Thanks, Dex

  2. #2
    Join Date
    Feb 2000
    Location
    26.03°N 80.14°W
    Posts
    9,410
    If you have DEBUG.EXE somewhere in your PATH, running the following MAKE-NUM.BAT will create two little utilities:
    1. NUMON.COM

      which flips Num-Lock ON, and
    2. NUMOFF.COM

      which flips Num-Lock OFF.
    Code:
    @echo off
    cls
    echo Creating NUMON.COM ...
    echo nnumon.com>~.scr
    echo e0100 BA 40 00 8E DA A0 17 00 0C 20 A2 17 00 C3>>~.scr
    echo rcx>>~.scr
    echo E>>~.scr
    echo w>>~.scr
    echo q>>~.scr
    debug<~.scr>nul
    del ~.scr
    dir numon.com
    echo.
    echo Creating NUMOFF.COM ...
    echo nnumoff.com>~.scr
    echo e0100 BA 40 00 8E DA A0 17 00 24 DF A2 17 00 C3>>~.scr
    echo rcx>>~.scr
    echo E>>~.scr
    echo w>>~.scr
    echo q>>~.scr
    debug<~.scr>nul
    del ~.scr
    dir numoff.com
    Vernon Frazee, Microsoft MVP (Windows - Shell/User)

    Defenses Up!
    Tip: When prompted for a password, give an incorrect one first. A phishing site will accept it; a legitimate one won't.


    Inside Spyware: A Guide to Finding, Removing and Preventing Online Pests


    If you don't keep up with security fixes, your computer|network won't be yours for long.

  3. #3
    Join Date
    Jun 2001
    Location
    Jacksonville,Fl,USA
    Posts
    341
    Thanks again Vernon. One of the few things in DOS that I've seen almost zero documentation on is the DEBUG program.

    I'll have to search for some links.

    Dex

  4. #4
    Join Date
    Feb 2000
    Location
    26.03°N 80.14°W
    Posts
    9,410
    Vernon Frazee, Microsoft MVP (Windows - Shell/User)

    Defenses Up!
    Tip: When prompted for a password, give an incorrect one first. A phishing site will accept it; a legitimate one won't.


    Inside Spyware: A Guide to Finding, Removing and Preventing Online Pests


    If you don't keep up with security fixes, your computer|network won't be yours for long.

  5. #5
    Join Date
    Jun 2001
    Location
    Jacksonville,Fl,USA
    Posts
    341
    Thanks for the Debug links. Lots of good reading.
    BTW - You might get a smile out of knowing why I needed
    your numoff.com command so bad. I'm basically a creature
    of habit, and at work, use a laptop with DOS 6.22 on it.

    The last two lines of my autoexec.bat file are now:

    DOSKEY d5r=numoff$Tdir
    DOSKEY c3s=numoff$Tcls

    I think you probably get the signifigance of this.
    A small frustration has now disappeared.

    Dex
    Last edited by Dexahol; February 27th, 2003 at 05:31 PM.

  6. #6
    Join Date
    Feb 2000
    Location
    26.03°N 80.14°W
    Posts
    9,410
    Yep. Good to hear it worked.
    Vernon Frazee, Microsoft MVP (Windows - Shell/User)

    Defenses Up!
    Tip: When prompted for a password, give an incorrect one first. A phishing site will accept it; a legitimate one won't.


    Inside Spyware: A Guide to Finding, Removing and Preventing Online Pests


    If you don't keep up with security fixes, your computer|network won't be yours for long.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •