Definately. But...it's OS dependant so you need to look it up.
And yes and no for the "going to the directory it's located." The program never sits in a directory ever. It has a default directory where it will look for things, etc. but when you open something or list the directory, you need to specify the entire path if it is not a local path (ie the path the program is in).