Forum posts for smss.exe

C# Kill all processes not essential to running Windows

I have an application. If the application is not used in 15 mins it needs to closes all other applications (forced closed) and the timer starts again. I do not want to crash windows 7 doing this. So far I have the following:

Process me = Process.GetCurrentProcess();
foreach (Process p in Process.GetProcesses())
{
if (p.Id != me.Id
&& p.ProcessName != 'winlogon.exe'
&& p.ProcessName != 'explorer.exe'
&& p.ProcessName != 'System Idle Process'
&& p.ProcessName != 'taskmgr.exe'
&& p.ProcessName != 'spoolsv.exe'
&& p.ProcessName != 'csrss.exe'
&& p.ProcessName != 'smss.exe'
&& p.ProcessName != 'svchost.exe '
&& p.ProcessName != 'services.exe'
)
{
p.Kill();
}
}


Sadly windows dies (blue screen). Is there any way I could close all the processes for the active use then hopefully Windows may survive.

View complete forum thread with replies

Other posts related to smss.exe

See Related Forum Messages: Follow the Links Below to View Complete Thread

Can't list all process on windows 7 64 bit
C# Kill all processes not essential to running Windows
Geting the file size of a system application on windows in C++
how to compile to reduce memory /STACK doesn't seem to change anything?
custom search bar on my custom homepage
Strange character in textoutput when piping from tasklist command WIN7
Replacing winlogon.exe in windows embedded
Can a wmic processes table (within the command prompt window) be sorted by a value?
Subprocess.Popen() : hide the cmd shell

What is the carbon footprint of your coffee?

Is it low? Is it high? Can this things really kill the planet Earth? Maybe the answer will surprise you. Maybe not.