重新启动资源管理器.exe使用 C++

Restarting explorer.exe using C++

本文关键字:C++ 使用 exe 资源管理器 重新启动      更新时间:2023-10-16

我已经看过这篇文章:如何通过C++启动资源管理器.exe这是一个旧帖子。我正在使用批处理文件命令,我想使用C++复制此功能

taskkill /f /im explorer.exe
start explorer.exe

我正在使用

系统(" ")

命令C++实现它。这是代码:请注意,杀死资源管理器.exe正在工作,但我无法再次启动它。

#include "pch.h"
#include <windows.h>
#include <iostream>
int main ()
{
  system("taskkill /f /im explorer.exe");
  system("explorer.exe");
}

它不是打开资源管理器.exe以恢复窗口 UI,而是在窗口中打开快速访问。知道吗?

使用 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");
}```