none
C# implements RRS feed

Answers

  • .NET does not support low level disk operations like creating new partitions. To do that you'd need to either call a program that does or P/Invoke. Resizing a partition is limited to what Windows natively supports (e.g. expand or collapse partitions next to free space. Anything else requires a third party program.

    Note also that you probably aren't going to be able to do any of this on the system partition as it is actively in use. Never tried myself but I'd be surprised if it worked. To do that you'd need to run a program that runs at boot time (like Partition Manager) and therefore cannot use managed code.


    Michael Taylor http://www.michaeltaylorp3.net

    • Proposed as answer by Mike_999 Thursday, May 30, 2019 8:36 PM
    • Marked as answer by KareninstructorMVP Saturday, June 1, 2019 5:26 PM
    Thursday, May 30, 2019 1:44 PM

All replies

  • Hello,

    You have not provided enough information to understand what the problem is. Your title does not appear to express the text in the post. So with that please elaborate in detail what is being ask.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, May 30, 2019 11:16 AM
  • .NET does not support low level disk operations like creating new partitions. To do that you'd need to either call a program that does or P/Invoke. Resizing a partition is limited to what Windows natively supports (e.g. expand or collapse partitions next to free space. Anything else requires a third party program.

    Note also that you probably aren't going to be able to do any of this on the system partition as it is actively in use. Never tried myself but I'd be surprised if it worked. To do that you'd need to run a program that runs at boot time (like Partition Manager) and therefore cannot use managed code.


    Michael Taylor http://www.michaeltaylorp3.net

    • Proposed as answer by Mike_999 Thursday, May 30, 2019 8:36 PM
    • Marked as answer by KareninstructorMVP Saturday, June 1, 2019 5:26 PM
    Thursday, May 30, 2019 1:44 PM
  • Windows partition to reduce space and create new partitions

    Yes perhaps you must have we tried several.

    Saturday, June 1, 2019 3:46 PM