How to stop a vbscript running in windows

前端 未结 5 1685
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-28 22:00

I\'m using windows 7

I wrote a script to check whether My Laptop is running in Battery or AC current. I googled it and succedded in that.

dim a
a=1
D         


        
5条回答
  •  难免孤独
    2020-12-28 22:47

    in your code, just after 'do while' statement, add this line..

    `Wscript.sleep 10000`
    

    This will let your script sleep for 10 secs and let your system take rest. Else your processor will be running this script million times a second and this will definitely load your processor.

    To kill it, just goto taskmanager and kill wscript.exe or if it is not found, you will find cscript.exe, kill it pressing delete button. These would be present in process tab of your taskmanager.

    Once you add that line in code, I dont think you need to kill this process. It will not load your CPU.

    Have a great day.

提交回复
热议问题