I want to create a program to delete a partition using VB.NET or CSharp.NET
But I have no idea how to do it. I know a big portion of VB.NET now and not this.
I canĀ“t find it on the whole internet and this website is my best bet.

1 Year
Discussion Span
Last Post by Ghast

I'm going with you should not do this. Why? Because your app could be on any Windows version from XP to 10 and the commands vary from OS to OS and machine to machine. That said if I was to tackle this I would shell out to the host OS's command line disk partition tool.

As you know your OS target, then find it's diskpart command line and shell to that to do the deed.

Since shelling out is widely discussed I'll leave that to you.


Why bother? There is already a program (diskmgmt.msc) on every version of Windows that already does this. And if you need finer control and more options there is diskpart.exe which is also included.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.