
It is finished, the partition table has been deleted, if an OEM partition was present, it is deleted. To delete all partitions enter the command below : clean Step 2: Now go to the drive you want to scan for shortcut (autorun.inf) virus. In PowerShell or Command Prompt: diskpart > list disk > select disk > list partition > select partition > delete partition override. If we re-enter the list disk command, we can see that an * is present in front of the disk indicating that it is selected. This is a type of common virus and you can remove it from your PC using the steps below. This will select the disk number, numbers are assigned in the list of partitions. Remember the desired disk number Type: select disk. Write list disk to see the list of partitions. To remove Active flag: Run Command Prompt as Administrator Type: diskpart Type: list disk. You can see that the command returns a message indicating that disk X is selected. Go to the command line, or click win+R and write cmd.

When I made this tutorial, I had to delete all partitions from disk 1, enter the command below to select the disk where you want to delete the partitions (to be adapted to your situation).

Now that I have warned you, we can go, DISKPART is a command line utility that you will find on Windows (and also in the WinPE installation environment).įrom a command prompt, enter the DISKPART command to open the utility DISKPARTĮnter the command below to list the available hard drives : list disk Format an external hard drive using CMD Type diskpart Type list disk Enter select disk X Type clean Now, you have to create a new partition. I am using this procedure to remove OEM partitions on computers from manufacturers like HP / DELL.īefore performing this operation, make sure you have a backup of the data.

If you want the process to start automatically, use the switch /VERYLOWDISK instead.
#Clean disk cmd how to#
In this tutorial, I will tell you how to delete all partitions from a hard drive with DISKPART. The command will launch Disk Cleanup tool against the drive c with all checkbox checked by default.
