So this question is VERY similar to this question, with this answer. But some of my processes have a space in the name, and CMD returns nothing. My original question has been answered in this answer, this question is asking how would I do this, but with spaces in the process name.
Code so far:
FOR /F "usebackq tokens=1-10" %%i IN (`tasklist ^|findstr /b "nvsphelper64.exe"`) DO taskkill /F /PID %%j
FOR /F "usebackq tokens=1-10" %%i IN (`tasklist ^|findstr /b "nvcontainer.exe"`) DO taskkill /F /PID %%j
FOR /F "usebackq tokens=1-10" %%i IN (`tasklist ^|findstr /b "NVIDIA Share.exe"`) DO taskkill /F /PID %%j
pause
I already tried putting '
around NVIDIA Share.exe
, and I also tried putting "
around it as well, but it still ignores that line when executing.
(I have tried executing as a 32bit exe as admin, and as batch as admin and without admin, but to no avail.)