Albert MN.
Albert MN.

Reputation: 730

How to kill a task in batch?

I am having problems with the taskkill in batch, I am trying to kill a vbscript that is in sleep for an x amount of seconds. So basically I want to kill this task: https://i.sstatic.net/rxgAL.png

But I somehow seem to get it wrong, I have no clue what part of the task I have to write in the taskkill x

Thank you in advance!

Upvotes: 3

Views: 8397

Answers (3)

user4946917
user4946917

Reputation:

VBScripts do have a timeout parameter - see cscript /?.

taskkill /im wscript.exe /im cscript.exe /f

will kill all running vbscripts.

If you want to be particular how do you tell the running scripts apart.

Upvotes: 2

aphoria
aphoria

Reputation: 20179

This will kill it without knowing the pid, however it will kill all instances of wscript.exe.

TASKKILL /F /IM wscript.exe

Upvotes: 3

MTahir
MTahir

Reputation: 1171

From the task manager top menu, select to show the Process ID for this running process.

Then on command prompt,

  taskkill /pid 1234

Where 1234 id the Process ID you want to kill.

Upvotes: 2

Related Questions