fix normal mode restart

This commit is contained in:
2024-04-22 15:46:26 -04:00
parent 3904441949
commit 27a12a2b02
+5 -5
View File
@@ -1,8 +1,8 @@
# List of services to configure
$Services = @(
"Syncro"
"SyncroLive"
"SyncroOvermind"
"Syncro",
"SyncroLive",
"SyncroOvermind",
"SplashtopRemoteService"
)
@@ -10,14 +10,14 @@ $Services = @(
$Services | ForEach-Object {
If ( Get-Service $_ -ErrorAction SilentlyContinue ) {
Write-Output "Configuring ${_} service to start in Safe Mode with Networking"
Try { New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\${_}" -Force -ErrorAction SilentlyContinue }
Try { New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\${_}" -Force -ErrorAction SilentlyContinue | Out-Null }
Catch { Write-Error "ERROR: could not configure ${_} service to start in Safe Mode with Networking" ; Return }
}
}
# Configure system to reboot into Normal Mode at next reboot
Write-Output "Configuring system to reboot into Normal Mode at next reboot"
Try { [Microsoft.Win32.Registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce",'*RestartNormalMode','%SystemRoot%\System32\bcdedit.exe /deletevalue {default} safeboot',[Microsoft.Win32.RegistryValueKind]::String) }
Try { [Microsoft.Win32.Registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce",'*RestartNormalMode','cmd.exe /c "%SystemRoot%\System32\bcdedit.exe" /deletevalue {default} safeboot',[Microsoft.Win32.RegistryValueKind]::String) }
Catch { Write-Error "ERROR: could not configure reboot into normal mode" ; Return }
# Configure reboot into Safe Mode with Networking