Wilson WindowWare Tech Support

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


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