How to end VBScript on Windows 10?

I accidently did a cd-drive vbs prank on myself on windows 10 and I can't find the wscript.exe file.. Is there any way to end this program?


Your script probably runs elevated so could become invisible in normal unelevated task manager. Run it elevated as well.

Another approach: open an elevated command line window. Then, taskkill /? could suggest a solution (or read taskkill: End one or more processes by process ID or image name article).

To find process ID of any running Windows scripting engine i.e either wscript.exe or cscript.exe, type

tasklist | findstr /I "PID script.exe"

and search for .vbs i.e. VBScript file extension:

wmic process where "CommandLine like '%.vbs%' and name != 'wmic.exe'" get /value

and search for your script file name (let's say cdprank.vbs):

wmic process where "CommandLine like '%cdprank%' and name != 'wmic.exe'" get /value

Best option according to me is

1) Open Task Manager

2) Go to the processes tab

3) Right-click on Name header and click command line (to show Command line)

4) Under command line look for "C:\Windows\System32\WScript.exe" "yourfilename.vbs"

5) Right-click and end task


Look for something called "Microsoft Windows Based Script Host" in the running processes. End this process and you should be fine.