Changes the name of a file to a new name.
RENAME FileName1 TO FileName2
- FileName1 TO FileName2
- Specifies the file name to change and the new file name. Include a file extension for each file. If the file extensions are not included, the default extension .dbf is assumed. If you rename a free table that has an associated .fpt memo file, be sure to rename the memo file. Include a period (.) after the file name to rename a file that doesn't have an extension.
Do not use RENAME to change the name of a table in a database; RENAME does not change the name of the table in the database. Use RENAME TABLE to change the name of a table in a database.
Include paths with either or both file names if the files are not on the default path. If FileName1 and FileName2 are in different directories or folders, FileName1 is moved into the directory or folder of FileName2.
When you issue RENAME, FileName2 cannot already exist and FileName1 must exist and cannot be open.
FileName1 and FileName2 can contain wildcard characters such as * and ?. For example, to rename all program files with the extension .prg in the current directory or folder to backup files with extension .bak, issue RENAME *.prg TO *.bak.