I added .cuu file association with my program. One problem is all the Directory.GetCurrentDirectory() calls return where the .cuu file is and not the path to the program.exe. Any work around? I tried Enviroment.CurrentDirectory. Same thing.
2 replies to this topic
#1
Posted 06 February 2012 - 05:36 AM
|
|
|
#2
Posted 06 February 2012 - 08:23 AM
The Windows Shell calls (executes) the associated program from within the directory of the double-clicked file, so the current working directory is indeed the directory of your .cuu file.
Edit: You're wanting to know the path to the running executable file, not the current working directory. You might try Application.ExecutablePath. Source: directory - Getting the absolute path of the executable, using C#? - Stack Overflow
Edit: You're wanting to know the path to the running executable file, not the current working directory. You might try Application.ExecutablePath. Source: directory - Getting the absolute path of the executable, using C#? - Stack Overflow
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid
#3
Posted 06 February 2012 - 02:22 PM
Thank you. Application.StartupPath and ExecutablePath work perfectly. Just had to convert all my stuff code over to that and now I know from now on. Cheers
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









