By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

how to retrieve the absolute path of exe in C

P: n/a
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

Jun 21 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
so***********@gmail.com wrote:
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
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
Jun 21 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.