diff --git a/Form1.cs b/Form1.cs index 06133b6..9aacdb1 100644 --- a/Form1.cs +++ b/Form1.cs @@ -197,9 +197,9 @@ namespace CheckDownload // 无需更新时清理临时文件夹 CleanupTempDirectory(); - // 显示更新完成并等待3秒 + // 显示更新完成并等待2秒 UpdateStatus("更新完成"); - await Task.Delay(3000); + await Task.Delay(2000); this.Close(); return; } @@ -913,15 +913,16 @@ namespace CheckDownload } batchContent.AppendLine("del \"%~f0\" /f /q"); + batchContent.AppendLine("exit"); File.WriteAllText(batchFilePath, batchContent.ToString(), new UTF8Encoding(false)); var startInfo = new ProcessStartInfo { FileName = "cmd.exe", - Arguments = $"/c start \"\" /min \"{batchFilePath}\"", + Arguments = $"/c \"{batchFilePath}\"", CreateNoWindow = true, - UseShellExecute = true, + UseShellExecute = false, WindowStyle = ProcessWindowStyle.Hidden }; Process.Start(startInfo);