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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where is the 'My Documents' folder? 3

Status
Not open for further replies.

pjw001

Technical User
Aug 12, 2002
297
GB
This is relevant to a number of Windows versions, but the one I had the problem with most recently was on Windows 7, with the added complication of redirected folders.

I ran some software that outputs a log file and I would usually find the file in 'C:\Documents and Settings\UserName\My Documents\SoftwareFolder'. (The software creates the last folder if it is not there.)

The software determines the folder using 'Dim sFDSFolder As String = My.Computer.FileSystem.SpecialDirectories.MyDocuments’.

My question is, how can I find out where this folder is? Is there an environment variable or a registry entry that I can check?

Any guidance would be much appreciated.
 
well in windows 7 things are moved around a bit. in 7 everything is inside users\*name*\(My Documents,Downloads,etc.). Or it can be found in explorer under Libraries\Documents. Just click on the file folder on the task bar, and Libraries will be in the left pane. Or you should have noticed that the run window under start has been replaced with a search bar, this also will do "run" type commands,and is a very nice search tool to find where a file went.
 
Thank you for the reply but that isn't quite what I wanted to know.

What I want to know is, how do I find 'My Documents' if it isn't where I expect it to be? Is there an environment variable or regeistry setting that will tell me?

Search isn't much use as I don't neccessarily know either the file or folder name. All I know is that the file has been placed in a folder under what is considred to be 'My Documents'.

How can I find out what 'My.Computer.FileSystem.SpecialDirectories.MyDocuments' returns without actually writing a .net program?
 
As RClarke said. c:\users\(your user name)\My Documents\

Or I believe you can go to computer, select the spot that says (name of use) documents. Then hit the up arrow. I'm not sure if that will back you out one dir or if it will just bring you to the desktop.
 
I don't understand what you mean by 'go to computer'.

As far as 'c:\users\(your user name)\My Documents\' goes, this did not exist. The user folders had been 'redirrected' to somewhere on the network, presumably so that whichever pc you logged into, your 'My Documents' folder was always available.

What I need is a way to identify where the folder actually is. I do know where it usually is, but that is not helping me if someone has moved it elsewhere.
 
Do you know what file extension some of the files in this folder would be? If so, lets say for ex there are some .pdf files in there, do a windows find and type *.pdf which will search the whole directory to find .pdf files then locate which one you are looking for and copy the address path.

"Silence is golden, duct tape is silver...
 
To DrB0b - the file is somewhere on the network. It is certainly not on any of the local drives.
 
try this, open a CMD window, then type the following into the CLI and hit return:

%HOMEPATH%
or
%USERPROFILE%

if that does not help any, then only the Registry would reflect where the Documents folder would be relocated...

PS: here is a list of all the Environmental Variables available in XP and Vista/W7

XP

V/W7


Ben
"If it works don't fix it! If it doesn't use a sledgehammer..."
How to ask a question, when posting them to a professional forum.
Only ask questions with yes/no answers if you want "yes" or "no"
 
%USERPROFILE% is the environment variable that you want. You can use "%USERPROFILE%\My Documents" to get the docs folder and it will work on both Windows 7 and Windows XP because even though the folder is now called 'Documents' (without the 'My') under Windows 7, 'My Documents' still exists as a junction (essentially a hard link) to the 'Documents' folder.

Regards

Nelviticus
 
Sorry for the delay in responding, but a big thank you to linney, BigBadBen and Nelviticus.
This was exactly the information I was looking for.
Thank you all very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top