Contents |
Effect
Renames file(s) on the disk in a drive.
Syntax
NAME "<Device>:\<Path>\<Filename>" AS "<Device>:\<Path>\<NewFilename>"
Notes:
- Character backslash (\) serves as a separator between the folders and the file name in MSX-DOS2. You don't have to put it after the colon of the device name.
- Character backslash is replaced by the character yen (¥) on Japanese MSX or the character won (₩) on Korean MSX.
Parameters
<Device> is the name for used device. It can only be a disk drive.
If you don't specify the drive, the computer will rename file(s) on the currently active drive (by default, it's drive A:)
Device type | Device name | Remark |
---|---|---|
Disk drive | A, B, C, D, E, F, G, H | A floppy disk interface can control until 2 drives. |
<Path> is used to specify the location in folders of the file(s). Each folder name in path are separate by a backslash (\). This parameter is only available in version 2 of Disk BASIC.
<Filename> is a string containing the file name to rename. Wildcards can replace some characters in filename to get several files. The asterisk (*) and question mark (?) are used as wildcard characters. The asterisk matches any sequence of characters, whereas the question mark matches any single character.
<NewFilename> is a string containing the new file name to apply. Wildcards can replace some characters in filename to get several files. The asterisk (*) and question mark (?) are used as wildcard characters. The asterisk matches any sequence of characters, whereas the question mark matches any single character.
File names are in the format 8 characters followed by a point and an extension with 3 characters. They need to be different and the new file name can't already be used for another file on the disk inserted in the specified disk drive.
Examples
NAME "M*.*" AS "N*.*" 'Rename all files with a name beginning with character M NAME "*.BAS" AS "*.LDR" 'Rename all files with the extension ".BAS" NAME "B:*READ.TXT" AS "MANUAL.TXT" 'Rename file READ.TXT in drive B
Related to
Compatibility
Disk BASIC 1.0 or higher / both modes of Nextor OS