Venkat
Venkat

Reputation: 31

b'Access denied. Option -c requires administrative privileges

I am getting the below error in python when trying to use below line in code:

ping = subprocess.Popen(     ["ping", "-c", "3", host],

error:

b'Access denied. Option -c requires administrative privileges.\r\n..     

I am using Atom IDE and windows 10 laptop. How do I resolve this issue?

Upvotes: 3

Views: 1971

Answers (2)

avanisagar
avanisagar

Reputation: 101

You need to use option -n while running the script on Windows. The following will work.

ping = subprocess.Popen(["ping", "-n", "3", host])

Upvotes: 2

Qwerty
Qwerty

Reputation: 1267

You need to run the file as administrator. The command you are trying to use requires administrator privileges to use the -c option. Either remove the -c option, (which I don't know if you need or not,) or run with admin privileges.

Upvotes: 0

Related Questions