EXE directory

BlitzPlus Forums/BlitzPlus Programming/EXE directory

dirkduck(Posted 2003) [#1]
Hey everyone. I've been working with "CommandLine()" to be able to open up the selected file in my program from windows explorer. Anyways, it works fine, except for when I open a file in a directory other than the program's exe file. This sets the "CurrentDir" to the directory where the file opened from explorer is, and throws everything off in the program. Does anyone know how to fix this, or is there a "ExeDir" type command to get the directory of the program that is running? Thanks.


FlameDuck(Posted 2003) [#2]
is there a "ExeDir" type command to get the directory of the program that is running?
Yup. Have a look at SystemProperty and/or CurrentDir depending on exactly what you're doing to "throw everything off" in the program. Generally speaking tho' you probably shouldn't ChangeDir.


dirkduck(Posted 2003) [#3]
Hey Flameduck. I was looking at those before, but I was under the impression that SystemProperty only returns system paths (program files, temp files...etc), and CurrentDir returns the path of the file that I opened, not the path of the file that runs the file I opened.


dirkduck(Posted 2003) [#4]
Well nevermind that, just playing with SystemProperty, I guess "appdir" returns what I need. I though it was the actual "Program Files" folder, since in the docs it says:

"appdir" - Program Files folder

:). Thanks FD.