Share via

Executable creating a scheduled task behaves unexpectedly when running with SYSTEM privileges.

Anonymous
2023-10-17T14:53:42+00:00

I have a cpp program which creates a task that runs a command to delete a directory. The task has a few seconds delay after registration. When I run as administrator everything goes as usual, but when I create an elevated shell using psexec -i -s cmd and attempt to run the program the task loses its delay, and any record of it in registry or the task scheduler is gone like it never existed. When I run directly from psexec using psexec -i -s something.exe I get an access denied error. The task does execute though and does what it is supposed to and the directory is deleted. Tested on both windows 11 and windows 7

Windows for home | Windows 11 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. DaveM121 891.6K Reputation points Independent Advisor
    2023-10-17T15:31:21+00:00

    Hi, I am Dave, I will help you with this.

    I apologize, Community is just a consumer forum, due to the scope of your question (C++ Dev) can you please post this question to our sister forum on Microsoft Q&A (The Developers Forum) in the C++ section (linked below)

    Over there you will have access to a host of developers and C++ programming experts and will get a knowledgeable and quick answer to this question.

    https://learn.microsoft.com/en-us/answers/tags/...

    Was this answer helpful?

    0 comments No comments