Hello AskPerf readers. My name is Edwin Rocky and this is my first post on the blog. I had recently worked on a case where we noticed that on a Windows Server 2008 R2 machine when we use the
command to set the automatic page file setting to be disabled, it changes the Time Zone information to Unrecognized.
Command used was
“wmic computersystem set automaticmanagedpagefile = false”:
After successfully executing this command, if you open the Calendar you will notice the following error as shown below. The Time Zone information changes to not recognized.
When you click on the “Change data and Time Settings” you will still notice that under the time zone you see the following information:
The reason was that this command had removed the
value from the registry key location under:
This is due to an older API being used during this process, and has the unintended consequence of clearing that key.
You can simply go back and set the Time Zone information using the GUI. But in case you are in the process of doing automation where you need to disable the page file for multiple machines then this may not be a feasible option. In this case you can use the following simple .reg export and .reg import commands as a workaround to achieve this. We can add the following commands in the automation script:
Wmic ComputerSystem Set AutomaticManagedPageFile=False
Reg import TimeZone.Reg
These basically backs up the existing registry key, runs the Wmic command to disable the pagefile and then imports the registry key back to the same location.
Note: The file TimeZone.Reg will be saved to the location from where you initiated the
command in the
line. You must also run the
prompt elevated, since it will not otherwise has permissions to write to HKLM. You can provide a designated path to store the .reg file by providing the complete path of the file, like so: