Click here to Skip to main content
15,917,577 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please help me!
How do I programmatically defragment hard drive space?


saber rezaii magham wrote (in comment to Solution1):

Thanks... But I want to make a program like defrag.exe.
Posted
Updated 8-Apr-14 23:34pm
v2

 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 8-Apr-14 17:40pm    
Interesting enough, a 5.
—SA
Maciej Los 9-Apr-14 5:33am    
You're right, Sergey!
saber rezaii magham 9-Apr-14 6:01am    
what is the Appropriate value for ## VCN, LCN, count ## in MoveFile?
Call defrag.exe, but remember: you need to have admin privileges ;)

Here is an implementation: Process Start and Running Defrag Command Line[^]
 
Share this answer
 
v2
Comments
saber rezaii magham 8-Apr-14 16:10pm    
Thanks...
But I want to make a program like defrag.exe.
Maciej Los 8-Apr-14 17:24pm    
Please, be more specific next time.
saber rezaii magham 9-Apr-14 5:12am    
Ok!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900