Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6112247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:43:25+00:00 2026-05-23T14:43:25+00:00

I have some legacy data that was created on Windows XP. It contains absolute

  • 0

I have some legacy data that was created on Windows XP. It contains absolute file names to files in users’ My Documents directories. On Windows 7, these absolute references are no longer point to the correct place. For example what was “C:\Documents and Settings\Gareth\My Documents\readme.txt” should now be “C:\Users\Gareth\Documents\readme.txt”.

Many Win32 functions are happy to take the file names under “C:\Documents and Settings” and to behind the scenes convert them to the new file names, however there are functions we use that don’t do this. Is there a Windows API that I can use to convert these file names to the new locations?

Obviously, I could do string search and replace, but that wouldn’t be guaranteed to work under all circumstances. Because there are Windows functions that seem to do the substitution it feels like there ought to be a published function I can call to do the same thing.

Just to clarify my question: I’m looking for a function that does this:

Input: “C:\Documents and Settings\Gareth\My Documents\readme.txt”
Output: “C:\Users\Gareth\Documents\readme.txt”

or

Input: “C:\Documents and Settings\Gareth\My Documents\”
Output: “C:\Users\Gareth\Documents\”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:43:25+00:00Added an answer on May 23, 2026 at 2:43 pm

    This works with symbolic links. That should work on any function that takes a path, MSDN documentation is here: msdn.microsoft.com/en-us/library/aa365680%28v=VS.85%29.aspx

    I verified MapFileAndCheckSum(), it works fine. Windows7, compiled with UNICODE in effect.

    #include "stdafx.h"
    #include <windows.h>
    #include <assert.h>
    #include <imagehlp.h>
    #pragma comment(lib, "imagehlp.lib")
    
    int _tmain(int argc, _TCHAR* argv[])
    {
        DWORD hdrsum, chksum;
        const wchar_t* path = L"c:\\documents and settings\\hpassant\\my documents\\test.exe";
        DWORD retval = MapFileAndCheckSum(path, &hdrsum, &chksum);
        assert(retval == 0);
        return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some legacy code that was writing to a NITF file to display
I have some legacy python code that using pypar and mpich2 to transmit data
We have some legacy code that needs to identify in the Page_Load which event
I have some really complicated legacy code I've been working on that crashes when
I have been working on some legacy C++ code that uses variable length structures
I have a code-base of legacy C/C++ code, which contains lots of functions that
I have to migrate some legacy data from stand-alone sql server database to sharepoint
I have installed Firefox 4.0 on Windows XP, but for some legacy applications I
I'm working with a legacy application that makes some use of the well-known/dreaded data
I have inherited some legacy PHP code what was written back when it was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.