Makes a path relative to another path.

Syntax

NewPath = SRP_Path("MakeRelative", PathFrom, PathTo)

Parameters

ParameterDescription
PathFromA path without command line parameters.
PathToA path without command line parameters.

Returns

The first path reformatted to be relative to the second path.

Remarks

The MakeRelative service reformats the path passed into PathFrom to make it relative to the path passed into PathTo. This can return an absolute path if the second path has a different root. IMPORTANT: If you do not use a backslash at the end of your first path, then the last component will be treated as a file.

Example

Result1 = SRP_Path("MakeRelative", "C:\Windows\", "C:\Windows\System32\")
Result2 = SRP_Path("MakeRelative", "C:\Windows", "C:\Windows\System32")

Result1 will be ".\System32\". Result2 will be ".\Windows\System32".

See Also

Expand

  • No labels