【问题标题】:Want to call Defragment Process in Windows 7 using C#.net Desktop Application想要使用 C#.net 桌面应用程序在 Windows 7 中调用碎片整理过程
【发布时间】:2012-10-01 06:08:17
【问题描述】:

我想使用 Visual Studio 2010 C# .Net 在 Windows 7 中打开磁盘碎片整理程序窗口。

我使用这个代码:

Process.Start("dfrgui"); // 'dfrgui' is used to open disk defragment window in Windows 7

但窗口没有出现。

但我在 Windows XP 中使用

Process.Start("dfrg.msc");

这里确实出现了窗口。

在 Windows 7 中还有其他方法可以调用碎片整理程序吗?

【问题讨论】:

    标签: c# .net desktop-application


    【解决方案1】:

    使用这个命令我希望它适用于每个系统

    ProcessStartInfo pf = new ProcessStartInfo(Path.Combine(Environment.SystemDirectory, "dfrgui.exe"));
    pf.Verb = "runas";
    
    Process.Start(pf);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-04-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-07
      • 1970-01-01
      • 1970-01-01
      • 2010-12-21
      相关资源
      最近更新 更多