As always, we recommend that you update your devices to the latest version of Windows 10 as soon as possible to ensure that you can take advantage of the latest features and advanced protections from the latest security threats. } std::for_each(processIds.begin(), processIds. Current status as of Ap(PT) Windows 10, version 21H2 is designated for broad deployment. RM_UNIQUE_PROCESS GetExplorerApplication()ĮnumProcesses(processIds.data(),processIdSize,&bytesReturned) returns the process id and create time for the oldest explorer.exe This is assuming only one user is going to use the computer, an IsProcessInSession check is needed if multiple users would be logged on concurrently. Here the code loop through all explorer processes and try to find the oldest one for restarting purpose. RmRegisterResources can be used to restart a process in a session started by RmStartSession, however the machine could have extra explorer processes if the “ launch folder in a separate process” setting is on, or if other users are logged in. The first step of restarting explorer would be registering the main explorer process for restarting. Here it is merely used to restart a particular program, but it has more interesting usage, such as restarting an application after crash.
For example, you can now upgrade IE without a restart. Restart manager is introduced in Vista to minimize system restarts when installing patches. A grace way to terminate would be to send WM_QUIT, or use Vista’s new restart manager API. This is not want the user want – not only because changes in the previous explorer session are only saved during a clean shutdown, but the restarting also needs to be delayed to allow some time to change the task bar layout. 2) Go to Programs & Features and uninstall all Visual C++. Most of people kill the process by brutal force like taskkill or TerminateProcess, however this approach produces a pretty mess, and if HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoRestartShell is on, Windows would restart explorer. Try this: 1) Download a fresh copy of the Visual C++ 2005 Runtime redistributable from Microsoft. Traditionally restarting explorer is a hackish process. For example, this posts is inspired by a programmer who want to toggle task bar layout automatically depending on the screen resolution, and is used to demonstrate the new Windows Vista restart manager API like RmStartSession, RmRegisterResources, RmGetList, RmShutdown, RmRestart and RmEndSession. A programmer may also want to force some shell setting changes that would only be read by Explorer on start up. For shell extension programmers, restart Windows Explorer is one of steps in their setup programs.