Visual Studio 2010 - DirectoryExists returning false positive

SpotIT
SpotIT used Ask the Experts™
on
Hello,

Curious if anyone else has seen, heard, or knows the solution to the issue I am experiencing in Visual Studio 2010. I am running a Directory Exists test on a remote system and receiving false positives. For example I am running the following on a Windows 7 system:

If (my.computer.filesystem.directoryexists("\\MachineName\C$\Documents and Setting\UserID\Desktop")) Then

'Do what i want

End if

Although the system is Windows 7 and does not contain the directory "Documents and Settings" Visual Studio is returning a value of true indicating the Directory Exists.

Any ideas?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior .Net Developer
Commented:
I think windows 7 DOES have the documents and settings folder (though usually denied to users).

It could be doing translations in the kernel to automatically point to the user's folder.  

Can you try with a nonsense user folder to see if it still returns true?

Author

Commented:
OMG! Why would Microsoft Toy with me like this? Had no idea that it still existed, i thought it was completely replaced by the Users folder.

I should have reached out to you sooner and saved days of staring blankly at my code.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial