Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 更改Shell注册表_C#_Windows_Registry_Windows Shell_Regedit - Fatal编程技术网

C# 更改Shell注册表

C# 更改Shell注册表,c#,windows,registry,windows-shell,regedit,C#,Windows,Registry,Windows Shell,Regedit,在应用程序开始时,我将注册表的shell值更改为自定义shell并杀死explorer.exe(这是在应用程序外部完成的),我希望允许后门返回到原始shell并带回explorer.exe。将进程带回来对我来说很好,但是当我运行代码来更改注册表值时,不会引发异常,但当我签入regedit时,值不会更改, 这是我的代码(在另一个问题上看到): 请帮助在您的代码中,您实际上设置了 HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT

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


请帮助

在您的代码中,您实际上设置了

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
由于某些注册表项被WOW64重定向,请检查以获取更多详细信息

试试这个:

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();

在代码中,您实际上设置了

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
由于某些注册表项被WOW64重定向,请检查以获取更多详细信息

试试这个:

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();