Removes everything except the last component of a path.

Syntax

NewPath = SRP_Path("RemoveDirectory", Path)

Parameters

ParameterDescription
PathA path with or without command line parameters.

Returns

The path without the directory.

Remarks

The RemoveDirectory service returns the given path without the directory. Thus, it returns only the filename and extension. Quotes are preserved.

Note. This method supports paths that contain command line parameters. In this case, command line parameters are returned along with the filename and extension.

Example

Path = "C:\path1\path2\path3\filename.txt"
Result = SRP_Path("RemoveDirectory", Path)

Result will be "filename.txt".

See Also

GetDirectoryRemoveBackslash, RemoveExtension, RemoveFilename, RemoveParameters

  • No labels