Collections:
Other Resources:
Rename Directory or File in Windows PowerShell
How to rename a directory or file in Windows PowerShell? Can I use the old "ren" command?
✍: FYIcenter.com
Yes, you can still use the old "ren" command in Windows PowerShell.
But "ren" is defined as an alias of the "Rename-Item" cmdlet.
The "Rename-Item" cmdlet changes the name of a specified item, for example a directory or a file in on file system. This cmdlet does not affect the content of the item being renamed.
You cannot use Rename-Item to move an item, such as by specifying a path along with the new name. To move and rename an item, use the Move-Item cmdlet.
The "Rename-Item" cmdlet requires 2 minimum parameters:
The example commands below shows how to use the "Rename-Item" cmdlet to rename a directory and a file:
PS C:\fyicenter> # Renaming a directory
PS C:\fyicenter> Rename-Item logs temp
PS C:\fyicenter> # Renaming a file
PS C:\fyicenter> Rename-Item temp\today.log temp.txt
PS C:\fyicenter> dir temp
Directory: C:\fyicenter\temp
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 5/1/2016 7:12 PM 16 temp.log
⇒ Move Directory or File in Windows PowerShell
⇐ Create Directory in Windows PowerShell
2016-10-24, ∼3036🔥, 0💬
Popular Posts:
What is "@%SystemRoot%\ehome\ehs ched.exe,-101"in my Windows 7 service list? And how is "@%SystemRoo...
Why my Windows XP generates a PIN code for Bluetooth connection? If you try to connect to a new Blue...
Where does Mozilla FireFox 2 store cookie files on my computer? Some cookies are stored to your comp...
What is yinsthelper.dll - DLL File - Yahoo YInstHelper Module? yinsthelper.dll is the Yahoo YInstHel...
Where are services hosted by "svchost.exe -k DcomLaunch" on Windows 7? What is the meaning of "-k Dc...