WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

File Operations

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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
File Created: 1999:04:15:16:52:42
Last Updated: 1999:04:15:16:52:42