S
S
Solota2021-07-15 15:08:07
Python
Solota, 2021-07-15 15:08:07

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

1 answer(s)
S
Sergey Ryzhkin, 2021-07-15
@Franciz

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 question

Ask a Question

731 491 924 answers to any question