One way is to type 'diskpart' in the Search box, and then when diskpart appears in the search results, right-click it and select 'Run as administrator'.
You will need to launch Windows 10/11 DiskPart with Administrator permission. Most disk partition operations that you can perform in Disk Management tool are integrated into DiskPart. Users can input DiskPart commands directly to organize hard disk partitions or create a text file script to perform multiple commands. DiskPart, replacing its predecessor - fdisk, is a command-line utility that provides the ability to manage disks, partitions or volumes in your computer running all versions of the operating system since Windows 2000, also including the latest Windows 10.