This repository has been archived on 2023-12-11. You can view files and clone it, but cannot push or open issues or pull requests.
archive/powershell/clock/clock.ps1

9 lines
637 B
PowerShell
Raw Permalink Normal View History

2023-07-29 14:42:28 +03:00
$wshell = New-Object -ComObject Wscript.Shell
if (Get-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSecondsInSystemClock 2>$null){
Remove-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSecondsInSystemClock
$wshell.Popup("The registry entry was deleted.")
}else{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSecondsInSystemClock -PropertyType DWord -Value 1 >$null
$wshell.Popup("The registry entry was created.")
}
taskkill /f /im explorer.exe >$null; start explorer.exe