Score:0

How to change the date format for the AUTHORITY\SYSTEM user on Windows?

cn flag

I have a scheduled task that executes a .NET Core application. The application counts on the system having a date format in en-GB or "DD/MM/YYYY". The scheduled task is set to run as NT AUTHORITY\SYSTEM user.

Note: the above-scheduled task runs on an Amazon EC2 instance.

Is there a way to change the date format for the NT AUTHORITY\SYSTEM user from Powershell in my User-Data script (i.e. when the EC2 instance boots)?

I have tried running this command in my user-data script:

Set-ItemProperty -Path "HKCU:\Control Panel\International" -Name sShortDate -Value dd/MM/yyyy

but it does not work. The reason is that the user-data is executed as the Administrator user (to my knowledge).

Score:1
cn flag

That will not work unless it is executed by a command prompt run as system, which you aren't doing. You need to set the registry value in the correct location:

HKEY_USERS\S-1-5-18\Control Panel\International

Regedit

Georgi Koemdzhiev avatar
cn flag
Thank you very much! That worked. Also, would it be easy to set the same date format for all users on the system?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.