Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old June 21st, 2007, 07:55 AM
somank.sharma@gmail.com
Guest
 
Posts: n/a
Default how to retrieve the absolute path of exe in C

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

  #2  
Old June 21st, 2007, 07:55 AM
John Harrison
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,338 network members.