更改 Shell 注册表 [英] Changing the Shell registry

查看:104
本文介绍了更改 Shell 注册表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序开始时,我将注册表的 shell 值更改为自定义 shell 并杀死 explorer.exe(它在应用程序外部完成),我希望允许后门返回原始 shell 并带来返回 explorer.exe.恢复进程对我来说很好,但是当我运行我的代码来更改注册表值时,没有抛出异常,但是当我签入 regedit 时,该值不会更改,这是我的代码(在另一个问题上看到它):

At the start of my application i change the shell value of the registry to a custom shell and kill the explorer.exe (It is done outside the application), i want to allow a backdoor to return to the original shell and bring back the explorer.exe. brining the process back works fine for me but when i run my code to change the registry value no exception is thrown but the value doesn't change when i check in regedit, this is my code (saw it here on a different question) :

        RegistryKey regKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", true);
        regKey.SetValue("Shell", "explorer.exe", RegistryValueKind.String);
        regKey.Close();

请帮忙

推荐答案

在你的代码中,你实际上是在设置

In your code, you are actually set the value of

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell

由于某些注册表项被 WOW64 重定向,请检查 MSDN 以获取更多详细信息.

Because some registry keys are redirected by WOW64, please check MSDN to get more details.

试试这个:

RegistryKey localMachine = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, RegistryView.Registry64);

RegistryKey regKey = localMachine .OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", true);
regKey.SetValue("Shell", "explorer.exe", RegistryValueKind.String);
regKey.Close();

这篇关于更改 Shell 注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆