Click here to Skip to main content
15,888,195 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,
This is my code running application at startup:
C#
RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
rkApp.SetValue("hadi",Application.ExecutablePath);

But my main problem is that when I run my application at startup ,the application's current directory will be C:\Documet and setting\Current User and when it wants to read from my access database it cant find it, because its in another directory.

Thanks in advance for any answers
Posted
Updated 10-Sep-10 22:40pm
v3
Comments
Nitin S 11-Sep-10 7:00am    
awesome!

If you want it to come before Shell, you might have a quick pick into the Registry entry :

HKLM\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon

And check the key Shell.

If you change the executable to your own application, and allow your own program to start explorer, then the explorer will be totally handled by your application.

Otherwise you can install an application in startup, as it is simple to use .NET installer to install your shortcut within the Startup folders.
 
Share this answer
 
You can create a small program (or just a shell script) that will be started at startup and this program/script will be responsible for starting your main aplication.
 
Share this answer
 

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



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