![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to rename the drive letter in Windows using PowerShell?
We can rename a drive letter of a disk using PowerShell with the Set-Partition command. An example is shown below.
In the Windows OS, we have E: and we need to rename its partition to the F: You can run the below command.
Set-Partition -DriveLetter 'E' -NewDriveLetter 'F'
You can also run the Get-Partition command and Pipeline the Set-Partition command. For example,
Get-Partition -DriveLetter 'E' | Set-Partition -NewDriveLetter 'F'
If you want to rename the drive on the remote computer, then you need to take the CIMSession of the system and run the command. For example,
$sess = New-CimSession -ComputerName 'Test1-Win2k12' Set-Partition -CimSession $sess -DriveLetter 'E' -NewDriveLetter 'F'
Advertisements