Python Forum
os.system("netsh interface set interface 'Wi-Fi' enabled") - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: os.system("netsh interface set interface 'Wi-Fi' enabled") (/thread-15409.html)

Pages: 1 2


RE: os.system("netsh interface set interface 'Wi-Fi' enabled") - aniyanetworks - Jan-17-2019

(Jan-17-2019, 07:00 PM)nilamo Wrote: What happens if you run it with admin privileges, as it suggests?
The output is this without error and without doing anything. it doesn't do anything at all.
Output:
Process finished with exit code 0



RE: os.system("netsh interface set interface 'Wi-Fi' enabled") - nilamo - Jan-17-2019

Are you sure it didn't do anything? If it succeeds, netsh doesn't have any output, and an exit code of zero means success. For me, when I ran that, there was no output, but my wifi adapter had been disabled.


RE: os.system("netsh interface set interface 'Wi-Fi' enabled") - aniyanetworks - Jan-18-2019

(Jan-17-2019, 10:31 PM)nilamo Wrote: Are you sure it didn't do anything? If it succeeds, netsh doesn't have any output, and an exit code of zero means success. For me, when I ran that, there was no output, but my wifi adapter had been disabled.

IT is Working now. Thanks
import os
import subprocess
os.system("netsh interface show interface")
# It will enabled Wi-Fi Network
subprocess.call(['netsh', 'interface', 'set', 'interface', 'Wi-Fi', 'enabled'])
Output:
Admin State State Type Interface Name ------------------------------------------------------------------------- Disabled Disconnected Dedicated Wi-Fi Disabled Disconnected Dedicated TPALAN Process finished with exit code 0
Working Perfectly. Thank you