Batch File Caps Lock Num Lock ⚡ Original
To force a key to be "ON" only if it is currently "OFF," use PowerShell to check the status first.
powershell.exe -Command "IF ([console]::CapsLock -eq 'False') { ... }" Super User Batch File Caps Lock Num Lock
You can call a one-line PowerShell command from within your batch file to toggle or force a specific state. To force a key to be "ON" only
powershell.exe -Command "$wsh = New-Object -ComObject WScript.Shell; $wsh.SendKeys('{CAPSLOCK}')" Batch File Caps Lock Num Lock