I made a program in C# and added it to startup(by modifying registry) . When I run msconfig , the program shows under Startup tab , but it doesn't start when I log on. It requires Admin previlages and uses some unmanaged DLL's
Can someone temme what might be the problem ??

Here's the code I'm using to add it to registry :

RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
registryKey.SetValue("AppName", Application.ExecutablePath);

First of all, you know you can also just place the .exe in the Startup folder, and it will execute on boot (something I recently learned, no clue why it took me so long to figure that out)

Of course that's getting side tracked. First of all I assume you have checked the registry to make sure the follow is a valid record in their? If so go ahead and restart the system, then after you back up and running, check the Event Viewer (Start Menu, then type "Event Viewer").

Once that's opened, go to the Windows Logs tab, and pull up the "System" one. Look for the ones that contain an "Error" or "Critical" Level, and click on them. A message should display on the bottom as well as other stuff. See if you find one for your program (you may also have to check the Applocation tab instead of the System one)

Making a security program , therefore was using the registry and not just the Startup folder

Making a security program , therefore was using the registry and not just the Startup folder
It's showing error : AppHangB1
A problem caused this program to stop interacting with Windows.

The program loads and checks for some settings stored in the registry , and makes changes in registry if required. It works fine when I run it manually , but doesn't start on startup .

but you should run the program as administrator,
why don't you change default previlages as Admin previlages
because you are handling registry you required Admin previlages....

Already running program as admin . Added a manifest file for admin previlages . Any other help ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.