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
2023-07-29 16:42:28 +05:00

9 lines
637 B
PowerShell

$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