【问题标题】:How to start explorer.exe in VB.NET program如何在 VB.NET 程序中启动 explorer.exe
【发布时间】:2019-06-07 01:52:10
【问题描述】:

所以,我目前正在研究一种有时间限制的应用程序。使用我们的家用电脑,我希望能够在我的兄弟之间平等地限制使用。一切都差不多准备好了,除了整个应用程序可以通过按下主页按钮并单击开始菜单中的应用程序来绕过这一事实。所以,我想在使用以下命令登录帐户后应用程序启动时杀死“explorer.exe”:

Dim command = "taskkill /f /im explorer.exe"
Shell(command)

而且它有效。但是,我的问题是在输入正确的代码以能够使用PC后,我似乎无法正确重新启动explorer.exe。它只是打开了没有任务栏的 Windows 文件资源管理器窗口和带有子功能的其他 explorer.exe 功能:

Sub RestartExplorer()
    System.Diagnostics.Process.Start("explorer.exe")
End Sub

【问题讨论】:

  • 在您重新启动进程但未显示任务栏后,请尝试按 ctrl + Esc。那么任务栏出现了吗?
  • 我假设您使用的是 Windows 10,但情况可能并非如此?
  • 你的代码有效,我试过了,对我来说,在 Win 10 上它工作得很好我能够杀死资源管理器然后重新启动它并出现任务栏,你的电脑可能有问题..做你也有 Win 10?
  • after a correct code is inputted to be able to use the PC 也许问题出在那部分?你在那里“输入”了什么样的正确代码?

标签: vb.net


【解决方案1】:

你为什么不试试

Sub RestartExplorer()
    System.Diagnostics.Process.Start("explorer.exe")
    System.Diagnositics.Process.Start("winlogon.exe")
End Sub

Sub RestartExplorer()
    System.Diagnositics.Process.Start("winlogon.exe")
End Sub

【讨论】:

    【解决方案2】:

    你可以试试这个代码:

    Sub RestartExplorer()
        System.Diagnostics.Process.Start("userinit.exe")
    End Sub
    

    启动 userinit.exe 将正确启动 explorer.exe,带有任务栏和桌面。

    这也将播放 Windows 登录声音。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-05-06
      • 1970-01-01
      • 1970-01-01
      • 2016-07-13
      • 1970-01-01
      • 1970-01-01
      • 2021-10-21
      相关资源
      最近更新 更多