Thread: How to find the current path?

  1. #1
    Registered User
    Join Date
    Oct 2004

    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.


  2. #2
    Registered User
    Join Date
    Aug 2005
    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, 09:13 AM
  2. clipping path
    By stanlvw in forum Windows Programming
    Replies: 0
    Last Post: 07-23-2008, 11:47 PM
  3. Can a executable find the path to itself?
    By sulli_jj in forum C Programming
    Replies: 3
    Last Post: 06-23-2006, 12:27 PM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of
    Replies: 16
    Last Post: 10-02-2004, 03: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