------------------------ MS-DOS v6.22 Help: RENAME -------------------------
<Notes> <Examples>                                               <Index>
----------------------------------------------------------------------------

                                RENAME (REN)

Changes the name of the file or files you specify.

You can rename all files matching the specified filename. You cannot use the
RENAME command to rename files across drives or to move files to a different
directory location. To rename subdirectories or move files, use the <MOVE>
command.

Syntax

    RENAME [drive:][path]filename1 filename2

    REN [drive:][path]filename1 filename2

Parameters

[drive:][path]filename1
    Specifies the location and name of the file or set of files you want to
    rename.

filename2
    Specifies the new name for the file or, if you use wildcards, the new
    names for the files. (You cannot specify a new drive or path.)

Related Commands

For information about renaming directories, see the <MOVE> command.

For information about renaming a disk, see the <LABEL> command.

For information about copying files to a different drive or directory, see
the <COPY> command.

For information about copying entire directories to a new location, see the
<XCOPY> command.

                                      ***

<Syntax> <Examples>
----------------------------------------------------------------------------

                               RENAME--Notes

Using wildcards with RENAME

You can use wildcards (* and ?) in either filename parameter. If you use
wildcards in filename2, the characters represented by the wildcards will be
identical to the corresponding characters in filename1.

RENAME will not work if filename2 already exists

If, for filename2, you specify a filename that already exists, RENAME
displays the following message:

    Duplicate file name or file not found

                                      ***

<Syntax> <Notes>
----------------------------------------------------------------------------

                              RENAME--Examples

Suppose you want to change the extensions of all the filenames in the
current directory that have the extension .TXT; for example, suppose you
want to change the .TXT extensions to .DOC extensions. To make this change,
type the following command:

    ren *.txt *.doc

To rename a file named CHAP10 (on drive B) to PART10, type the following
command:

    ren b:chap10 part10

The newly renamed file PART10 remains on drive B.

                                      ***

----------------------------------------------------------------------------
<Top of page>
Last update: December 07, 2002 14:45 by
Content © 1997 Microsoft Corporation
All else © 2000-2005
Counter