Computing.Net > Forums > Programming > Visual C++ System() pwd???

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Visual C++ System() pwd???

Reply to Message Icon

Name: Kristoffer Nordström
Date: March 20, 2003 at 06:21:42 Pacific
OS: Windows 98
CPU/Ram: 500 Mhz
Comment:

Hello everyone.
I have a problem that i can´t seem to find the answer for.
I want to know the current location from where my .exe file is executed, much like in Unix where i do a system() call and invokes the pwd command.
Is there something similare to this in windows/visual c++????

Thanx in advance.



Sponsored Link
Ads by Google

Response Number 1
Name: kev
Date: March 20, 2003 at 14:56:42 Pacific
Reply:

Hmm... Well, I haven't tried it, but it would seem that the GetCurrentDirectory function should work:

GetCurrentDirectory(
DWORD nBufferLength, // size, in characters, of directory buffer
LPTSTR lpBuffer // pointer to buffer for current directory,
);

If that's not what you're looking for, look at the related functions towards the bottom of this page

What I found on MSDN

Hope this helps,
Kev


0

Response Number 2
Name: Kristoffer Nordström
Date: March 21, 2003 at 08:26:21 Pacific
Reply:

This help very much.
This was exactly what I was looking for.
Thank you so much.



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Visual C++ System() pwd???

visual C++ vs C++ and C www.computing.net/answers/programming/visual-c-vs-c-and-c/8925.html

I have a problem with Visual C#... www.computing.net/answers/programming/i-have-a-problem-with-visual-c/11139.html

Visual C++ 6.0 service packs to CD www.computing.net/answers/programming/visual-c-60-service-packs-to-cd/7837.html