Hello, Nuno Vintém
Welcome to the Microsoft Community
Thank you for your feedback. I read the information you provided. You mentioned that you want to use the task scheduler to shut down the computer within a specific time.
I hope to solve your problem, but your problem is beyond the scope of the forum reply. Don't worry, you can also post your question on learn (only supports English, you can use translation tools to assist communication), where there are experts in this field who can provide more professional insights. You can click the link below to post your question.
Windows Network - Microsoft Q&A
We hope that your problem can be properly solved in the right department. Thank you for your understanding.
Best regards
Brian - Microsoft Community Support Specialist