Language-independent way to set the day parameter for schtasks.exe

I am trying to add a new task to the Windows Task Scheduler using schtasks.exe . The problem that I am currently facing is to indicate the day of the week on which the task should be performed.

From what I could find out, this stupid program insists that this argument be an abbreviation of the day name string - localized in the OS language.

Other parameters received English strings very well, but the "SUN" delivery in the German system does not work. How can I get around this?

If it was just a multi-language support issue, the application would be translated, which would be nice. But so I must expect, EVERY language, that a tool of a tool comes in ...

I work in C # btw ...

+4
source share
2 answers

You can go through all the days of the week (start on March 4, 2012, which will take place on Sunday, and move forward until Saturday, March 10) and format this date using the ddd format (short name of the day). This way you get all 7 short names based on your locale.

+2
source

You can define your task in the Windows Scheduler. Export the definition as XML (right click-> export). Creating a task using exported XML

 schtasks /Create [/S <system> [/U <username> [/P [<password>]]]] /XML <xmlfile> /TN <taskname> 

XML content is language independent

0
source

Source: https://habr.com/ru/post/1399352/


All Articles