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

About The Author

Batch File Caps Lock Num Lock

Tom is an AutoCAD professional that has worked in all phases of CAD project delivery: Consultation, Sales, Project Management, Implementation and Support. This gives him a strong perspective to provide relevant, effective, and valuable CAD training to his students. He has been an AutoCAD professional since 1994, and has trained hundreds of people in the proper use and utilization of AutoCAD. He has trained throughout the US and Canada, and has been the manager of his own AutoCAD Training center in Jefferson County New York. He is a certified in AutoCAD at the Associate and Professional levels. He has taught at all levels, including Elementary School, Middle School, High School, and College. He has trained engineers, architects, soldiers, sailors and airmen. He finds training to be a joy, and continues to expand his training offerings, which now includes Revit.