Click here to Skip to main content
14,836,532 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
RegistryKey autoStartOnConnKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", true);

autoStartOnConnKey.SetValue(@"Shell", @"notepad.exe", RegistryValueKind.String);

MessageBox.show("done");



above code is working fine but there is nothing update in my registry.
i want to update shell with value notepad.exe

thanks .
Posted
Updated 29-Aug-14 1:09am
v2
Comments
[no name] 29-Aug-14 10:16am
   
32 bit? 64 bit? You are probably looking in the wrong place.
anandd.mohit 29-Aug-14 11:05am
   
i am using 64-bit windows 8..
i was reading http://msdn.microsoft.com/en-us/library/aa384249(v=vs.85).aspx
i am not able to understand WOW64 and all.

Hello ,
Try this link
Refer:Read, write and delete from registry with C#

thanks
   
Comments
anandd.mohit 29-Aug-14 7:13am
   
its working fine !!
but not shown any thing .. i already read your refer link.
Animesh Datta 29-Aug-14 7:26am
   
just download the code ,run and check
anandd.mohit 29-Aug-14 7:43am
   
Sir i tried many times but its giving value notepad.exe
but not showing in regedit.exe and it is not working .
http://msdn.microsoft.com/en-us/library/microsoft.win32.registrykey.close(v=vs.110).aspx[^]

Closes the key and flushes it to disk if its contents have been modified.

Alan.
   
C#
RegistryKey add = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
           add.SetValue("nameprogram", "\"" + Application.ExecutablePath.ToString() + "\"");
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900