How to stop a vbscript running in windows

前端 未结 5 1670
爱一瞬间的悲伤
爱一瞬间的悲伤 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 23:01

    I can think of at least 2 different ways:

    1. using Task Manager (Ctrl-Shift-Esc), select the process tab, look for a process name cscript.exe or wscript.exe and use End Process.

    2. From the command line you could use taskkill /fi "imagename eq cscript.exe" (change to wscript.exe as needed)

    Another way is using scripting and WMI. Here are some hints: look for the Win32_Process class and the Terminate method.

提交回复
热议问题