question

jesusmges avatar image
0 Votes"
jesusmges asked CarlFan-MSFT answered

Problem with regional settings on Task Scheduler - Windows Server

I'm having a problem with a scheduled ".bat" job doing a data export from a database.

The task is launched using the Windows Task Scheduler.
If I launch the task with the option "run only when user is logged on", the export is done with the correct locale (decimal separator ".")

instead, if I launch the task with the option "run whether the user is logged on or not", the export is done with another regional configuration (decimal separator ",")

Any idea what could be happening?

windows-server-2012
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CarlFan-MSFT avatar image
0 Votes"
CarlFan-MSFT answered

Hi,
I consider if it due to a regional setting associated with the account used to run your scheduled task.
Try to change the system locale.
Also you mentioned that the issue could be occurred when I save user/password. Did you use the admin account with Run with the highest privileges.
At latest, I suggest that you may try to use process monitor to capture the process after you run the task with "run only when user is logged on" and "run whether the user is logged on or not". You may find something different between these process.
Hope this helps and please help to accept as Answer if the response is useful.
Best Regards,
Carl

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DSPatrick avatar image
0 Votes"
DSPatrick answered jesusmges edited

Something here may help.
https://techcommunity.microsoft.com/t5/ask-the-performance-team/how-to-change-regional-settings-for-all-users-on-a-computer/ba-p/375086

--please don't forget to Accept as answer if the reply is helpful--


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @DSPatrick

Thank you for your prompt response, it is a very interesting article.

In the case of my problem, it seems that the issue is something different. In both situations, the user running the scheduled task is the same, and that user's locale config. appears correct, but when I save user/password in task scheduler, behaviour changes.

0 Votes 0 ·