Jump to content

Recommended Posts

Posted

Aloha,

I have been trying to create a taskkill script. Can someone please take a look at it and tell me what is wrong with it :)

taskkill /F /FI "username eq %username% ne /im explorer.exe

Thanks,

supertechhawaii


Posted (edited)

taskkill /F /FI "username eq %username%" /FI "IMAGENAME ne explorer.exe"

missing quotes (probably just left off the posting), and it read everything after username as an argument towards that filter.

Edited by iamtheky
Posted

Aloha iamtheky,

Is it posible to setup 2 filters (/FI) in the same statement?

taskkill /F /FI "username eq %username%" /FI "IMAGENAME ne explorer.exe" /FI "IMAGENAME ne cmd.exe"

I do not want my cmd prompt to be killed when I run my taskkill. I have several more steps to run after the taskkill is finished.

Thanks,

Brian

Posted

taskkill /F /FI "username eq %username%" /FI "IMAGENAME ne explorer.exe" /FI "IMAGENAME ne cmd.exe" /FI "IMAGENAME taskkill.exe"

add the taskkill to the exempt list as well if you are echoing, otherwise they see the ERROR: for the PID showing that taskkill cant kill itself.

Posted

Aloha iamtheky,

Thanks for you help... however, for some reason, I get an error:

ERROR: The search filter cannot be recognized.

Does the script need to say:

taskkill /F /FI "username eq %username%" /FI "IMAGENAME ne explorer.exe" /FI "IMAGENAME ne cmd.exe" /FI "IMAGENAME :whistle: NE :whistle: taskkill.exe"

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...