Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
le meow
Browse files Browse the repository at this point in the history
  • Loading branch information
10se1ucgo committed Aug 3, 2015
1 parent 29ebf76 commit 38005c6
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def __init__(self, parent, title):
self.warn.Destroy()
sys.exit()


self.icon = wx.Icon(r"c:\windows\system32\shell32.dll;315", wx.BITMAP_TYPE_ICO)
self.SetIcon(self.icon)

Expand Down Expand Up @@ -62,7 +61,8 @@ def onok(self, event):
_winreg.SetValueEx(self.telekey, "AllowTelemetry", 0, _winreg.REG_SZ, "0") # Disable Telemetry
_winreg.CloseKey(self.telekey)
except WindowsError:
pass
print "Unable to modify Telemetry key. Deleted, or is the program not elevated?"

if self.diagbox.IsChecked():
try:
open('C:\ProgramData\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl',
Expand All @@ -71,6 +71,7 @@ def onok(self, event):
"echo y|cacls C:\ProgramData\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl /d SYSTEM",
shell=True) # Prevent modification to file
except IOError:
print "Unable to clear DiagTrack log. Deleted, or is the program not elevated?"
pass

if self.hostbox.IsChecked():
Expand Down Expand Up @@ -102,20 +103,19 @@ def onok(self, event):
with open('C:\Windows\System32\drivers\etc\hosts', 'ab') as f:
f.write(self.MSHosts)
except WindowsError:
pass
print "Could not access HOSTS file. Is the program not elevated?"

if self.servicerad.Selection == 0 and self.servicebox.IsChecked():
try:
win32serviceutil.RemoveService('dmwappushsvc') # Delete dmwappushsvc
except pywintypes.error:
print "dmwappushsvc unable to be deleted. Deleted already, or is the program not elevated?"
pass

try:
win32serviceutil.RemoveService('Diagnostics Tracking Service') # Delete the DiagnosticsTracking Service
except pywintypes.error:
print "Diagnostics Tracking Service unable to be deleted. Deleted already, or is the program not elevated?"
pass

elif self.servicerad.Selection == 1 and self.servicebox.IsChecked():
self.diagkeypath = r'SYSTEM\CurrentControlSet\Services\DiagTrack'
self.dmwakeypath = r'SYSTEM\CurrentControlSet\Services\dmwappushsvc'
Expand All @@ -125,28 +125,25 @@ def onok(self, event):
_winreg.SetValueEx(self.diagkey, "Start", 0, _winreg.REG_DWORD, 0x0000004)
_winreg.CloseKey(self.diagkey)
except WindowsError:
pass
print "Unable to modify DiagTrack key. Deleted, or is the program not elevated?"

try:
self.dmwakey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, self.dmwakeypath, 0, _winreg.KEY_ALL_ACCESS)
_winreg.SetValueEx(self.dmwakey, "Start", 0, _winreg.REG_DWORD, 0x0000004)
_winreg.CloseKey(self.dmwakey)
except WindowsError:
pass
print "Unable to modify dwmappushsvc key. Deleted, or is the program not elevated?"

try:
win32serviceutil.StopService('Diagnostics Tracking Service') # Disable Diagnostics Tracking Service
except pywintypes.error:
print "Diagnostics Tracking Service unable to be stopped. Deleted, or is the program not elevated?"
pass

try:
win32serviceutil.StopService('dmwappushsvc') # Disable dmwappushsvc
except pywintypes.error:
print "dmwappushsvc unable to be stopped. Deleted, or is the program not elevated?"
pass

print "Services Disabled"
sys.exit()


Expand Down

0 comments on commit 38005c6

Please sign in to comment.