Skript millega saab arvutis kustutada wifi profiilid Python

From ICO wiki
Revision as of 15:15, 6 January 2015 by Rluup (talk | contribs) (Created page with "Category: Skriptimiskeeled <source lang="python"> #Koostas Ragnar Luup AK-31 2015 # Selle scriptigas kustutatakse ära win 7 arvutist ära wifi profiilid ja taaskäivitatakse…")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
#Koostas Ragnar Luup AK-31 2015
# Selle scriptigas kustutatakse ära win 7 arvutist ära wifi profiilid ja taaskäivitatakse wifi teenus.

import os
import shutil
#win32serviceutil tuleb eraldi paigaldada ennem kui seda kasutada saab
import win32serviceutil

# kustutame kaustast wifi profiili failid
folder = 'C:\ProgramData\Microsoft\Wlansvc\Profiles\Interfaces'
for the_file in os.listdir(folder):
    file_path = os.path.join(folder, the_file)
    if os.path.isfile(file_path):
        os.unlink(file_path)
    else:
        shutil.rmtree(file_path)

#taaskäivitame  wifi teenuse
teenus = "Wlansvc"
win32serviceutil.RestartService(teenus)