Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

add second clock to windows powershell

<#
Change the values of the clocks to your needs
Edit the Displayname and Timezones for both clocks
If you want to set only one clock, just remove the section from the script. 
 
Test before use!
This will overwrite the current settings (if set)
#>
 
#Set DisplayName and TimeZone for additional Clock 1
$Clock1DisplayName = 'Pune'
$Clock1TimeZone = 'India Standard Time'
 
# Change this!
#Set DisplayName and TimeZone for additional Clock 2
$Clock2DisplayName = 'Melbourne'
$Clock2TimeZone = 'AUS Eastern Standard Time'
 
#Define path and regkeys
$Clock1 = 'HKCU:Control PanelTimeDateAdditionalClocks1'
$Clock2 = 'HKCU:Control PanelTimeDateAdditionalClocks2'
$RegKeyPath = 'HKCU:Control PanelTimeDateAdditionalClocks'
 
 
#Set Clock 1
 
    New-Item -Path $RegKeyPath -Name '1' -Force
    New-ItemProperty -Path $Clock1 -Name 'Enable' -Value '1' -PropertyType DWORD -Force
    New-ItemProperty -Path $Clock1 -Name 'DisplayName' -Value $Clock1DisplayName -PropertyType String -Force
    New-ItemProperty -Path $Clock1 -Name 'TzRegKeyName' -Value $Clock1TimeZone -PropertyType String -Force
 
 
#Set Clock 2
 
    New-Item -Path $RegKeyPath -Name '2' -Force
    New-ItemProperty -Path $Clock2 -Name 'Enable' -Value '1' -PropertyType DWORD -Force
    New-ItemProperty -Path $Clock2 -Name 'DisplayName' -Value $Clock2DisplayName -PropertyType String -Force
    New-ItemProperty -Path $Clock2 -Name 'TzRegKeyName' -Value $Clock2TimeZone -PropertyType String -Force
Source by janbakker.tech #
 
PREVIOUS NEXT
Tagged: #add #clock #windows #powershell
ADD COMMENT
Topic
Name
4+4 =