Re: Problem with Windows 7 Libraries
Hello,
Thank you for your answer.
I saw there forums from the link "Managed newsgroup" in my msdn suscription.
For the error, I have tried with your code and it still doesn't work.
Code (VB.NET)
' Your code
Dim computer As Devices.Computer = New Devices.Computer()
Console.WriteLine(computer.FileSystem.SpecialDirectories.MyDocuments)
' My code
Debug.Print(My.Computer.FileSystem.SpecialDirectories.MyDocuments)
In every case, I have C:\Users\UserName\Documents.
When I look at the libraries, I have
Libraries
Documents
Public Documents
My Documents (d:\)
If I do a Right click / Properties on Documents (the top one, not My
Documents) to have the list of documents
I have
Public documents (c:\Users\Public)
V My Documents (d:\MarcDatas) (with a V before as it is the default save)
After doing some tests, I have seen my problem.
To move the My Documents folder, I have added the new location in the
libraries, and I have removed the old one. All seems to be OK (as you can see
in the libraries).
Now I have added the old location back and I did like you told me and now it
is working.
Thank you again
Marc
"Peter Duniho" wrote:
On Tue, 01 Sep 2009 06:03:02 -0700, Marc Allard <marc@nospam.allcomp.be>
wrote:
Does any one have an idea?
Am I in the managed MSDN forums? or did I choose a wrong option?
If you have an MSDN subscription, I think maybe this is no longer the
right forum. Microsoft used to answer MSDN subscriber questions here, but
I seem to recall seeing a recent message saying that they'd moved their
managed support over to a web-based forum. Sorry I don't have more
specifics about that.
As for your question, I believe that your problem is probably more user
error than anything else. I've tested and verified that when I change the
"My Documents" location, the .NET
Environment.GetFolderPath(SpecialFolder.MyDocuments) as well as the
VB-specific FileSystem.SpecialDirectories.MyDocuments both return the
correct folder location. (See below for a concise-but-complete code
example).
So, I can only conclude that you are not actually changing your "My
Documents" folder correctly.
In Windows 7, you need to expand the "Documents" item in the navigation
pane, right-click on the "My Documents" item, choose "Properties" and then
go to the "Location" tab in the "Properties" dialog. There, you can click
the "Move..." button to change the location of that special folder.
If the above information does not help, then you need to post a more
specific question. Post a concise-but-complete code example that shows
exactly how you're retrieving the "My Documents" folder path, as well as a
clear, specific description of how you're changing "the My Documents
libraries" in Windows Explorer.
Pete
using System;
using Microsoft.VisualBasic.Devices;
namespace TestDocumentsSpecialFolder
{
class Program
{
static void Main(string[] args)
{
// The .NET way:
Console.WriteLine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
// The VB way:
Computer computer = new Computer();
Console.WriteLine(computer.FileSystem.SpecialDirectories.MyDocuments);
}
}
}