Page 1 of 1

Find executed from path?

Posted: Wed Dec 27, 2017 9:00 am
by stmdbe2019
For example, User downloaded the PB EXE in C:\username\Download\ on execute how to get the path from where PB EXE was executed from?

Re: Find executed from path?

Posted: Wed Dec 27, 2017 9:18 am
by oO0XX0Oo

Code: Select all

path.s = GetPathPart(ProgramFilename())

Re: Find executed from path?

Posted: Wed Dec 27, 2017 10:01 am
by cas

Re: Find executed from path?

Posted: Wed Dec 27, 2017 11:32 am
by Bisonte
cas wrote:Also check GetCurrentDirectory().
not really... The current directory is set by windows or the user, and can be totally different !

To find out the path from the executed exe, oO0XX0Oo ' s way is the one and only way (on windows os) !

Re: Find executed from path?

Posted: Wed Dec 27, 2017 1:46 pm
by cas
Yeah, my post was just a suggestion for checking another command that by default returns the same thing. He did not say what exactly he needs this path for so there is a possibility that GetCurrentDirectory() will serve him better for his specific needs.