Explorer.exe无法启动?

时间:2014-02-27 11:43:01

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

我在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

1 个答案:

答案 0 :(得分: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()