Strange problem with launched processes and registry values

Lamruil

New member
Joined
Jul 23, 2003
Messages
3
I have a program that stores a path to an exe acquired from an OpenFileDialog and saves it to a registry entry. When the main form loads, the path in the registry entry is stored in a string variable.

If I attempt to launch the exe using System.Diagnostic.Process.Start(strPath) the program will appear in my task manager, but it always fails to start properly. No taskbar button appears, no window appears, only that item in the processes window.

However, if I use OpenFileDialog1.Filename directly in the Process.Start, it works fine. I checked the path string before and after it was saved as a register entry, and they were identical. Why is it, then, that the program launches correctly from the file path ONLY if it wasnt retrieved from a registry entry? This one has me completely stumped.
 
Anyone have a clue? Ive done some more testing and found that if I set the path using the OpenFileDialog, it will always work right, but if I attempt to store and later retrieve the path with a registry entry, it will always cause the program to "freeze" before it actually gets started.

I read another post about a similar problem, and the solution (they said) involved setting the working directory for the program. How can I do that?
 
Back
Top