0

I set my program to start in the windows startup using this code

RegistryKey registryKey = Registry.CurrentUser.OpenSubKey
       ("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
        registryKey.SetValue("MY Program", "\"" + System.Reflection.Assembly.GetExecutingAssembly().Location + "\"");

my program works fine, but when it starts from the registry in startup (not by the user) it doent recofnize other files which be next to it.

what is the problem ?

  • 2
    What do you mean "recognise other files which be next to it"? Can you post the code you are using to do this – jcharlesworthuk Jan 18 '16 at 12:56
  • Your question is a bit unclear but what you probably want is that the working folder is set to a specific folder. You might want to look at this question: https://stackoverflow.com/questions/2822951/use-registry-to-startup-a-program-and-also-change-the-current-working-directory – Dirk Vollmar Jan 18 '16 at 13:03
  • I Solved the problem, thanks all ! – Evyatar Jan 19 '16 at 13:10

0 Answers0