diff --git a/src/runner/main.cpp b/src/runner/main.cpp index 094c3d18b9..2d5b4d592a 100644 --- a/src/runner/main.cpp +++ b/src/runner/main.cpp @@ -443,10 +443,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (is_restart_scheduled()) { if (!restart_if_scheduled()) - { - Logger::warn("Scheduled restart failed. Trying restart as admin as fallback..."); - restart_same_elevation(); + // If it's not possible to restart non-elevated due to some condition in the user's configuration, user should start PowerToys manually. + Logger::warn("Scheduled restart failed. Couldn't restart non-elevated. PowerToys exits here because retrying it would just mean failing in a loop."); } } stop_tray_icon(); diff --git a/src/runner/restart_elevated.cpp b/src/runner/restart_elevated.cpp index dc6346dfbb..6a911c635c 100644 --- a/src/runner/restart_elevated.cpp +++ b/src/runner/restart_elevated.cpp @@ -41,7 +41,7 @@ bool restart_if_scheduled() case RestartAsElevatedOpenSettings: return run_elevated(exe_path.get(), L"--open-settings"); case RestartAsNonElevated: - return run_non_elevated(exe_path.get(), L"--dont-elevate", NULL); + return run_non_elevated(exe_path.get(), L"", NULL); default: return false; } @@ -52,5 +52,5 @@ bool restart_same_elevation() constexpr DWORD exe_path_size = 0xFFFF; auto exe_path = std::make_unique(exe_path_size); GetModuleFileNameW(nullptr, exe_path.get(), exe_path_size); - return run_same_elevation(exe_path.get(), L"--dont-elevate", nullptr); + return run_same_elevation(exe_path.get(), L"", nullptr); }