4

I'm trying to add a new task to the Windows Tasks Scheduler with schtasks.exe. The problem I'm having now is to specify the day of the week at which the task should run.

From what I could find out that stupid program insists on getting that argument as string abbreviation of the day name - localized to the OS language.

Other parameters accepted the English strings just fine but supplying "SUN" on a German system doesn't work. How can I work around that?

If it were just an issue of supporting the couple of languages the application is translated in that wouldn't be bad. But this way I have to expect EVERY language that tool of a tool comes in...

I'm working in c# btw...

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Kempeth
  • 1,856
  • 2
  • 22
  • 37

2 Answers2

2

You could go over all days of the week (start with March 4th 2012, which is a Sunday, and move forward until Saturday, March 10th) and format that date using the ddd format (short day name). That way you'll get all 7 short day names, based on your locale.

zmbq
  • 38,013
  • 14
  • 101
  • 171
0

You can define your task in windows scheduler. Export the definition as XML(right click->export). Create a task using exported XML

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

The content of XML is language independent

Alexander Bartosh
  • 8,287
  • 1
  • 21
  • 22