Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting UserName and Directory in Visual C++

Status
Not open for further replies.

psnead

Programmer
Jul 5, 2000
41
DK
I am writting a text based C++ program in Microsoft Visual C++ for Win 98/NT, and need the UserName and directory path.  So far, all I have been able to find are functions that work with dialog boxes.  Are there any system calls I can use to get the UserName and Directory in a text based program?
 
Dear psnead,<br><br>The Windows API GetUserName() will provide the currently logged on user. Then _getcwd() will give you the entire path of the current working directory.<br><br>Good luck<br>-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top