Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: File and Folder - Rename from Command Prompt


File and Folder - Rename from Command Prompt

How to Rename a File and Folder from the Command Prompt
Published by Brink
17 Jan 2010
Published by

How to Rename a File and Folder from the Command Prompt

information   Information
This will show you how to rename a file and folder using the REN or RENAME command from within a command prompt. This can be handy if you cannot rename the file or folder normally.

Normally you would just right click on the file or folder, click on Rename, and type in a new name for it.
Note   Note
While you can run this command in a non-elevated or elevated command prompt, you would get the best results using a elevated command prompt.

EXAMPLE: REN and RENAME Command
NOTE: You can use either the REN or RENAME command in the command prompt. They are the same command.
Name:  About_REN_RENAME.jpg
Views: 52659
Size:  72.2 KB




OPTION ONE
To Rename a File from the Command Prompt
1. To Use a Elevated Command Prompt in Windows
A) Make sure that the file is not set to be hidden.
B) Open Folder Options and uncheck the Hide extensions for known file types option and click on OK. (see screenshot below)
NOTE: This way you will be able to see the file extension in your file's name to use in the command below.
Name:  Folder_Options.jpg
Views: 38696
Size:  138.0 KB
C) Open a elevated command prompt.

D) Go to step 3.
2. To Use a Command Prompt at Boot
A) Open a command prompt at boot.

B) In the command prompt, type diskpart and press Enter. (see screenshot below)

C) In the command prompt, type list volume and press Enter. (see screenshot below)
NOTE: This will let you see what the drive letter is for the drive that you want to delete the file in since it may not always be the same drive letter that it is in Windows.

D) After making note of the drive letter, type exit and press Enter. (see screenshot below)
File and Folder - Rename from Command Prompt-boot-1.jpg
3. In the command prompt, type the command below and press enter.
NOTE: Substitute Full Path of File with extension within quotes below with your files's full path and name with the extension included within quotes instead. Substitute New File Name with extention within quotes below with only the new name and file extension you want to rename the file with.

Code:
REN "Full Path of File with extension" "New File Name with extension"
NOTE: For example, if I wanted to rename a text file named File1 with the file extenstion .txt on my desktop to File2 with it keeping the same .txt file extension, I would type this command below.

Code:
REN "C:\Users\UserName\Desktop\File1.txt" "File2.txt"
Name:  Rename_File.jpg
Views: 40571
Size:  56.3 KB
4. The file should now be renamed. Close the command prompt.




OPTION TWO
To Rename a Folder from the Command Prompt
1. To Use a Elevated Command Prompt in Windows
A) Make sure that the folder is not set to be hidden.
B) Open a elevated command prompt.

C) Go to step 3.
2. To Use a Command Prompt at Boot
A) Open a command prompt at boot.

B) In the command prompt, type diskpart and press Enter. (see screenshot below)

C) In the command prompt, type list volume and press Enter. (see screenshot below)
NOTE: This will let you see what the drive letter is for the drive that you want to delete the file in since it may not always be the same drive letter that it is in Windows.

D) After making note of the drive letter, type exit and press Enter. (see screenshot below)
Click image for larger version

Name:	Boot-1.jpg
Views:	7443
Size:	198.5 KB
ID:	143269
3. In the command prompt, type the command below and press enter.
NOTE: Substitute Full Path of Folder within quotes below with your folder's full path and name within quotes instead. Substitute New Folder Name within quotes below with only the new name you want to rename the folder with.

Code:
REN "Full Path of Folder" "New Folder Name"
NOTE: For example, if I wanted to rename a folder named Folder Name1 on my desktop to Folder Name2, I would type this command below.

Code:
REN "C:\Users\UserName\Desktop\Folder Name1" "Folder Name2"
Name:  Rename_Folder.jpg
Views: 38493
Size:  60.2 KB
4. The folder should now be renamed. Close the command prompt.
That's it,
Shawn




.

Comment

 File and Folder - Rename from Command Prompt





Tutorial Tools



Similar help and support threads for2: File and Folder - Rename from Command Prompt
Windows 7 Tutorial Category
Folder - Delete from Command Prompt Tutorials
File - Delete from Command Prompt Tutorials
Solved double clicking a folder opens a command prompt General Discussion
How do I Close an opened folder in Run or at the Command prompt General Discussion
Solved Command Prompt missing File Menu General Discussion
Use of free form file names in Command Prompt General Discussion
programmatic way with BAT file determining if elevated command prompt General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:22 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33