Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


How to Pick out the File Name in a File Path

Keywords:   filepath fileroot fileextension   

Question:

How do I isolate the file name in a fully qualified file path?

Answer:


filepath="C:\TEMP\ABC.TXT"	
 fp=Filepath(filepath)	;This part isn't really needed, but it shows how to pick out filepath
 fr=FileRoot(filepath)	;get the file root
 fe=FileExtension(filepath)  ;get the file extension

file=strcat(fr,".",fe)	   ;put it all together again
Message("File is", file)

Article ID:   W13240
Filename:   Isolate Filename in a File Path.txt