I need to kill windows explorer\'s process (explorer.exe), for that
lets say i use a native NT method TerminateProcess
It works but the problem is that the
I have some researches and these are reslts:
Windows will restart
explorerafter it closed -except by Task Manager-.
So you should change the related RegistryKey:
RegistryKey regKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default).OpenSubKey(@"Software\Microsoft\Windows NT\CurrentVersion\Winlogon", RegistryKeyPermissionCheck.ReadWriteSubTree);
if (regKey.GetValue("AutoRestartShell").ToString() == "1")
regKey.SetValue("AutoRestartShell", 0, RegistryValueKind.DWord);
For changing a registry key the program should run as administrator:
exe, which will cause Windows Seven to always run the program as an administrator, As explaining in this Answer.reg command with this [Microsoft Windows Documentation].6.After setting that -restarting explorer- off: This code can close explorer :
Process[] ps = Process.GetProcessesByName("explorer");
foreach (Process p in ps)
p.Kill();