Task Scheduler when creating a custom Windows image

Tomy Minea 21 Reputation points
2022-08-31T14:57:30.667+00:00

Hi,

I am creating a custom Windows 11 image and (after installation) I'd like it to run a scheduled task.
After I mount the install.wim to a folder, I do the necessary additions to the image, copy the previously created and tested the "no extension task file" (the task I need to schedule) and place it in the C:\Windows\System32\Task\ folder of the new custom mounted image.

Also tried renaming the "no extension file" as .XML, but no success.

After I unmount the image, and install Windows from it, the task is not executing even though the trigger is being triggered. The task is not getting imported into the freshly installed Windows 11's Task Scheduler.
Can you tell me why Windows doesn't import it's files into Task Scheduler, from C:\Windows\System32\Task\ ?
Thanks!
Tomy

Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 36,291 Reputation points
    2022-08-31T18:25:09.96+00:00

    I suspect that you would also need the registry entries in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache.

    I see the task that I defined in the "Tree" key and entries for its GUID in "Logon" and "Tasks".

    You might have to run schtasks in order to define the task correctly.

    https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/add-a-custom-script-to-windows-setup?view=windows-11

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.