How to restart Windows Explorer using Programme

  • Thread starter Thread starter ramesh.nrk
  • Start date Start date
R

ramesh.nrk

Hi,

I need to re-start the windows explorer programmatically. How can
I restart Windows Explorer using programmatically?

Thank you
 
Hi,

I need to re-start the windows explorer programmatically. How can
I restart Windows Explorer using programmatically?

Thank you


Hi Ramesh,

this is a easy task: First enumerate all running processes on the system,
then find all explorer processes and kill them all. Finally start a single
explorer instance. Explorer restarted!


Enumerate all processes and restart explorer:
------------------------

foreach(Process p in Process.GetProcesses()){

try{


//compare it with "explorer "

if(p.MainModule.ModuleName.Contains("explorer") == true)p.Kill();

}catch(Exception e){

//do some exception handling here

}

//restart explorer

Process.Start("explorer.exe");

}

Thats it,...!


Beste Grüsse / Best regards / Votre bien devoue

Kerem Gümrükcü
(e-mail address removed)
Pro-IT Education http://www.pro-it-education.de/
Professional IT-Training and Consulting
 
Hi Kerem

Thank you for the reply.

This is exactly what I want & solved my problem.

Thank you.
 
Hi Kerem

Thank you for the reply.

This is exactly what I want & solved my problem.

Thank you.





Hi Ramesh,

this is a easy task: First enumerate all running processes on the system,
then find all explorer processes and kill them all. Finally start a single
explorer instance. Explorer restarted!


Enumerate all processes and restart explorer:
------------------------

foreach(Process p in Process.GetProcesses()){

try{


//compare it with "explorer "

if(p.MainModule.ModuleName.Contains("explorer") == true)p.Kill();

}catch(Exception e){

//do some exception handling here

}

//restart explorer

Process.Start("explorer.exe");

}

Thats it,...!


Beste Grüsse / Best regards / Votre bien devoue

Kerem Gümrükcü
(e-mail address removed)
Pro-IT Education http://www.pro-it-education.de/
Professional IT-Training and Consulting




You are welcome!


Beste Grüsse / Best regards / Votre bien devoue

Kerem Gümrükcü
(e-mail address removed)
Pro-IT Education http://www.pro-it-education.de/
Professional IT-Training and Consulting
 
Back
Top