Hi,
 
Do you ever think of ON/Off CapsLock, Scroll Lock, Numlock key using PowerShell, If Yes, then you are pretty creative person.
The laptop which i am using , it don't have a CAPSLOCK on/Off light , it showing software base indications, today one of my user faced the problem with the password, and capslock was enabled but there was no indications about it on the screen,
 
Somehow i sorted the problems using external keyboard.
Then I thought let me see if I manage to make these keys on/off using PowerShell.
So , here is the script for it., a pretty simple and straight forward.
 

Click here to know more about the script http://newdelhipowershellusergroup.blogspot.in/2013/10/on-off-keyboard-lock-keys-capsscrollnum.html

NOte: When you run this script, this will on all lock keys ;o)

 

Best Regards!

Aman Dhally 

Come and join my journey of 100 Days of Self Improvement programme: https://www.facebook.com/100DoSI or at www.amandhally.net   

MY PowerShell Blog : http://newdelhipowershellusergroup.blogspot.com/ 

MY Personal Website: www.amandhally.net

 

 

PowerShell
Edit|Remove
#==================| Satnaam Waheguru Ji |=============================== 
#            
#            Author  :  Aman Dhally  
#            E-Mail  :  amandhally@gmail.com  
#            website :  www.amandhally.net  
#            twitter :   @AmanDhally  
#            blog    : http://newdelhipowershellusergroup.blogspot.in/ 
#            facebook: http://www.facebook.com/groups/254997707860848/  
#            Linkedin: http://www.linkedin.com/profile/view?id=23651495  
 
#            Creation Date    : 08-09-2013 
#            File    :          Playing with KeyBaord  
#            Purpose :  
#            Version : 1  
#              Message : " I am MVP Now", Yippy! 
# 
#            My Pet Spider :          /^(o.o)^\   
#======================================================================== 
 
 
# Creating a WScript.Shell onject  
 $keyBoardObject = New-Object -ComObject WScript.Shell 
 
# CAPSLOCK / SCROL LOCK /  Num Lock key Status  
 
# Getting the status of Keys using .Net Object , this result of the ISkeyLock is in Boolean 
 
# Capsock 
 $capsLockKeySatus = [System.Windows.Forms.Control]::IsKeyLocked('CapsLock') 
 
#Numlock  
 $numLockKeySatus = [System.Windows.Forms.Control]::IsKeyLocked('NumLock') 
 
 
#scrollLock 
  $ScrollLockKeySatus =  [System.Windows.Forms.Control]::IsKeyLocked('Scroll') 
 
 
#---- process starts form here  
 
# checking caps lock  
 
 if ( $capsLockKeySatus -eq $false )  
    { 
        Write-Host "Capslock key is off"  
         
        # if you want to ON the CapsLock {IF CAPSLOCK IS ALREADY OFF }, then please unComment the below Command. 
          $keyBoardObject.SendKeys("{CAPSLOCK}") 
    }  
 
else {          
        Write-Host "Capslock key is On"  
         
        # if you want to OFF the CapsLock Key {IF CAPSLOCK IS ALREADY on }, then please unComment the below Command. 
        #-->   $keyBoardObject.SendKeys("{CAPSLOCK}") 
         
    } 
 
# Checking ScrollOck 
 
 if ( $ScrollLockKeySatus -eq $false )  
    { 
        Write-Host "Scroll Lock key is off"  
         
        # if you want to ON the ScrollLoc {IF ScrollLock IS ALREADY OFF }, then please unComment the below Command. 
        $keyBoardObject.SendKeys("{SCROLLLOCK}") 
    }  
 
else {          
        Write-Host "Scroll Lock key is On"  
         
        # if you want to OFF the CapsLock Key {IF CAPSLOCK IS ALREADY on }, then please unComment the below Command. 
        #-->  $keyBoardObject.SendKeys("{SCROLLLOCK}") 
         
    } 
 
 
# Checking NumLock 
 
 if ( $numLockKeySatus -eq $false )  
    { 
        Write-Host "NumLock Lock key is off"  
         
        # if you want to ON the ScrollLoc {IF ScrollLock IS ALREADY OFF }, then please unComment the below Command. 
         $keyBoardObject.SendKeys("{NUMLOCK}") 
    }  
 
else {          
        Write-Host "NumLock Lock key is On"  
         
        # if you want to OFF the CapsLock Key {IF CAPSLOCK IS ALREADY on }, then please unComment the below Command. 
        #-->   $keyBoardObject.SendKeys("{NUMLOCK}") 
         
    } 
 
 
 
 
 
 
 
 
 
 
#-----------end of the script ----------------------#