Connecting Tech Pros Worldwide Forums | Help | Site Map

how to retrieve the absolute path of exe in C

somank.sharma@gmail.com
Guest
 
Posts: n/a
#1: Jun 21 '07
Hi All,

I am running an exe which is written in C. In the main method of this
exe I am getting the exe name as the first argument argv[0], I want
the full path of this exe. How can I retrieve this?
Any help would be greatly appreciated.

- Darshi


John Harrison
Guest
 
Posts: n/a
#2: Jun 21 '07

re: how to retrieve the absolute path of exe in C


somank.sharma@gmail.com wrote:
Quote:
Hi All,
>
I am running an exe which is written in C.
This group is comp.lang.c++. You should ask C questions in comp.lang.c

In the main method of this
Quote:
exe I am getting the exe name as the first argument argv[0], I want
the full path of this exe. How can I retrieve this?
Any help would be greatly appreciated.
There is no way to do this in standard C++ (or standard C I think).

You need some platform specific API, and we can't help you about that
here. Ask on a group that deals with your platform. If you are
programming Windows then try

comp.os.ms-windows.programmer.win32

john
Closed Thread