Except that doesn't work, editing the task file creates a scheduler error:u can import them from ..system32\tasks
schtasks /change /tn MyTaskName /disable
Would you be ok if it's just adding a command as garlin suggested?I'd like the ability to disable scheduled tasks instead of remove them in NTLite
i do it all the timeExcept that doesn't work, editing the task file creates a scheduler error:
and the typing password into wifi works also search in cortanaRegister-ScheduledTask -Xml (Get-Content ("C:\Windows\System32\Tasks\Microsoft\Windows\TextServicesFramework\MsCtfMonitor") | Out-String ) -TaskName "MsCtfMonitor"
Regarding disabling via command-line at the end of setup via the post-setup machine section, before any users are created.That doesn't update offline images. You're ignoring the possibility your task needs to be triggered before the import command is run.
import winreg
from hashlib import sha256
from pathlib import Path
from winreg import HKEY_LOCAL_MACHINE
with winreg.OpenKey(HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Test') as key:
task_id, _ = winreg.QueryValueEx(key, 'Id')
with winreg.OpenKey(HKEY_LOCAL_MACHINE, fr'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{task_id}') as key:
task_hash, _ = winreg.QueryValueEx(key, 'Hash')
task_file, _ = winreg.QueryValueEx(key, 'Path')
task_path = Path(rf'C:\Windows\System32\Tasks{task_file}')
task_xml = task_path.read_bytes()[2:]
super_secret_hash = sha256(task_xml).hexdigest()
print(f'Task GUID: {task_id}')
print(f'Task path: {task_path}')
print(f'Task hash: {task_hash.hex()}')
print(f'Calc hash: {super_secret_hash}')