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 Change Old File plus Path to New Name and Path

Keywords: 	  FileMapName

Question:

I need to move a file from one location to another, then open it. I have the dialog box, I can pick the file, I move the file, but I can't open it then because I don't know the file name. I know the path I moved it to, and I have a variable that has the old path/filename. What I need is just file filename without the path.

Answer:

Look at the FilePath() and FileRoot() functions in the WIL help file. Or, even better:
   newname=FileMapName(oldpathname,"%newpath%\*.*)

Article ID:   W13223
Filename:   Change Old File and Path to New One.txt
File Created: 1999:04:15:16:52:34
Last Updated: 1999:04:15:16:52:34