basename

Returns trailing name component of path. (version 4.69 or later)

basename <strvar> <path>

Remarks

Given a <path> string containing the path to a file or directory, this macro will return the trailing name component into the <strvar> variable name.
The file or directory will need not be existed.

Example

basename fname 'c:\teraterm\test.txt'
; fname = "test.txt"

See also