Update the AutoRepairs scheduled task every run
This is useful if the kit is being run from a different port and the letter changed between runs.
This commit is contained in:
parent
2df0bb504f
commit
e55cc41e2b
1 changed files with 15 additions and 12 deletions
|
|
@ -162,6 +162,20 @@ def build_menus(base_menus, title):
|
|||
return menus
|
||||
|
||||
|
||||
def update_scheduled_task():
|
||||
"""Create (or update) scheduled task to start repairs."""
|
||||
cmd = [
|
||||
'schtasks', '/create', '/f',
|
||||
'/sc', 'ONLOGON',
|
||||
'/tn', f'{KIT_NAME_FULL}-AutoRepairs',
|
||||
'/rl', 'HIGHEST',
|
||||
'/tr', fr'C:\Windows\System32\cmd.exe "/C {sys.executable} {sys.argv[0]}"',
|
||||
]
|
||||
if IN_CONEMU:
|
||||
cmd[-1] = f'{CONEMU_EXE} -run {sys.executable} {sys.argv[0]}'
|
||||
run_program(cmd)
|
||||
|
||||
|
||||
def end_session():
|
||||
"""End Auto Repairs session."""
|
||||
# Remove logon task
|
||||
|
|
@ -254,6 +268,7 @@ def init(menus):
|
|||
|
||||
def init_run(options):
|
||||
"""Initialize Auto Repairs Run."""
|
||||
update_scheduled_task()
|
||||
if options['Kill Explorer']['Selected']:
|
||||
atexit.register(start_explorer)
|
||||
TRY_PRINT.run('Killing Explorer...', kill_explorer, msg_good='DONE')
|
||||
|
|
@ -292,18 +307,6 @@ def init_session(options):
|
|||
if zone != WINDOWS_TIME_ZONE and ask(msg):
|
||||
set_timezone(WINDOWS_TIME_ZONE)
|
||||
|
||||
# Create logon task for Auto Repairs
|
||||
cmd = [
|
||||
'schtasks', '/create', '/f',
|
||||
'/sc', 'ONLOGON',
|
||||
'/tn', f'{KIT_NAME_FULL}-AutoRepairs',
|
||||
'/rl', 'HIGHEST',
|
||||
'/tr', fr'C:\Windows\System32\cmd.exe "/C {sys.executable} {sys.argv[0]}"',
|
||||
]
|
||||
if IN_CONEMU:
|
||||
cmd[-1] = f'{CONEMU_EXE} -run {sys.executable} {sys.argv[0]}'
|
||||
run_program(cmd)
|
||||
|
||||
# One-time tasks
|
||||
if options['Run TDSSKiller (once)']['Selected']:
|
||||
TRY_PRINT.run('Running TDSSKiller...', run_tdsskiller, msg_good='DONE')
|
||||
|
|
|
|||
Loading…
Reference in a new issue