locked
CorrectFilePaths Parameters & Environment Variables RRS feed

  • General discussion

  • I've an application where I've sucessfully used CorrectFilePaths. The app in question had permissions issues to the network on our redirected profile group policy. We need redirection, so switching it off wasn't an option. Loosing this app isn't either.

    I had to do some hard coding to get things to work. I then, as you would, attempted to remove \\\ & c:\ etc by using the related environment variables. My first mistake was using %APPDATA% instead of %userappdata% but thanks to Mr Jackson I found the correct variable to use:

     http://blogs.msdn.com/b/cjacks/archive/2007/10/15/using-the-correctfilepaths-shim-to-redirect-files-on-windows-vista.aspx

    Unfortunately my parameters look like this:

    "<Redirected profile>\<path to file>";"<local profile>\App Data\Roaming\<same path to file>" or more explicitly:

    "%userappdata%\etc";"%userprofile%\etc"

    But this doesn't actually work.

    Let me cut a long story short by explaining the only way I could get this running was is to avoid beggining with a variable and instead, use them later:

    '\\<server>\<folder>\<folder>\%username%\App Data\Roaming\<path to file>";"%userprofile%\etc"

    The application functions correctly; the only problem is that I really need to use something akin to "%userappdata%". Our SAN has all of our user homedrives hanging off different sub folders of the same shares (hence <server>\<folder>\<folder>\%username%) so using %username% isn't really ideal because <folder> is going to be different in different areas of the organization.

     

    My questions:

    Anyone else begun CorrectFilePaths with a variable and won?

    Is "%userappdata% still valid? As the URL above is getting on a bit....

     

    • Moved by Jie Bao Sunday, August 21, 2011 10:08 AM (From:Application Compatibility for Windows Development)
    • Changed type Cloud_TS Tuesday, August 23, 2011 5:53 AM duplicate
    Wednesday, August 17, 2011 8:24 AM

All replies