0

I cant get this to work hope u get idea. I am trying to kill tasks by taking task list from my file...

echo off
set Taskkill_DB "C:\Users\jokbo\Desktop\CMD NEXT\Taskkill_DB.txt"
for /f tokens=* %%A in (%Taskkill_DB%) do (taskkill /F /T %%A >nul 2>&1)
pause
Jokbon
  • 11

1 Answers1

1

I can only fix your code based on your existing code example. Without seeing the actual data, I can only guess what it is in your text file.

echo off
set "Taskkill_DB=C:\Users\jokbo\Desktop\CMD NEXT\Taskkill_DB.txt"
for /f "usebackq tokens=*" %%A in ("%Taskkill_DB%") do (taskkill /F /T %%A>nul 2>&1)
pause
Squashman
  • 13,649
  • 5
  • 27
  • 36
  • 1
    @Jokbon, just want to let you know that if you read the help file for the `/F` option of the `FOR` command you could have easily seen the mistakes you were making. – Squashman May 15 '18 at 19:06
  • @Jokbon, same goes for the `SET` command. The syntax clearly shows the usage of the equals symbol. – Squashman May 15 '18 at 19:15
  • @Jokbon if you feel that this user assisted you in resolving your issue, please consider selecting it as the correct answer by selecting the grey tick mark on the left side of the answer. – Gerhard May 15 '18 at 19:57