Back to Homepage
Wednesday 7 August 2024
6

How to rename a file in PowerShell

Steps to Rename a File in PowerShell

Need to rename a file in PowerShell? Follow these easy steps:

1. Open PowerShell:

  • Press Win + X, then select Windows PowerShell.

2. Locate the File:

  • Navigate to the directory containing the file with cd "C:\path\to\your\directory".

3. Rename the File:

  • Use Rename-Item -Path "oldfilename.txt" -NewName "newfilename.txt" to rename the file.

4. Verify the Renaming:

  • Check the directory with Get-ChildItem to ensure the file has been renamed.
Share:
Created by:
Author photo

Jorge García

Fullstack developer