Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Process.Start("explorer.exe"); won't bring back taskbar

As of right now, I am working on a mock up OS via WinForms to use as a prop for movies. Upon running the application, it kills explorer.exe so that you can't accidentally have the windows task bar show up during a shoot. The issue is, upon closing the mock OS I would like for explorer.exe to be started up again. However, Process.Start("explorer.exe"); brings up an explorer window, and does not re-instate the window taskbar.

I know for a fact, that task manager is more than capable of bringing back the window taskbar via typing "explorer.exe" under a new task, though I've had no luck finding command line arguments to pass to task manager.

Edit: I'm running under Windows 7. As well, I'm going pretty in depth with this mock OS. I'm taking control of quite a few key presses that Windows uses. For this reason, I kill explorer.exe so that I can use key presses such as "Alt-Tab" and display a mock app switcher, etc. The app already runs in full screen, but it is still possible to have the underlying Windows GUI pop back up. I am essentially replacing explorer.exe with my own mock up explorer. Upon closing my custom explorer, I can't seem to get the regular Windows GUI to come back by launching explorer.exe via Process.Start();.

like image 863
Sebastian Thomas Edward Lawe Avatar asked Aug 15 '13 20:08

Sebastian Thomas Edward Lawe


People also ask

How do I fix explorer.exe not responding?

Press Ctrl + Shift + Esc to start Task Manager. Find File Explorer in Task Manager and choose End task. Click File on the upper left corner and then choose Run new task. Then input explorer.exe in the box and then press Enter to restart it immediately.

How do I start explorer.exe from command prompt?

If you like working with Windows Terminal, Command Prompt, or PowerShell, type the command explorer in any of them and press Enter. This immediately opens File Explorer from CMD in Windows 11 and Windows 10 or Windows Explorer in Windows 7.


1 Answers

From here:

Try

Process.Start(Path.Combine(Environment.GetEnvironmentVariable("windir"), "explorer.exe"));

It appears you must specify the full path to explorer to get the taskbar back.

like image 145
AceJordin Avatar answered Sep 27 '22 17:09

AceJordin