Click here to Skip to main content
15,899,314 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
Plese Give me code for a create a simple defregment program in vb.net..please
Posted
Comments
Richard C Bishop 19-Jun-13 10:48am    
Please give me a pepperoni pizza and some cheezy bread..please.
[no name] 19-Jun-13 11:32am    
Dang you! Guess what I want for lunch now!
Richard C Bishop 19-Jun-13 11:43am    
I fresh, large, hot, and perfectly proportionally sliced double pepperoni pizza?
[no name] 19-Jun-13 11:59am    
You, sir, are an evil, evil man. But I say that with the greatest respect. :-)
Richard C Bishop 19-Jun-13 12:07pm    
LOL, I could not resist. I would gladly buy it for you if I knew where to send it.

1 solution

C#
Process.Start("defrag.exe")


Seriously though, defragging is a complicated process, there is no simple way to do it, and i don't even think there is a way to do it in a managed language, this requires low-level disk access.
 
Share this answer
 
Comments
Dave Kreskowiak 20-Jun-13 12:19pm    
It can be done in managed code. You can kick around in the Windows Defrag API (hard to find!). You could also write your own defrag using the documentation found at http://msdn.microsoft.com/en-us/library/windows/desktop/aa363911(v=vs.85).aspx. But, you'd have to be into S&M to go that route.

In either case, "defrag" and "simple", by law, are not allowed to be in the same sentence.

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