-
Notifications
You must be signed in to change notification settings - Fork 66
Description
I tried leaving this on your site but kept getting a 403 error, odd as I know I have posted there in the past. ANYWAY!
Loving the updates! I am having trouble getting the Dismiss button to NOT appear. Only want to show the 2 action buttons but when I do that, I also get the Dismiss button. I was able to build out some protocols so that the buttons could actually do reboots but that is all i want users to do, pick a reboot option. 10 minutes or 4 hours. Granted I know that if someone clicks the UI nothing will happen, but users won't really notice it. A dismiss button though, that will get used if its visible.
here is the reboot protocol I added just after regional settings. I have 3 in total. 10 min, 2 hour and 4 hour options:
REM create 10 minute reboot protocol cmd
New-Item -Path $rebootcmd10m -ItemType File -force
Add-Content -Path $rebootcmd10m -Value "# Display a warning message"
Add-Content -Path $rebootcmd10m -Value "Add-Type -AssemblyName PresentationFramework"
Add-Content -Path $rebootcmd10m -Value "[System.Windows.MessageBox]::Show('Clicking OK will initiate a 10 minute reboot process. Please save your work and click OK.', 'Restart Warning', 'OK', 'Warning')"
Add-Content -Path $rebootcmd10m -Value "# Abort the current reboot process if any."
Add-Content -Path $rebootcmd10m -Value "& C:\Windows\System32\shutdown.exe /a"
Add-Content -Path $rebootcmd10m -Value "# Wait for 10 minutes (600 seconds) and then restart"
Add-Content -Path $rebootcmd10m -Value 'start-process -FilePath "shutdown.exe" -ArgumentList "/r /t 600 /d p:1:1 /c ""10 Minute Reboot Warning"""'
New-Item "HKCU:\Software\Classes\PCReboot10m\shell\open\command" -Force -ErrorAction SilentlyContinue | Out-Null
New-ItemProperty -LiteralPath "HKCU:\Software\Classes\PCReboot10m" -Name 'URL Protocol' -Value '' -PropertyType String -Force -ErrorAction SilentlyContinue | Out-Null
New-ItemProperty -LiteralPath "HKCU:\Software\Classes\PCReboot10m" -Name '(default)' -Value "URL:PCReboot10m Protocol" -PropertyType String -Force -ErrorAction SilentlyContinue | Out-Null
New-ItemProperty -LiteralPath "HKCU:\Software\Classes\PCReboot10m\shell\open\command" -Name '(default)' -Value "powershell.exe -noprofile -windowstyle hidden -executionpolicy remote -file $rebootcmd10m" -PropertyType String -Force -ErrorAction SilentlyContinue | Out-Null