I have a Windows service that needs to be stopped and restarted when switching to a different development server (I'm a web developer.) If I go into the Services GUI, I can stop and restart the service with no problem. My colleague has a batch file that works for him, so I tried to use it, and it's giving me Access Denied errors. I've tried running the file as administrator, and even just running the commands directly in the cmd window. Still get the error.
The file is simply:
net stop "Service Integration Gateway" net start "Service Integration Gateway" pause
I found this answer on StackOverflow, and tried using the
runas command like this:
runas /user:Administrator net stop "Service Integration Gateway"
but all it did was give me the readme on
runas, so I'm guessing I can't use it with the
net stop command, or I'm using it wrong.
What do I need to do to be able to run these commands via CLI/batch?
EDITED TO ADD SCREENSHOT AS REQUESTED: