Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Temp directory using virtualized path on some computers

In my Silverlight application I'm using regular SaveFileDialog for prompt user to save some file.

The problem is that on some Windows 7 computers, if user use IE in protected mode, and try to save to for example on desktop, path for saving ends up like this:

C:\Users\<user>\Appdata\Local\Microsoft\Windows\Temporary Internet Files\Virtualized\C\Users\<user>\Desktop

Does anybody know where I can find flag or value indicating that this path will be used instead of regular one on windows?

Thank you

like image 786
Marko Avatar asked Feb 28 '13 17:02

Marko


1 Answers

So after a bit of research I´m afraid there is no Flag or Value which Indicates a Virtualized Path...

I know it´s a little bit russian but assuming that this is static

\Microsoft\Windows\Temporary Internet Files\Virtualized\

You could do something like this to check if the Path points to the Virtualized Folder

public static bool IsPathVirtualized(string path)
{
        bool isVirtualized = false;
        string pathToVirtualizedUserFolder = Path.Combine
        (
            Environment.SpecialFolder.LocalApplicationData + 
            @"Microsoft\Windows\Temporary Internet Files\Virtualized\"
        );

        if(path.StartsWith(pathToVirtualizedUserFolder))
        {
            isVirtualized = true;
        }
        return isVirtualized;
}
like image 65
makim Avatar answered Oct 01 '22 20:10

makim