How to Clean Disk Partition From Command Line

Posted July 13, 2020 by Joudet Ahsan in Command line

A few days back, I turned on my laptop. Just a routine day. As I clicked the “My computer” folder, it disappeared. An illusion I thought! But, then I clicked on another folder. It disappeared as well. I didn’t stop and clicked an important folder and the pop up for a move to recycle bin..well popped up. This kept happening until I realized that my system is infected. I tried everything but nothing worked. After much hit and trail, I deleted the partitions, and the system was finally stable. Checkout How to Clean Disk Partition From Command-Line.

You can easily mess with your system’s hard disk. You can shrink and extend volumes very easily. But in a situation like the one mentioned above, you have to do it without losing your important data and system configuration. In my case, I was losing the data that I was clicking.

So when I opened the windows drive partition settings, it actually deleted one of my drives( of course I clicked it, you gotta click to work). I lost very important data as my system proceeded to delete the drive. But later I realized that there are ways that do not require actually clicking. Yes! Command-line.

So I went to the command line added a few commands and soon my partitioned were clean.

How to Clean Disk Partition From Command-Line

1. Go to the command line, or click win+R and write cmd.

2. Type “Diskpart”. This will open disk partition.

3. Write “list disk” to see the list of partitions.

4. Write “select disk (#)”. This will select the disk number, numbers are assigned in the list of partitions

5. Now write clean.

WARNING:

When you do this, your data will be gone! Make sure to make a backup or a restore point before you do this.

Check out other tech-recipes

How to Find IP and MAC Address of Your Laptop Through Command Line

Hide Files and Folders in Windows Using Command Prompt

Install Network Printers Via Batch File or Command Line in Windows 7/8 and Server 2008

SQL Server: Execute SQL Script Using SQLCMD Command Line

 

 

 

 

About Joudet Ahsan

SEO Content Creator, a Computer Scientist in making and someone who sucks at writing bios.
View more articles by Joudet Ahsan

The Conversation

Follow the reactions below and share your own thoughts.

Leave a Reply