I wanted to make a batch script for killing a process with some process id. I scripted a few cmd commands as:
echo " So what is the process id that is blocking tcp.."
set /p prcs_id="Enter the process id of the process you want to terminate :"
pause
echo I got the process id: %prcs_id%
pause
taskkill /PID %prcs_id% /F
But the taskkill code gives me the error as such :
ERROR: Invalid syntax. Value expected for /PID
What might be the possible cause for this- since when I run the command as it is in cmd I get no error...
echoon, so that you can see exactly the command that is giving you the syntax error. I think something unexpected is ending up in%prcs_id%. I tried your code, and did not have a problem.