![]() |
|
#1
|
|||
|
|||
Pathway for My Documents is...Hi! I'm new to Visual C++ and I have a question to ask. I have created a program and I want it copies an existing file on CD to My Documents file when the program's running, just something like installation. I got a code but it's a sample as shown at below. I want to ask what is the pathway for My Documents file. The pathway given in the code below is "c:\\temp\\MyTest.txttemp" where data is copied to. In the pathway of My Documets file, got username and I donn't know what username is used by the user and how can I complete the pathway?
CPP / C++ / C Code:
Last edited by admin : 28-Sep-2006 at 10:44.
Reason: Please insert your C code between [cpp] & [/cpp] tags
|
|||
|
#2
|
|||
|
|||
Re: Pathway for My Documents is...Windows has environment variables used for scripting. That might be the key here, although I have not tried it. The %USERPROFILE% environment variable resolves to C:\Documents and Settings\{username}\ on a WindowsXP machine.
You can do a search for Windows Environment variables and get a list of all of them. I think the key would be to use those like so: String^ path2 = "%USERPROFILE%\My Documents\MyTest.txttemp"; You might have to play with that to get it to compile right. I am not sure though. |
|
#3
|
|||
|
|||
Re: Pathway for My Documents is...Thanks for your reply, Alloishus.
|
Recent GIDBlog
Going to Iraq by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| All my important documents may be lost! | mr5 | Computer Software Forum - Windows | 2 | 15-Sep-2005 03:12 |
| Transferring Data between documents | pixienick | MS Visual C++ / MFC Forum | 6 | 18-Aug-2005 05:34 |
| Apache2 config issues | monev | Apache Web Server Forum | 2 | 28-Jun-2004 06:19 |
| Can't view pages from another machine on the Intranet | aevans | Apache Web Server Forum | 9 | 14-May-2004 02:26 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The