How to find the current path?

This is a discussion on How to find the current path? within the C++ Programming forums, part of the General Programming Boards category; Hi all, Is there a method that will tell me the pathname of where the current process resides? I know ...

  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    100

    How to find the current path?

    Hi all,

    Is there a method that will tell me the pathname of where the current process resides?

    I know there is a GetModuleFilename that will tell me the exact path and the filename of the current process, but i just want the path.

    Thanks

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    Take the return string from GetModuleFilename() and chop off the filename -- what you have left is just the path.

    But if you want the current working directory, you can get that from getcwd() or win32 api GetCurrentDir().

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 10:13 AM
  2. clipping path
    By stanlvw in forum Windows Programming
    Replies: 0
    Last Post: 07-24-2008, 12:47 AM
  3. Can a executable find the path to itself?
    By sulli_jj in forum C Programming
    Replies: 3
    Last Post: 06-23-2006, 01:27 PM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 04:00 PM
  5. Q: Recursion to find all paths of a maze
    By reti in forum C Programming
    Replies: 7
    Last Post: 11-26-2002, 09:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21