Link to home
Start Free TrialLog in
Avatar of dotnet22
dotnet22

asked on

GetShortPathName and regedit

Here is an article http://geekswithblogs.net/mnf/archive/2005/09/30/55580.aspx    that uses regedit to export a registry key....  The exporting is done in the following funtion

public static void ExportKey(RegistryKey rKey, string sfile)
{

            RegistryHelper.ExportKey(rKey.Name, sfile);

}

Now if you follow this function you will see that it calls a function

public static string GetShortFileName(string path)

            {

                  StringBuilder builder1 = new StringBuilder(0x400);

                  int num1 = GetShortPathName(ref path, builder1, builder1.Capacity);

                  return builder1.ToString(0, num1);

            }
I do not see why a call to get the shortpatname, 8.3 is required or why the builder1.ToString(0,num1) is required? Why can't we just pass in the regular path.  When do we have to worry about shortpath names?
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial