Click here to Skip to main content
15,889,858 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there,

I really want to make a defragmentation tool with VB.NET without calling defrag.exe. I want to basically make a custom copy of Defraggler by Piriform (which is here), because I'm not boring and like to make my own programs rather than using other peoples'.

The program will need to display progress, current file being defragmented etc. So might I need to look into a defrag library?

-Rixterz
Posted
Comments
phil.o 16-Apr-14 8:07am    
Just one question: do you have a deep understanding of file systems so that you can afford to operate on them?
[no name] 16-Apr-14 8:17am    
I'm not professional but I have quite good knowledge. Do you know if there are any libraries out there for my situation?

1 solution

Windows has defrag related API calls baked into it that you could use - there is C# code here[^] you could use as a starting point.
 
Share this answer
 
Comments
[no name] 16-Apr-14 16:21pm    
Thanks very much!
[no name] 16-Apr-14 17:03pm    
Well, I looked through it and it keeps giving the error "Unable to find an entry point named 'CreateFile' in DLL 'kernel32.dll'" and I can't find the solution anywhere.
Duncan Edwards Jones 16-Apr-14 17:17pm    
Can you post your API declaration code - CreateFile is definitely a member of the Kernel32 exports.. http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx
[no name] 17-Apr-14 7:30am    
Private Declare Function CreateFile Lib "kernel32.dll" (ByVal lpFileName As String, ByVal dwDesiredAccess As UInteger, ByVal dwShareMode As UInteger, ByVal lpSecurityAttributes As IntPtr, ByVal dwCreationDisposition As UInteger, ByVal dwFlagsAndAttributes As UInteger, ByVal hTemplateFile As IntPtr) As IntPtr

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