【问题标题】:Qt how to open Device ManagerQt如何打开设备管理器
【发布时间】:2018-10-04 05:06:35
【问题描述】:

我正在尝试从 Qt Windows 应用程序上的按钮打开设备管理器。

我尝试了什么: 将插槽/信号分配给按钮。以及方法:

 QProcess *proc = new QProcess(this);
    QString cmdStr = "devmgmt.msc";
    proc->start(cmdStr);
    qDebug() << "btn clicked";

但是当我点击它时没有任何反应。单击的 btn 将显示在控制台中。

编辑:我也试过了

cmdStr="mmc devmgmt.msc"

但也打不开。

【问题讨论】:

    标签: windows qt qprocess device-manager


    【解决方案1】:

    好的,通过使用 QDesktopServices 设法让它工作。

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/devmgmt.msc", QUrl::TolerantMode));
    

    以下是您可能感兴趣的其他 Windows 应用的列表:

    系统信息

    命令提示符

    QProcess::startDetached("\"C:\\Windows\\System32\\cmd.exe\"");
    

    控制面板

    QProcess::startDetached("\"C:\\Windows\\System32\\control.exe\"");
    

    放大镜

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/Magnify.exe", QUrl::TolerantMode));
    

    注册表编辑

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/regedt32.exe", QUrl::TolerantMode));
    

    服务

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/services.msc", QUrl::TolerantMode));
    

    系统信息

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/msinfo32.exe", QUrl::TolerantMode));
    

    设置

    QDesktopServices::openUrl(QUrl("file:///C:/settings", QUrl::TolerantMode));
    

    探索者

    system("explorer.exe");
    

    任务管理器

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/Taskmgr.exe", QUrl::TolerantMode));
    

    磁盘清理

    QProcess::startDetached("\"C:\\Windows\\System32\\cleanmgr.exe\"");
    

    MsConfig

    system("C:/Windows/System32/msconfig.exe");
    

    Windows 远程

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/msra.exe", QUrl::TolerantMode));
    

    资源监视器

    QProcess::startDetached("\"C:\\Windows\\System32\\resmon.exe\"");
    

    系统修复光盘

    system("C:/Windows/System32/recdisc.exe");
    

    内存诊断

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/MdSched.exe", QUrl::TolerantMode));
    

    系统还原

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/rstrui.exe", QUrl::TolerantMode));
    

    启动文件夹

    QDesktopServices::openUrl(QUrl("file:///C:/Users/dclar.DESKTOP-JTNNAGR/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup", QUrl::TolerantMode));
    

    运行命令

    system("c:/windows/system32/rundll32.exe shell32.dll,#61");
    

    驱动优化

    QProcess::startDetached("\"C:\\Windows\\System32\\dfrgui.exe\"");
    

    磁盘管理

    system("C:/Windows/System32/diskmgmt.msc");
    

    计算机管理

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/CompMgmtLauncher.exe", QUrl::TolerantMode));
    

    文本调谐器

    QProcess::startDetached("\"C:\\Windows\\System32\\cttune.exe\"");
    

    计算机服务

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/dcomcnfg.exe", QUrl::TolerantMode));
    

    设备管理器

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/devmgmt.msc", QUrl::TolerantMode));
    

    Direct X 诊断

    QProcess::startDetached("\"C:\\Windows\\System32\\dxdiag.exe\"");
    

    文件历史记录

    QProcess::startDetached("\"C:\\Windows\\System32\\FileHistory.exe\"");
    

    蓝牙传输

    QProcess::startDetached("\"C:\\Windows\\System32\\fsquirt.exe\"");
    

    添加硬件

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/hdwwiz.exe", QUrl::TolerantMode));
    

    光盘标签

    QProcess::startDetached("\"C:\\Windows\\System32\\label.exe\"");
    

    语言安装程序

    QProcess::startDetached("\"C:\\Windows\\System32\\lpksetup.exe\"");
    

    恶意软件清除器

    QProcess::startDetached("\"C:\\Windows\\System32\\MRT.exe\"");
    

    叙述者

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/Narrator.exe", QUrl::TolerantMode));
    

    用户帐户

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/Netplwiz.exe", QUrl::TolerantMode));
    

    Windows 备份

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/sdclt.exe", QUrl::TolerantMode));
    

    创建共享文件夹

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/shrpubw.exe", QUrl::TolerantMode));
    

    系统关机

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/shutdown.exe", QUrl::TolerantMode));
    

    便签

    QProcess::startDetached("\"C:\\Windows\\System32\\StikyNot.exe\"");
    

    系统重置

    QDesktopServices::openUrl(QUrl("file:///C:/Windows/System32/systemreset.exe", QUrl::TolerantMode));
    

    易于访问

    QProcess::startDetached("\"C:\\Windows\\System32\\Utilman.exe\"");
    

    写字板

    QProcess::startDetached("\"C:\\Windows\\System32\\write.exe\"");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-17
      • 1970-01-01
      • 2015-12-26
      • 1970-01-01
      • 2013-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多