Batch Script to Toggle Numlock?
Posted: 05 Jun 2012 17:52
This is in response to my earlier post..
After some digging around I found a backdoor way.
Maybe this will help someone else ...
:ToggleNumlock.cmd
:==================+
@echo off
setlocal
set _prompt=%1
:: Create the VBS script with an echo statement and chain with colon:
echo set WshShell = CreateObject("WScript.Shell") : WshShell.SendKeys "{numlock}">%Temp%\Numlock.vbs
:: Runs the vbScript:
FOR /f "delims=/" %%G IN ('cscript //nologo %Temp%\Numlock.vbs') DO set _string=%%G
:: Delete vbScript:
del %Temp%\Numlock.vbs
After some digging around I found a backdoor way.
Maybe this will help someone else ...
:ToggleNumlock.cmd
:==================+
@echo off
setlocal
set _prompt=%1
:: Create the VBS script with an echo statement and chain with colon:
echo set WshShell = CreateObject("WScript.Shell") : WshShell.SendKeys "{numlock}">%Temp%\Numlock.vbs
:: Runs the vbScript:
FOR /f "delims=/" %%G IN ('cscript //nologo %Temp%\Numlock.vbs') DO set _string=%%G
:: Delete vbScript:
del %Temp%\Numlock.vbs