Added windows_updates.py
This commit is contained in:
parent
990037e6c1
commit
8fef0a8e2f
2 changed files with 62 additions and 0 deletions
|
|
@ -77,6 +77,20 @@ LAUNCHERS = {
|
|||
'L_ITEM': 'user_checklist.py',
|
||||
'L_ARGS': 'd7mode',
|
||||
},
|
||||
'Disable Windows Updates': {
|
||||
'L_TYPE': 'PyScript',
|
||||
'L_PATH': 'Scripts',
|
||||
'L_ITEM': 'windows_updates.py',
|
||||
'L_ARGS': '--disable',
|
||||
'L_ELEV': 'True',
|
||||
},
|
||||
'Enable Windows Updates': {
|
||||
'L_TYPE': 'PyScript',
|
||||
'L_PATH': 'Scripts',
|
||||
'L_ITEM': 'windows_updates.py',
|
||||
'L_ARGS': '--enable',
|
||||
'L_ELEV': 'True',
|
||||
},
|
||||
},
|
||||
r'Data Recovery': {
|
||||
'PhotoRec (CLI)': {
|
||||
|
|
|
|||
48
.bin/Scripts/windows_updates.py
Normal file
48
.bin/Scripts/windows_updates.py
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# Wizard Kit: Windows updates
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Init
|
||||
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
|
||||
from functions.windows_updates import *
|
||||
init_global_vars()
|
||||
os.system('title {}: Windows Updates Tool'.format(KIT_NAME_FULL))
|
||||
set_log_file('Windows Updates Tool.log')
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
clear_screen()
|
||||
print_info('{}: Windows Updates Tool\n'.format(KIT_NAME_FULL))
|
||||
|
||||
# Check args
|
||||
if '--disable' in sys.argv:
|
||||
result = try_and_print(
|
||||
message='Disabling Windows Updates...',
|
||||
function=disable_windows_updates)
|
||||
elif '--enable' in sys.argv:
|
||||
result = try_and_print(
|
||||
message='Enabling Windows Updates...',
|
||||
function=enable_windows_updates)
|
||||
else:
|
||||
print_error('Bad mode.')
|
||||
abort()
|
||||
|
||||
# Check for errors
|
||||
if not result['CS']:
|
||||
for line in str(result['Error']).splitlines():
|
||||
print_standard(line)
|
||||
print_standard(' ')
|
||||
print_error('Error(s) encountered, see above.')
|
||||
print_standard(' ')
|
||||
pause('Press Enter to exit... ')
|
||||
exit_script(1)
|
||||
|
||||
# Done
|
||||
exit_script()
|
||||
except SystemExit:
|
||||
pass
|
||||
except:
|
||||
major_exception()
|
||||
|
||||
# vim: sts=2 sw=2 ts=2
|
||||
Loading…
Reference in a new issue