supertechhawaii Posted May 11, 2009 Posted May 11, 2009 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.exeThanks,supertechhawaii
iamtheky Posted May 11, 2009 Posted May 11, 2009 (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 May 11, 2009 by iamtheky
supertechhawaii Posted May 11, 2009 Author Posted May 11, 2009 iamtheky, Thanks so much for the reply this works like a champ on the script I am working on thanks,supertechhawaii
supertechhawaii Posted May 12, 2009 Author Posted May 12, 2009 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
iamtheky Posted May 12, 2009 Posted May 12, 2009 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.
supertechhawaii Posted May 12, 2009 Author Posted May 12, 2009 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 NE taskkill.exe"
iamtheky Posted May 12, 2009 Posted May 12, 2009 i suppose an operator would help the cause, glad you are making progress. mahalo.
supertechhawaii Posted May 12, 2009 Author Posted May 12, 2009 Thanks so much for all your help I got he script working perfectly.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now