【问题标题】:Explorer.exe doesn't start?Explorer.exe 无法启动?
【发布时间】:2014-02-27 11:43:00
【问题描述】:

我在 Visual Basic 中使用以下代码杀死并重新启动 explorer.exe

杀死Explorer.exe(工作正常):

Dim process As System.Diagnostics.Process = Nothing
Dim psi As New ProcessStartInfo
psi.UseShellExecute = True
psi.FileName = "taskkill.exe"
psi.Arguments = "/F /IM explorer.exe"
process = System.Diagnostics.Process.Start(psi)

重启Explorer.exe再次:

我试过了-

Shell("explorer.exe") 

System.Diagnostics.Process.Start("explorer.exe")

当我执行时,它只会打开一个资源管理器窗口,但不会启动explorer.exe 进程。我正在使用win 8.1

【问题讨论】:

  • 也许我们可以帮助解决这个问题,解决方案是尝试杀死并重新启动资源管理器,而不是尝试修复您的解决方案?
  • It opens an explorer window, but doesn't start the explorer.exe process?这没有任何意义——如果您看到的是资源管理器窗口,那么 explorer.exe 必须正在运行。你的实际症状是什么?你的任务栏不可见吗? explorer.exe 在任务管理器中不可见吗?请编辑您的问题并提供更多详细信息。
  • 据我了解,他通过终止 explorer.exe 进程来终止Shell。然后他想重新启动Shell(资源管理器)但执行explorer.exe只会打开资源管理器的一个窗口,而不是重新启动shell。 - 我认为自从 Vista 以来,Shell 不能被用户调用,或者它必须至少在 WindowsNT 注册表部分中注册为Shell。关于如何重新启动 shell 我将不得不做一些研究
  • 告诉我们:HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell 条目你搞砸了吗?
  • 您可能会通过尝试实现Credential Provider 做得更好。这是 Windows(从 Vista 开始)为想要参与登录过程的程序员提供的钩子。 (但您不会在 VB.Net 中编写)

标签: vb.net windows-explorer kill-process


【解决方案1】:

使用它来启动资源管理器进程

Dim ExProcess = New Process()
ExProcess.StartInfo.UseShellExecute = True
ExProcess.StartInfo.CreateNoWindow = True
ExProcess.StartInfo.FileName = "c:\windows\explorer.exe"
ExProcess.StartInfo.WorkingDirectory = Application.StartupPath
ExProcess.Start()

【讨论】:

  • 谢谢你成功了!我面临与 OP 相同的问题,您的解决方案运行良好。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-05-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多