Windows Enterprise Desktop


July 13, 2017  1:23 PM

Win10 Volume Shadow Copies May Need Cleanup

Ed Tittel Ed Tittel Profile: Ed Tittel
Disk cleanup, Shadow Copy, VSS Backup, Windows 10

Mostly, the Windows Volume Shadow Copy Service works behind the scenes. This service coordinates among backup tools, applications in need of backup, and OS-provided storage management and hardware. Usually abbreviated VSS, this service enables creation and capture of shadow copies. Helpfully, TechNet defines “a consistent shadow copy” as “a snapshot or a point-in-time copy” of the runtime environment and the data it uses. Shadow copies let the OS and applications keep running and changing, even while backup is underway. Over time, shadow copies can accumulate, sometimes alarmingly. And that, dear readers, is why Win10 volume shadow copies may need cleanup or occasional pruning.

VSSadmin Helps When Win10 Volume Shadow Copies May Need Cleanup

Use the VSSadmin command to grapple with VSS and the shadow copies it creates and stores. Thus, you can (and should) consult the TechNet Command Line Reference for all the details on VSSadmin. For now, here’s an overview:

Vssadmin Command Description
delete shadows Deletes volume shadow copies.
list providers Lists registered volume shadow copy providers.
list shadows Lists existing volume shadow copies.
list shadowstorage Lists all shadow copy storage associations on the system.
list volumes Lists volumes that are eligible for shadow copies.
list writers Lists all subscribed volume shadow copy writers on the system.
resize shadowstorage Resizes the maximum size for a shadow copy storage association.

Source: TechNet Command Line Reference: Vssadmin page. All links are live to command options and details.
[Note: Command options not shown in this table are not supported in Windows 10.]

Getting a Handle on Volume Shadow Storage Consumption

By no coincidence, Vssadmin helps you explore shadow copy storage consumption in Windows 10. First, for an overview of which volumes use VSS, and how it lays out, the “list shadowstorage” option is handy. [Note: for Vssadmin, either PowerShell (Admin) or cmd.exe (“Run as administrator”) works equally well. I prefer PowerShell, because it is more powerful and responsive, and supports simpler cut’n’paste operations.]

Here’s a screen cap of the output for this command from my Lenovo T520 laptop:

t520-shadowstorage

Three of the five volumes available to the T520 currently support VSS storage.
[Click image to see full-sized version, please.]

Decoding Vssadmin Shadowstorage Info

Here’s some discussion to illuminate shadowstorage data:

  • The C: drive is the boot/system drive, a 250 GB (nominal, actual 237 GB) SSD. It has a relatively low maximum allocation of 9.5 GB to VSS. 6.04 GB of copy storage space is currently allocated, and 5.58 GB is currently used. On a smaller, faster SSD, this is just the way I like it.
  • The D: drive is an internal data and backup storage drive. Nominally 1 TB (931 GB actual) it has a maximum allocation of 179 GB. 172 GB is currently allocated, and 163 GB is currently used. This drive is my built-in backup storage. It handles Macrium Reflect and the built-in Backup and Restore (Windows 7) utility, too. I’m OK with a big allocation and usage load because it provides insurance. But 172 GB is a lot of storage!
  • The E: drive is an external, USB-attached data and backup storage drive. Nominally 2 TB (1.81 GB actual) it has a maximum allocation of 279 GB, of which only 13 GB is currently allocated and used. It’s my remote or “extra” backup, and provides coverage in case the laptop gets lost, stolen, or becomes unusable.

Pruning Shadow Copies Using Vssadmin

Current consumption and allocation numbers for D: are kind of high. Thus, I use the Vssadmin list shadows /for=D: command to show them to me. Indeed, I count 27 separate shadow copies in total, dated back as far as Christmas day, 2016. I don’t need this many, so I will do some pruning.

Sure, you can prune using delete shadows, with any of a variety of options. I prefer to resize shadowstorage instead. It automatically prunes shadow copies as the allocation for shadow copy storage is reduced. Pruning starts with the oldest shadow copy, and works up to the most recent shadow. Accordingly, I reset the maximum allocation to 50% of its current value (179 GB goes down to 85 GB). As expected, that cuts the number of shadow copies to 13. Of those copies, the oldest is now dated April 16, 2017. The syntax for that command is:

vssadmin resize shadowstorage /for=D: /on=D: /maxsize=85GB

Dealing with “Foreign Shadow Copies”

The resize shadowstorage option also offers another useful benefit. As I look at what’s on my E: drive, I see that its shadows come from an obsolete PC.  That is, they come from a previous incarnation of my production PC named “ETprodPC.” Notice what happens when I try to delete one of those shadow copies, as shown in this screen capture:

t520-eshadows

If your PC didn’t create a shadow copy, Vssadmin won’t let you delete it directly. But there’s a trick…

Because the running OS didn’t create that shadow copy, Vssadmin won’t let you delete it. But if you can use resize shadowstorage with /maxsize set to a low number. 400MB works fine, because it’s less than what most shadow copies consume. And that gets rid of foreign shadow copies when executed. Afterward, you can re-run the resize command to upsize your storage allocation.

I’d recommend checking shadow copies no less frequently than twice a year. You can prune excess copies quickly and easily and save big on disk space consumption. This is especially helpful on tablets and laptops, where storage space is usually at a premium.

July 12, 2017  11:05 AM

WUMT Rescues Win10 Release Preview 15063.483

Ed Tittel Ed Tittel Profile: Ed Tittel
Windows 10, Windows Update Management

I just got back from a 5-day family visit to northern Virginia on Monday evening. That meant the bulk of yesterday was spent catching up. That included dealing with the Patch Tuesday release of Cumulative Update KB4025342, and the latest Malicious Software Removal Tool (MSRT). By and large, things went well with those updates. But my Surface Pro 3, running Release Preview proved a notable and highly resistant exception to that rule. I fought with Windows Update for over an hour on that PC, without ever effecting a repair. Fortunately, upon trying it out, WUMT rescues Win10 Release Preview 15063.483 for my Surface Pro 3.

When WU Hangs, WUMT Rescues Win10 Release Preview

I took the Surface Pro 3 on the road with me, along with my still-new Brydge 12.3 Aluminum Keyboard. I’m still not sure if I shot myself in the foot by ripping the Surface out of that keyboard, plugging in the Microsoft Type Cover, and then plugging the unit into the Surface Pro 3 Dock. But when I tried to access the Patch Tuesday updates, I got a series of failure messages from Windows Update indicating that pending items could not be applied.

For experienced Windows 10 users, there’s a standard drill one goes through when WU fails to cooperate. I confirmed the issue by running the update facility within Windows Defender, which likewise reported being unable to download updates. Next, I ran the built-in update troubleshooter (Control Panel –> Troubleshooting –> Fix problems with Windows Update). Didn’t help. So I turned to the WU troubleshooter download (a more recent and presumably more powerful version of the built-in tool). No dice there, either.

Then I pondered the next step in the troubleshooting chain — namely, the excellent TenForums.com tutorial “Reset Windows Update in Windows 10.” As I read over its instructions, I remembered that the Windows Update MiniTool (aka WUMT) can sometimes grab and apply updates when WU itself gets stuck. (See my November 2016 post “WUMT Does Updates When WU Can’t or Won’t” for another recitation.) “Not much to lose,” I figured, and gave it a shot. As the following screen cap of the WUMT Update History shows, it managed to install 2 of the 3 pending updates:

WUMT Rescues Win10 Release Preview

WUMT reports that CU KB4025342 and Defender Updates applied successfully, MRT update fails.
[Click image to see full-sized view, please.]

Though WU itself didn’t tell me much about what was going wrong, WUMT let me know the problem lay with the MSRT update. Thus, I was able to visit the MSRT page at the Microsoft Download Center, grab the latest version, and run the .exe file manually myself. That cleared up all the pending items from WU.

And sure enough, the next time I ran an update check in Settings (Windows Update –> Check for updates), it produced a clean bill of health. Problem solved! And again, that’s why I recommend that Windows admins keep a copy of WUMT around (it runs just fine from a USB stick) as part of their standard toolboxes.

sp3-wu-ok


July 11, 2017  11:32 AM

Disk Cleanup Beats CCleaner Post-Win10-Upgrade

Ed Tittel Ed Tittel Profile: Ed Tittel
Disk cleanup, Windows 10, Windows Upgrades

In days gone by, I’ve recommended using Piriforum CCleaner for post-upgrade cleanups on Windows 10. But no longer does the third-party tool beat the built-in Disk Cleanup utility. In fact, the latter is now as fast (or faster) than the former, and it gets rid of more stuff, too. That’s why I must now report that built-in Disk Cleanup beats CCleaner post-Win10-upgrade. Here’s a screen shot to prove my contention:

Disk Cleanup Beats CCleaner Post-Win10-Upgrade

CCleaner sees just under 21 GB to clean up, but Disk Cleanup sees 24.4 GB!
[Click image to see full-sized view.]

How Disk Cleanup Beats CCleaner Post-Win10-Upgrade

The secret to the deeper clean that the built-in utility provides lies in the checkbox details from the Disk Cleanup utility. To the left, we see that CCleaner sizes the Old Windows Installation to 21,957,944 KB (20.94 GB). To the right, the Disk Cleanup utility sizes that installation at 24.4 GB. The difference lies in the files that each utility can access and remove. To make a long and complex story short, the built-in utility can find and delete more entries in the WinSxS folder. Thus, it can remove more of the holdovers from the previous installation. This results in a more svelte and compact disk layout once post-upgrade clean-up is complete. Especially for those who run Windows 10 on low-cost tablets and laptops with limited storage, the 15% added space savings can be significant.

That’s why I’m compelled to recant my earlier advice and advise readers to use Disk Cleanup rather than CCleaner for post-upgrade cleanup on Windows 10 PCs. I last made the contrary recommendation in December 2015 in a blog post entitled “CCleaner Gets Faster, Cleaner v5 Incarnation.” For the current Insider Preview version of Windows 10, CCleaner now falls behind Disk Cleanup on all counts. Does that mean it’s time to retire this tool? Not at all! It just means that for those who choose to clean up old Windows installs before the OS does it automatically, Disk Cleanup is once again the best tool for the job.


July 5, 2017  10:51 AM

DriveCleanup Clears Stale Win10 Storage Metadata

Ed Tittel Ed Tittel Profile: Ed Tittel
Device Manager, Disk cleanup, Storage management, Windows 10

Disk cleanup is one Windows admin topic to which I return from time in this blog. Usually, that means jumping onto storage volumes and rooting out unwanted, unneeded, or unnecessary files and folders. Today, thanks to German programming whiz Uwe Sieber, I’m going to come at this from a different angle. His terrific tool, Drive Cleanup v1.4 tackles stale device entries, and removes them from the device tree shown in Device Manager. It also removes orphaned items from the registry for those same devices, when they’re no longer used. And that, dear Reader, is how DriveCleanup clears stale Win10 storage metadata. In so doing, it offers a cleaner, more accurate view of what’s in (and on) your systems.

When DriveCleanup Clears Stale Win10 Storage Metadata, What Does That Mean?

A few examples will help explain this in real-world terms. Before using the tool, check Device Manager (with Show Hidden Devices checked). On my production PC, it lists 53 entries named “Generic volume shadow copy” under the “Storage volume shadow copies” item. Of that 53, 16 are greyed-out, which means they’re inaccessible. Likewise, my “Universal Serial Bus controllers” entry lists 9 “USB Composite Device” entries, of which 7 are greyed-out. The “USB Mass Storage Device” count is at 13, of which 11 are greyed-out. Lots of stale or inaccessible stuff. In fact, Drive Cleanup –run at the command line — summarizes what could be removed at the end of its output listing when run in “Test” mode. Here’s what it says about my production PC:

DriveCleanup Clears Stale Win10 Storage Metadata

When run in test mode, Drive Cleanup reports on what it could clean up if instructed to do so.

Thus, I can see from the summary that Drive Cleanup can do more than remove the 11 USB devices I determined myself from inspection of Device Manager. It can also remove 22 disk devices, 3 CD-ROM devices, and 73 (!) storage volumes of one kind or another (most of which will be volume shadow copies). It will also remove 117 stale registry entries, more than the sum of all devices involved.

Using DriveCleanup Couldn’t Be Easier

All the details of what is to be removed appear in test output from Drive Cleanup for those curious to see what it can root out on their systems. You can pipe that output to a file (it’s too big to look at in the CLI) like so:

drivecleanup -t > dc-output.txt

Note: dc-output.txt is the name of the file to which the output will be written, and it will be stored in whatever disk directory the command is run from/in. Looking that stuff over, I can see entries for lots of USB flash drives not currently plugged in. I can also see a whole lotta entries labeled “VOLUMESNAPSHOT” which is where volume shadow copies come into play.

To run the actual cleanup, simply run the command with no parameter and it will root out all the items that Test mode finds. You can also selectively remove devices by type using various 1-letter abbreviations as parameters (for example “-R” cleans up Registry entries, “-U” USB entries, and so forth). Download and use this tool, and DriveCleanup clears stale Win10 storage metadata from your PC, too!

[Shout out to user jumanji at TenForums.com for bringing Sieber’s excellent Drive Tools for Windows suite to my attention in the post entitled “Not recognizing any USB devices” on 7/4/17. Thanks!]


July 4, 2017  1:14 PM

Win10 Virtual Disk Image Galleries

Ed Tittel Ed Tittel Profile: Ed Tittel
Hyper-V, VM management, Windows 10

There’s an absolutely fascinating story making the rounds online right now, courtesy of Rafael Rivera at Thurrott.com. Entitled “Online Gallery Support Coming to Hyper-V Quick Create,” it explains a point-and-click method for firing off VMs. For those not already in the know, this feature is called Online Gallery. It’s popping up in current Insider Preview build and supports a “You select an image, click Create Virtual Machine, and you’re done” approach to creating VMs. Now THAT’s what I’m talkin’ about! It also explains why Win10 virtual disk image galleries could prove to be something more than simply a “That’s nice” feature.

Virtual Disk Image Galleries

Here’s a cropped version of the Online Gallery image from Rivera’s story at Thurrott.com.

When Will We See Win10 Virtual Disk Image Galleries?

This feature could makes it into the next major update for Windows 10. Now labeled 1709, that release should go public in two months. Thus, Online Gallery could appear as early as September 2017, two months from now.

Rivera’s investigations into the workings of Online Galleries show some simple and straightforward supporting infrastructure. He’s discovered that this feature uses a JSON file that “contains one or more images and any associated metadata like name, publisher, version, virtual disk location…” and so forth. He also discovered that one can host one’s own Online Gallery using a specific registry hack. One needs to define a REG_MULTI_SZ key named GalleryLocations in:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization

The value of this key must include at least one URL for the aforementioned JSON file. Properly tweaked, the Hyper-V Quick Create app automatically looks for VMs at the locations provided. They appear in a selection menu for selection and instantiation. Rivera even provides a sample gallery at GitHub so interested experimenters can leverage his efforts. This lets them create their own custom Online Galleries. He also provides a patched copy of VMcreate.exe that provides this feature. My colleague and occasional collaborator Kari the Finn is already working on creating a gallery with recent Insider Preview images. Great stuff!


July 3, 2017  1:44 PM

MS Gives Fall Creators Update 1709 Label

Ed Tittel Ed Tittel Profile: Ed Tittel
Release cycles, Windows 10, windows 10 upgrade

Eagle-eyed Windows watchers report that a June 30 blog post makes definitive mention of the next Windows 10 version. This morning, Neowin.net drew on a tweet from infamous Windows rumor-meister Wzor. He quotes from this Mobile Device Management document from the Windows IT Center: “Policy DDF File.” In that document, MS gives Fall Creators Update 1709 label, as shown here:

MS Gives Fall Creators Update 1709 Label

The last line in this snippet from the Policy DDF File document shows the next Windows 10 label — and projected release date.
[Click image for full-size view, if that last line is too tiny to decipher.]

What It Means When MS Gives Fall Creators Update 1709 Label

For Windows 10, its four-digit nomenclature may be decoded as follows: yymm, where yy is a two-digit number for the year, and mm is a two-digit number for the month. Thus, 1709 means September (the 9th month) of 2017. This tells us when Microsoft is planning to peg the official release date of the next big Windows 10 release. Remember, though, that the first Creators Update, labeled 1703 (March 2017) didn’t go public until April, so this is more of promise than an ironclad guarantee.

Now that the word is out, after a fashion, I expect we’ll start seeing many more mentions of the 1709 label. The pace of Insider Preview releases has been somewhat leisurely of late (3 in June), so it’s not unreasonable to expect that pace to pick up soon. The two most recent releases, 16226 (6/21) and 16232 (6/28) have introduced lots of new features and functions to Windows 10. Going forward, I expect those introductions to keep coming, and the frequency of releases to spike as well. There’s still lots of work to do to make Windows 10 ready for an official 1709 release, with less than two months to go before the clock runs out. Stay tuned, and I’ll report back as and when the next release date firms up further.


June 28, 2017  12:45 PM

Done Waiting for Win10 Version 1703

Ed Tittel Ed Tittel Profile: Ed Tittel
Windows 10, Windows Updates, Windows Upgrades

I admit it: I got tired of waiting for Windows Update to include my lone holdout PC in the April Upgrade to Version 1703. Given that it was officially let go on April 5, and today is June 28 (12 weeks to the day), I hope this doesn’t come across as over-eager. I don’t think it is, at any rate. Here’s the deal: I decided to leave my wife’s PC on the previous version (1607) in April after upgrading my other 7 machines here at home. But after waiting … and waiting … and waiting some more, I decided this morning to bite the bullet and upgrade. It’s based on a 2013 vintage JetWay JNF9G-QM77 mobo with a mobile i7 quad-core CPU, 16 GB RAM, and a Samsung EVO 840 250 GB SATA SSD. So now, at last, I’m done waiting for Win10 Version 1703 on that machine.

How Is It I’m Done Waiting for Win10 Version 1703?

That part is easy. Having decided to wait no longer for Windows Update to push the update, I simply turned to the Windows 10 Update Assistant instead. Actually, that meant clicking the “Update Now” button on the Download Windows 10 web page, as shown here:

Done Waiting for Win10 Version 1703

Click the “Update Now” button on a PC running an older Win10 version, and the updater does the rest automagically.

The Upgrade Proves Eminently Survivable

The whole process took about 15 minutes. In fact, the post-upgrade clean-up took somewhat longer than that. Given that MS decided to hold off on upgrading the machine itself, no doubt based on something about its hardware configuration, I was a little antsy that this might not work. But the faithful little mini-ITX box chugged through the download, powered through the reboots at the 30% and 75% marks, and went on to complete with nary a hitch.

The Windows Update MiniTool (WUMT) did find some missing drivers after all was said and done (mostly Intel chipset stuff) but the post-install cleanup also went quite well. When instructed to clean up system files, Disk Cleanup removed about 22 GB of old OS files from the system. PatchCleaner found about 4.5 GB of orphaned files, which I dutifully copied over to the backup/external drive before removing from the SSD as well. I was able to trim the SSD to just over 60 GB of on-board content when all was said and done, which put it within 1 GB of the original disk size of just under 60 GB before applying the upgrade.

Now that I’ve got this behind me, I’d love to better understand the criteria MS uses to withhold upgrades to some PCs and advance them to others. To me, it looks like they’re being pretty conservative about what goes ahead and what stays behind. In this case, I’m glad they may have been over-cautious. Let’s hope other holdouts fare equally well when their upgrades finally come through.


June 26, 2017  1:26 PM

Registry Cleaner Pros & Cons

Ed Tittel Ed Tittel Profile: Ed Tittel
Registry hacks, Windows 10, Windows management

In trolling TenForums.com over the weekend, I came across a reference to a another free Registry Cleaner for Windows. It’s a SourceForge project called the “Little Registry Cleaner” (LRC). Like all SourceForge projects, it’s free under the GNU General Public License. It doesn’t do a half-bad job, either. Later, I’ll compare it to my usual go-t0 tool for registry clean-up. That is Piriform CCleaner (also freeware , with file clean-up and other tools, too).  Working with LRC got me to thinking about the real utility of such programs, or “Registry Cleaner Pros & Cons.”

lrc-screencap

Not much left to see, after LRC does its thing. Then it hit me: the GUI is nearly identical to WUMT. They must share the same GUI kit!

Let’s Review: Registry Cleaner Pros & Cons

If you Google “registry cleaners worthwhile” or “value of registry cleaners” you’ll find plenty of heated discussion and controversy. Registry cleaners like CCleaner or LRC seek out and offer to delete orphaned or obsolete registry entries. These entries refer to software, objects, and other “system stuff” not currently in use, or that originates from software no longer present on the system. Thus, it actually makes little difference whether those registry entries are present or absent. They don’t do anything, and they don’t take up that much space, either.

On the other hand, messing with the registry can and will occasionally damage Windows. Such damage can be minor (GUI acts or looks funny, certain apps or applications don’t run or run slowly, and so forth). But when major registry damage occurs, Windows can malfunction: the system won’t boot or run. That’s why many experts say that such cleaners probably aren’t necessary and should be avoided. Primarily, that’s because the harm they can do is more trouble than the good services they might perform is worth.

I’m in the same camp as long-time PC World expert Lincoln Spector myself. He wrote a nicely-nuanced story on this subject in 2010 entitled “Are Registry Cleaners Worth It?” Like me, he finds some of those tools (including CCleaner) to be mostly benign and unlikely to cause trouble. He doesn’t mention LRC, but my own recent experience puts it in the same general cubbyhole as CCleaner, FWIW. If you’re inclined to perform occasional registry cleanups, and take necessary precautions before cleaning (make a registry backup), you should find either or both of these tools useful.

Comparing & Contrasting CCleaner and LRC

As you’d hope from a single-function, more specialized tool, LRC generally finds and cleans more stuff than does the CCleaner Registry Cleaner sub-system. On average, LRC seemed to find somewhere between 25 and 40% more registry entries in need of clean-up than did its CCleaner counterpart. I couldn’t detect any negative impact from either tool on any of the PCs on which I performed a quick comparison test.

Feel free to try them out, and to make (occasional) use of them as you see fit. Just remember to back up your registry first. Note: CCleaner prompts you back up your registry automatically but forces you to rely on import operations in regedit to restore that backup. OTOH, LRC handles this by making a restore point before it does anything to your system, and includes a Registry Restore button on its top-line command bar in the program (see preceding screenshot). I give both tools equal points, but will probably stick with CCleaner because it’s good enough for my needs, and includes a pretty peachy file clean-up facility along with registry cleanup, a decent startup manager and uninstall utility, and more. For those with OCD tendencies who want their registries squeaky-clean, LRC is probably the better choice.


June 23, 2017  11:53 AM

Win10 Build 16226 Adds GPU Task Manager Info

Ed Tittel Ed Tittel Profile: Ed Tittel
GPU, Task Manager, Windows 10, Windows Task Manager

The two most recent Win10 Builds — namely 16215 and 16226 — have brought lots of changes and trouble to intrepid Windows beta testers. My desktop PC weathered recent builds admirably, but not my Dell Venue Pro 11 7139. I couldn’t install 16215 on that PC (not from Windows Update, not via an in-place upgrade, nor even a clean install). After uninstalling .NET 3.5, as suggested in the release notes, 16226 did install. But it’s been plagued with issues. The absence of .NET 3.5 means some favorite programs don’t work. Alas, CPU Meter can’t pick up Core Temp data without it, and the Codeplex version of RAPR.exe doesn’t work either. Worse, it means that Office 2016 won’t run (it also needs .NET 3.5; see end of thread for a possible fix). On the plus side, Win10 Build 16226 adds GPU Task Manager info. Thus, it can now show what’s going on with your graphics card. Here’s a quick peek:

Win10 Build 16226 Adds GPU Task Manager Info

GPU information from the latest version of Task Manager in Build 16226.

When Win10 Build 16226 Adds GPU Task Manager Info, What Does it Show?

Good question! The preceding screen capture is NOT the default view from this new facility. It appears on the Performance tab in Task Manager. Notice it shows metrics for various rendering subsystems: 3D, LegacyOverlay, Compute_O, and VideoDecode at the upper right. I got that display by right-clicking the GPU item at upper left, then picking “Multiple engines” from the pop-up menu entry “Change graph to…” The default is called “Single engine.”
But it only shows the 3D entry by itself. Because Multiple Engines is more interesting and informative, I’ve switched to that view instead. That’s much as I routinely do with the CPU entry. There, “Change graph to…”  Logical Processors shows a panel for each execution thread.

This GPU capability rolls into mainstream Windows 10 when the Fall Creator’s Update is released, probably in September or October of this year. It makes a nice addition to Task Manager, and I’m glad to see it included in the overall mix. Until then, non-beta users will have to rely on tools like TechPowerUp’s excellent GPU-Z to show them what’s going on with their graphics cards instead.

[Note Added late morning 6/23:  Anyone else bitten by the .NET 3.5 Framework issue on 16226 should try this fix. It worked for my Dell and conferred the added bonus of restoring Task Manager to normal operation. Run msconfig.exe, and on the boot tab direct your PC to boot into Safe Mode. Restart the PC, then use Winkey-R to run “Control Panel” to quickly access Programs and Features/Turn Windows Features On or Off and add .NET Framework 3.5 back in there. Then, use Winkey-R with “msconfig.exe” and go to the boot tab to turn off the Safe Mode checkbox. Reboot, and you’re back in business! Thanks loads to user Waltc who posted this information in thread #226 at TenForums.com.]


June 21, 2017  11:04 AM

DISKPART Script Fixes Default Win10 Disk Layout

Ed Tittel Ed Tittel Profile: Ed Tittel
Disk partitioning, Windows 10, windows installer

In two previous two blog posts, Kari the Finn and I explained how to use DISKPART during Windows 10 installation. We also described what’s wrong with the default Windows disk layout, and why it benefits from this fix. This, the third and final installment in this series, puts those DISKPART commands into a batch file. In fact, this allows for easy automation, and explores an elaboration on this theme. First and foremost, though, readers will find that this DISKPART script fixes default Win10 disk layout issues quickly and easily.

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.

rem DISKPART script, put available space into C:
rem ---------------------------------------------------
rem Select Disk 0, wipe it empty, convert to GPT
rem ---------------------------------------------------
select disk 0
clean
convert gpt
rem ---------------------------------------------------
rem Create & format 100 MB EFI System partition 
rem ---------------------------------------------------
create partition efi size=100
format quick fs=fat32 label="System"
rem ---------------------------------------------------
rem Create 16 MB MSR partition (will not be formatted)
rem ---------------------------------------------------
create partition msr size=16
rem ---------------------------------------------------
rem Create Windows partition using all available space
rem ---------------------------------------------------
create partition primary
rem ---------------------------------------------------
rem Shrink Windows partition to make space for WinRE 
rem ---------------------------------------------------
shrink minimum=450
rem ---------------------------------------------------
rem Format Windows partition, label it, no drive letter
rem ---------------------------------------------------
format quick fs=ntfs label="Windows"
rem ---------------------------------------------------
rem Create & format 450 MB recovery partition 
rem ---------------------------------------------------
create partition primary
format quick fs=ntfs label="WinRE"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
rem ---------------------------------------------------
rem Exit Diskpart 
rem ---------------------------------------------------
exit

Of course, you could omit the remark lines if you don’t want them. For ourselves, we always use remarks in ours script and batch files. That’s because it makes it easier to read and modify archived items like this one, long after we’ve forgotten all the intricate details. Here’s a download link to the script, should you wish to access it as such, rather than cut’n’paste the foregoing text.

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:

DISKPART Script Fixes Default Win10 Disk Layout

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! Here’s a screen cap to illustrate.

gpt-optimal

Here’s our disk layout, after the script is run. (This is for a VM with a deliberately small boot/system drive.)

Putting Additional partitions into the Mix

Here’s another common partitioning scenario to ponder. What if you have a 1 TB HDD or SSD? Then, you might want to allocate 200 GB to C:, and the rest to a data partition.

Actually, it’s quite simple. In fact, a few minor tweaks it’s all that needed. You merely add the size=xxx option for the Windows partition. Thus, you don’t allocate all available space to it. Ditto, add size=xxx to the WinRE partition, and place it after the Windows partition. In last place, create a data partition allocating all remaining space to it instead.

First, let’s change the Windows partition entries to allocate 200 GB instead of all available space.

create partition primary size=204800
format quick fs=ntfs label=”Windows”

Please note: DISKPART space allocation uses MB as its units. Thus, 200 GB = 200 x 1024 = 204800 MB. Here again, no drive letter is needed because Windows setup automatically assigns C: to this drive.

Next, let’s handle the recovery (WinRE) partition, and allocate it 450 MB:

create partition primary size=450
format quick fs=ntfs label=”WinRE”
set id=”de94bba4-06d1-4d40-a16a-bfd50179d6ac”

And finally, let’s add a data partition, and let it consume all remaining disk space:

create partition primary
format quick fs=ntfs label=”Data”
assign letter W

The Original Script, Revised

The script now looks like this:

rem DISKPART script, 200 GB Windows rest Data partition
rem ---------------------------------------------------
rem Select Disk 0, wipe it empty, convert to GPT
rem ---------------------------------------------------
select disk 0
clean
convert gpt
rem ---------------------------------------------------
rem Create & format 100 MB EFI System partition 
rem ---------------------------------------------------
create partition efi size=100
format quick fs=fat32 label="System"
rem ---------------------------------------------------
rem Create 16 MB MSR partition (will not be formatted)
rem ---------------------------------------------------
create partition msr size=16
rem ---------------------------------------------------
rem Create & format a 200 GB Windows partition
rem ---------------------------------------------------
create partition primary size=204800
format quick fs=ntfs label="Windows"
rem ---------------------------------------------------
rem Create & format 450 MB recovery partition 
rem ---------------------------------------------------
create partition primary size=450
format quick fs=ntfs label="WinRE"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
rem ---------------------------------------------------
rem Create & format a data partition with letter W
rem ---------------------------------------------------
create partition primary
format quick fs=ntfs label="Data"
assign letter W
rem ---------------------------------------------------
rem Exit Diskpart
rem ---------------------------------------------------

Note: we assigned drive W: to the data partition. Normally, this will be changed later once Windows is installed. For the moment, we want to be sure an unused letter is assigned. Otherwise, a letter collision could cause the script to fail.

As mentioned earlier, you can never be sure which drive letters are already assigned when booting from Windows install media on a UEFI / GPT system. Selecting a letter from the end of alphabet makes us pretty sure it’s free when the script runs. Otherwise, we intentionally never use letters W, Y and Z in our various Windows setups. Thus, we can be sure it’s safe to use these letters in scripts. Remember, X: is off-limits. That’s because X: is reserved for the Windows recovery console and the Windows PE Command Prompt when booting from install media or WinPE!


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: