I've obtained a batch file from the internet:
@for /f "tokens=5 delims= " %%i in ('netstat -ano -p tcp ^| find "127.0.0.1"') do Taskkill /F /PID %%i
This kills the Ultrasurf process, however, what I would like to do is have it check for this same process and then shutdown if present.
I have tried the following:
@for /f "tokens=5 delims= " %%i in ('netstat -ano -p tcp ^| find "127.0.0.1"') do shutdown /s
This issues a shutdown command whether the process is running or not. I need it to execute only if present. Any help would be appreciated.