Use the Command Prompt window to access the P: (EFI System Partition, or ESP) volume. You'll need to use text-mode commands, rather than the GUI, but this method should work. Another alternative is to use another OS. Show Me How This DISKPART Script Fixes Default Win10 Disk Layout! Basically, a DISKPART script is a text file with a.txt extension. Collecting all the DISKPART commands from Part 1, we simply add some remarks to document our work. Note: lines that start with rem are ignored when the script runs. DISKPART scripts run from the Command Prompt using this syntax diskpart /s Z: MyScript.txt. In this command, Z: identifies the drive where the script resides. We save such scripts at the root of our install media. That means USB flash drives for physical installs, and in ISO files for Hyper-V virtual machines. Any available storage location will work. Thus, for instance, if you cannot add files to an install DVD, save the script on a flash drive instead. Running the script There’s one small issue with this script, though. Using GPT we don’t always know the drive letter for our install media or the media where the DISKPART script resides. In fact, those values depend on knowing if the disk is new, and all space unallocated, or if it is partitioned and formatted with drive letters assigned. ![]() In other words, YMMV. That said, there’s an easy workaround. Before running the script, we need to know the install media’s volume label. That way, we can figure out which drive letter Windows setup assigns to that device. Knowing that, we can call the DISKPART script from the correct device. We saved our DISKPART script as DiskConfig.txt on root of our Windows 10 PRO install media. This is a USB Flash drive labelled W10PRO_USB. The following command elicits the drive letter for any medium (DVD, flash drive, HDD partition) labelled W10PRO_USB. Then it then runs the DISKPART script DiskConfig.txt. Note: this command is a one-liner, even though word wrap breaks across 2 lines: for /f%X in (‘wmic volume get DriveLetter ^, Label ^| find “W10PRO_USB”‘) do DISKPART /s%X DiskConfig.txt In this command string, notice the%X value before the script filename. Here, this does not refer to drive X. Rather, it’s a variable that points to the media labeled W10PRO_USB. In fact, script variables are denoted with a single% sign at the command line. But you must use two% signs in batch files to make them work. That is, you’ll enter the text shown above that uses%X, but when you add that same command in a batch file, use%%X instead. Script Output Illustrated That’s it. When we boot Windows from our install media, a properly labeled flash drive must also be present (if the script is stored elsewhere). Then, we press SHIFT + F10 to open the Command Prompt. Finally, we enter the preceding command and let our partitioning script do its thing: Here’s the output from the script as it runs. [Click image for full-sized view; this version is hard to read!] In under 30 seconds, our boot/system drive is partitioned just the way we like it!
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2019
Categories |