title: How to stop a vb script running in windows
body: <p>I'm using windows 7</p>
  
  <p>I wrote a script to check whether My Laptop is running in Battery or AC current.
  I googled it and succedded in that.</p>
  
  <pre><code>dim a
  a=1
  Do While a=1 
  If IsLaptop( "." ) Then
     ' WScript.Echo "Laptop"
  Else
     ' WScript.Echo "Desktop or server"
  End If
  Loop
  
  Function IsLaptop( myComputer )
      On Error Resume Next    
      Set objWMIService = GetObject( "winmgmts://" &amp; myComputer &amp; "/root/cimv2" )
      Set colItems = objWMIService.ExecQuery( "Select * from Win32_Battery", , 48 )
      IsLaptop = False
      For Each objItem in colItems
          if objItem.BatteryStatus=2 and objItem.EstimatedChargeRemaining=98 then
               WScript.Echo "Remove Ac Adapter Immediately"
          elseif objItem.BatteryStatus=1 and objItem.EstimatedChargeRemaining=10 then
               WScript.Echo "Pluggin to charger immediately"
          end if
      Next
      If Err Then Err.Clear
      On Error Goto 0
  End Function
  </code></pre>
  
  <p>But my problem now is. This script is ever running script how to stop if i wish to terminate manually.</p>
  
  <p>Is there any way i go and find this process and stop in windows?</p>