Sunday, September 23

Changing the name of a file

RENAME OR REN
The RENAME or REN command allows you to change the name of a file or group of files.

  • This command does not change the contents of the file.
Syntax
REN[drive:] [path] old file name new file name
Where,
[drive:][path] : drive, directory location of file.
old file name :name of file to be renamed.
new file name : new name for the file.
Example
1. C:\>REN CLASSIX CLASS NINE (press enter key)
It changes the name of the old file CLASSIX to CLASS NINE ; but the contents of file CLASS ix will not be altered.

Example 2
C:\>REN*.OPT*.TXT(Press enter key)
It is used to change the extension of a group of files having extension OPT to the extension TXT. The name of the files remain unchanged, only the extension are altrered.
Again you change TXT extension to COM extension

Example 3
C:\>REN A:\COMPUTER MACHINE(press enter key)
It renames the file COMPUTER of A : drive to Machine from C: drive.
Note : To use Example 3, you should have disk in A: drive having file COMPUTER.

  

No comments:

Post a Comment