import ctypes, subprocess,shutil ,sys ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, " ".join(sys.argv), None, 1) subprocess.call(['C:\\Windows\\notepad.exe', 'C:\Windows\System32\drivers\etc\hosts']) append = open('C:\Windows\System32\drivers\etc\hosts','a').write("127.0.0.1 www.google.com") print(append.read())
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)