diff --git a/Fix-RebootIntoSafeMode.ps1 b/Fix-RebootIntoSafeMode.ps1 index e77993a..1aa01e4 100644 --- a/Fix-RebootIntoSafeMode.ps1 +++ b/Fix-RebootIntoSafeMode.ps1 @@ -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