Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions ContextMenuManager/BluePointLilac.Methods/ExternalProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,7 @@ public static void RestartExplorer()
}
}

// 等待一小段时间确保所有进程已完全退出
Thread.Sleep(500);

// 启动新的 explorer.exe 进程
Process.Start(new ProcessStartInfo
{
FileName = "explorer.exe",
UseShellExecute = true
})?.Dispose();
// 无需启动新的 explorer.exe 进程,Windows 会自动重启它
}
catch (Exception ex) when (
ex is Win32Exception or
Expand All @@ -245,12 +237,8 @@ InvalidOperationException or
{
kill?.WaitForExit();
}
Thread.Sleep(500);
Process.Start(new ProcessStartInfo
{
FileName = "explorer.exe",
UseShellExecute = true
})?.Dispose();

// 无需启动新的 explorer.exe 进程,Windows 会自动重启它
}
catch (Exception ex1) when (
ex1 is Win32Exception or
Expand Down
Loading