Rename directory from command line
https://www.windows-commandline.com/rename-directory-from-command-line/
Rename directory from command line
by SRINI
In Renaming files from command line we saw how to rename files using Rename command. We can use Rename command to rename directories too. See the syntax below.
Example:
Note that, with rename command, we can’t move the files to another drive or directory. This command just renames the existing file/folder and does not create a new file. That is why it does not accept full path for the target file name. If you try to do that you will get the error – “The syntax of the command is incorrect.”
Example:
The below rename command works fine.
We can also use ren (the short form of rename) for rename operations. Both Ren and Rename refer to the same command.
This command can be used to rename files or directories on all Windows OS editions i.e Windows 2000, XP, Vista and Windows 7.
Related Posts:
Delete directory from Windows command line16 comments… add one
Guillaume Drolet
What causes Access denied exactly? I somehow got it to work. I used rename then I tried again move and move was working after that. I have no idea what I was doing wrong because I tried everything I did at first with move and it didn’t give me access denied again.
Of course I did start the command prompt with administrator rights (well at first I didn’t but I restarted it with admin rights and it was still giving me the same error)REPLY LINK
Doug
You must use cmd in administrator mode. Right click on cmd and select run as administrator
Last updated