Adds an extension to the end of the path.

Syntax

NewPath = SRP_Path("AddExtension", Path, Extension)

Parameters

ParameterDescription
PathA path without command line parameters.
ExtensionA new file extension with or without the period.

Returns

The path with the file extension added.

Remarks

The AddExtension service adds the given extension to the end of the path, ensuring exactly one period before it. You can pass the extension with or without the period. Note that the service does not care whether or not the path is well formed or already has an extension. It simply appends the text.

Example

Result1 = SRP_Path("AddExtension", "C:\File", "txt") 
Result2 = SRP_Path("AddExtension", "C:\File", ".txt") 

Both Result1 and Result2 will contain "C:\File.txt".

See Also

GetExtension, RemoveExtension, RenameExtension

  • No labels