The command is CONTIG (also available in 64-bit as CONTIG64), and it is a Sysinternals:
https://docs.microsoft.com/en-us/sysinternals/downloads/contig
You’ll want to put the appropriate binary in C:\Windows
. Run it like this, in administrative CMD, it will get all of the hiddens it can for C drive (this is 64-bit):
contig64 C:$Mft
contig64 C:$LogFile
contig64 C:$Volume
contig64 C:$AttrDef
contig64 C:$Bitmap
contig64 C:$Boot
contig64 C:$BadClus
contig64 C:$Secure
contig64 C:$UpCase
contig64 C:$Extend
Notice the distinct lack of slashes in the above!
The command is CONTIG (also available in 64-bit as CONTIG64), is a Sysinternals:
https://docs.microsoft.com/en-us/sysinternals/downloads/contig
It defrags, and does it very well. It does it file by file. Here’s a command probably suitable for background operation on a whole C drive, on a 64-bit machine, quiet mode:
start /LOW contig64 -s -q C:\*
Really good article here:
http://www.itquibbles.com/sql-sbsmonitoring-high-disk-usage/
Solves the problem of the database reaching max capacity, and also speeds things up in general.
Short version:
In SBS 2008, run the contents of this zip file in an administrative PowerShell window.
In SBS 2011, start this shell as administrator:
C:\Program Files\Windows Small Business Server\Bin\MoveDataPowerShellHost.exe
and then while in the shell, run the contents of this zip file.
If it says “1 row affected”, it’s done, and the messages will point out old MDF and LDF files to remove.
You may notice that the script linked here is just a tad different than the one on the itquibbles page; this one just adds the -force items mentioned as an option on that page.
Local group policy has this here in Windows 10:
Computer Configuration, Administrative Templates, Windows Components, Data Collection and Preview Builds
We may disable “Allow Telemetry” and enable “Do not show feedback notifications” for excellent effect.
Domain group policy will only have the above, if it has been upgraded (or installed) with the appropriate very recent version of Group Policy templates.
New version includes Windows 8/2012 and 10/2016.
These steps can improve Windows performance a whole lot. It works because a vast array of different applications and services in Windows utilize VSS on their backends. All of the below, except for one server-only step sometimes needed, is encapsulated in PowerShell script (3.0 and up) OVSS.ps1 , part of the windows-tools project.
To do the VSS optimization interactively, start an administrative CMD, and then…
Step 1:
vssadmin Delete Shadows /All
If there are orphan shadows, you will be asked whether you want to delete them. If there are and you delete them, you will see immediate performance benefit. Reportedly, Windows autodeletes them only after there are 64 per volume. We prefer to see zero! These build up as a result of bad shutdowns, drive and drive controller issues, and insufficient RAID resources to serve demands.
Step 2:
We now improve any existing preassociation of disk space for VSS. On some machines, this will increase performance very impressively, immediately. In general it keeps them smooth and stable and prevents hesitations. This does not reserve or take up the space, it just “associates” it, makes it ready for use, so that whenever Windows wants to do any of the bajillions of things it does with VSS, things ranging from tiny to enormous, it can skip that step.
It is worthwhile to know that C: on all workstation installs and many server installs, has a minimal preassociation already set up. And we should check to see if it has been done. So the first step is to check it. Do the below:
vssadmin list shadowstorage
If it gives you something like this:
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2013 Microsoft Corp.
Shadow Copy Storage association
For volume: (\\?\Volume{84214e3c-0000-0000-0000-100000000000}\)\\?\Volume{84214e3c-0000-0000-0000-100000000000}\
Shadow Copy Storage volume: (\\?\Volume{84214e3c-0000-0000-0000-100000000000}\)\\?\Volume{84214e3c-0000-0000-0000-100000000000}\
Used Shadow Copy Storage space: 0 bytes (0%)
Allocated Shadow Copy Storage space: 0 bytes (0%)
Maximum Shadow Copy Storage space: 100 MB (20%)
Shadow Copy Storage association
For volume: (C:)\\?\Volume{84214e3c-0000-0000-0000-501f00000000}\
Shadow Copy Storage volume: (C:)\\?\Volume{84214e3c-0000-0000-0000-501f00000000}\
Used Shadow Copy Storage space: 0 bytes (0%)
Allocated Shadow Copy Storage space: 0 bytes (0%)
Maximum Shadow Copy Storage space: 373 GB (20%)
where “Maximum Shadow Copy Storage space: “ for each volume is set to 20%, the rest has been done, you are fully optimized. Otherwise, if this is a desktop OS, we resize the existing association for each volume. For volumes without letters, and to pull a list of all VSS-ready volumes, see the note towards the end of this document.
So for the C drive, do the below in administrative CMD:
vssadmin Resize ShadowStorage /For=C: /On=C: /MaxSize=20%
Do repeat for any other active hard drive partitions, D:, E:, et cetera. Don’t worry if you get an error, the next step covers it.
Step 3:
It may well throw an error, saying there is no such association. If this is a workstation OS, vssadmin lacks two commands which we need for any further steps, so in that case we are done. But on any Windows Server OS from 2008R2, if the error was thrown, we do an Add:
vssadmin Add ShadowStorage /For=E: /On=E: /MaxSize=20%
Step 4:
And finally (server only), one more thing which can help if, for instance, C: is almost full but E: has plenty of space:
vssadmin Delete ShadowStorage /For=C: /On=C:
vssadmin Add ShadowStorage /For=C: /On=E: /MaxSize=20%
This maximizes overall performance, and also prevents possible backup failures and other issues due to insufficient disk space on C:.
Note:
On some machines, the volumes do not have letters. For these you will need to use the volume GUID path. In vssadmin list shadowstorage
, they look like this:
Shadow Copy Storage association
For volume: (\\?\Volume{99ac05c7-c06b-11e0-b883-806e6f6e6963}\)\\?\Volume{99a
c05c7-c06b-11e0-b883-806e6f6e6963}\
Shadow Copy Storage volume: (\\?\Volume{99ac05c7-c06b-11e0-b883-806e6f6e6963}
\)\\?\Volume{99ac05c7-c06b-11e0-b883-806e6f6e6963}\
Used Shadow Copy Storage space: 0 B (0%)
Allocated Shadow Copy Storage space: 0 B (0%)
Maximum Shadow Copy Storage space: 32 MB (32%)
For such a situation, substitute \\?\Volume{99ac05c8-c06b-11e0-b883-806e6f6e6963}
(the whole long string) for C:
in the above command lines.
PowerShell will give GUI paths for all volumes thusly:
GWMI -namespace root\cimv2 -class win32_volume
References are here:
https://technet.microsoft.com/en-us/library/cc788050.aspx
https://www.storagecraft.com/support/kb/article/289
http://backupchain.com/i/how-to-delete-all-vss-shadows-and-orphaned-shadows
http://www.tech-no.org/?p=898
RUNALL.CMD is the best way to run our very own windows-tools, a Windows cleanup, optimization, and speedup toolset, on an Internet-connected Windows PC. It requires Powershell 3.0 or newer, which comes with Windows 8 or newer, and can be installed into Windows 7 using the WMF. There is just one gotcha: Offline Files compatibility of all folders shared from the PC, “share caching”, is turned off, for one of several significant hikes in performance and overall reliability. If you need Offline Files, you’ll want RUNMOST.CMD, which does it all except this one item.
with the right router/firewall. I’ve had at least three different Netgears at home over years, all mid- or mid-high range in their consumer range at purchase. Every time, I tested using OEM up-to-date firmware, and tested with DD-WRT, many tweaks on both. DD-WRT gave a little improvement. On a little divine inspiration, I just did this:
- Took a ten-year-old quad-core Vista box with three gigs of RAM
- Put in a $40 quad Intel server NIC I bought from Amazon.com
- Installed pfSense and set it up in very default fashion, exceptions being use of 192.168.2.0/24 as LAN subnet, 192.168.2.1 as LAN IP. Not using the motherboard NIC, just two on the Intel card so far.
- Set my current DD-WRTed Netgear to do DHCP forwarding instead of serving, set it static to 192.168.2.2, left it otherwise alone
- Connected one LAN port of the Netgear to the LAN port I set up in pfSense
- Disconnected the WAN port of the Netgear, plugged Internet directly into the WAN port in pfSense
Suddenly WWW and Roku respond much faster, much less latency and jitter and other delay, and most unexpectedly, Internet download speed is much, much faster, even though the wifi is still running through the Netgear. And after a bit of performance tweaking, pings are lower, from 28ms down to 22 wired and 24 wireless.
Haven’t tried Squid proxying yet, or IPv6, but will be!