Answer the question
In order to leave comments, you need to log in
Access is denied. The -c 1 option requires administrator rights. | What does it mean?
When I run this script in cmd I get this error: Access denied. The -c 1 option requires administrator privileges . How to get rid of it?
import subprocess
internet = False
while not internet:
try:
subprocess.check_call(["ping", "-c 1", "www.google.ru"])
print("Internet is up again!")
internet = True
except subprocess.CalledProcessError:
print("Internet is still down :(")
Answer the question
In order to leave comments, you need to log in
CMD must be run "as administrator" then this error will not occur. In fact, this is the runas command, but there will be explicit logins and passwords.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question