When I run defrag in command prompt is there any way to gracefully stop the process before it finishes?
Does killing the task in TM cause any problems if it is in the middle of moving a file?
Windows 7 Pro 64bit
In theory, it should be safe to just terminate the program (in your case you can use CTRL-C) because an effort is made in the design of the Microsoft Disk Defragmenter application to prevent data loss in the event of an unexpected interruption. This is documented on Microsoft's web site as follows:
Microsoft - How Disk Defragmenter Works
Essentially, the data is copied to new sectors, the pointers to the data that was moved are updated to point to these new sectors, and then the old sectors are freed as a result. This is a very safe approach to use in case there is a crash because in a worst-case-scenario (like a crash into a blue screen) you'd have two copies of the same data, one on unallocated sectors, and the other on allocated sectors. From the perspective of reading the data, it will appear the same either way.
Additionally, there are many improvements that can be made to the Disk Defragmentation techniques that Microsoft uses (which are already more than adequate for many people), and a variety of alternative products are examined and compared in great detail here:
Defragger (from Roedy Green's Java Glossary)
Control C to cancel it.
I don't expect the Task manager to do any harm, since it first asks the program to close before it brute forces it.
This thread has a lot of helpful information about whether there are dangers to disks that were defragmenting during power failure (while not identical to your situation, you'd still be abruptly halting the program -- as the commenter kindly pointed out, if the system can recover from a hardware interruption, a software interruption probably won't hurt).
It's seems as though