c++ - 使用 C++ 重新启动 explorer.exe
问题描述
我已经看过这篇文章:如何通过 C++ 启动 explorer.exe?这是一个旧帖子。我在玩批处理文件命令,我想用 C++ 复制这个函数
taskkill /f /im explorer.exe
start explorer.exe
我正在使用
系统(” ”)
C++ 中的命令来实现它。这是代码:注意,杀死 explorer.exe 正在工作,但我无法再次启动它。
#include "pch.h"
#include <windows.h>
#include <iostream>
int main ()
{
system("taskkill /f /im explorer.exe");
system("explorer.exe");
}
它不是打开 explorer.exe 来恢复 windows UI,而是在 windows 中打开快速访问。任何想法?
解决方案
使用 cmd 将是%SystemRoot%\Explorer.exe
并且在 c ++ 中使用它会是如果system("C:/Windows/Explorer.exe")
您的代码打开以下文件C:/windows/sistem32/explorer
什么是用户界面,您必须在此路径上打开一个C:/windows/Explorer.exe
我希望它对您有用,运气..
例子
#include "pch.h"
#include <windows.h>
#include <iostream>
int main ()
{
system("taskkill /f /im explorer.exe");
system("C:/windows/Explorer.exe");
}```
推荐阅读
- meteor - 使用流星和简单模式获取无法读取未定义的属性“电子邮件”
- swift - 从 Firebase 存储获取 pdf
- omnet++ - Omnet++,即将抛出一个cRuntimeError异常
- git - 为什么接收后挂钩不起作用?
- php - SQL,把最常见的国家放在最前面,然后放在下面
- powerbi - 即使数据集是 pushStreaming,Power BI Embedded 报表也不会实时更新
- clojure - 使用重新框架实现登录系统
- php - 将文本文件作为多维数组返回
- python - AUTH_USER_MODEL 指的是尚未安装的模型 '%s'"
- python - np.round 或 np.around 不起作用