How to kill a windows service with a space in the name using taskkill within a batch file
I am attempting to write a batch file that开发者_如何学Go kills the windows audio service using the following
taskkill /F /FI "Services eq Windows Audio"
however I am unable to get taskkill to handle the space in the service name. Any ideas?
Thanks
Rather than use taskkill
, why can't you use net stop
:
net stop "Windows Audio"
net stop
will let the service stop gracefully.
精彩评论