The message is noted in the link provided.
I have recently been unable to run scandisk or defrag and get the message that "the drive is being written to by another program". I have tried everything that I know to try to figure out what is going on including disabling the screen saver and virus scan. I have also scanned for viruses using the latest definitions. I am running Microsoft Millenium.
Besides the excellent link posted by Bob, you can also get the free ScanDefrag. It is the most advanced disk maintenance program there is. It runs Disk Cleanup, ScanDisk, and Disk Defragmenter.
It's easy to setup and use, and it can deal with problems like "drive's contents have changed: restarting...".
Get it and read about all the options it has that you can use. It is a small download.
First configure Disk Cleanup (tick all options), then ScanDisk (as suggested by ScanDefrag) and at last Disk Drefagmenter.
Click RUN and let the process finish. If the HDD is as messy as it sounds, it may take a while to finish the 3 processes, but be patient, it will pay back.
Meet the drop-resistant Moto Z2 Force
The Moto Z2 Force is really thin, with a fast processor and great battery life. It can survive drops without shattering.