0

I want to stop and or start a service when I run my Python code. But, unless I run cmd as admin I can't do so. How would I go about fixing this?

p1 = subprocess.run(['sc', 'start', 'AdobeARMservice'], shell=True, text=True, capture_output=True)
print(p1.stdout)

Output: [SC] StartService: OpenService FAILED 5: Access is denied.

1 Answers1

0

You can run python script with sudo or give that user permission to run start that service.

heydar dasoomi
  • 527
  • 1
  • 4
  • 19