HighTechTalks DotNet Forums  

defrag API

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss defrag API in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Trapulo
 
Posts: n/a

Default defrag API - 11-28-2007 , 09:15 AM






Hello,
is there any way or documentation to access windows defrag API for ntfs from
NET ?

thanks





Reply With Quote
  #2  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default RE: defrag API - 11-28-2007 , 10:12 PM






Hi Trapulo,

There's no official documentation on how to use defrag api from .NET, but
there's some example code:

#Jeffrey Wall's WebLog : Defrag API C# wrappers
http://blogs.msdn.com/jeffrey_wall/a...13/229137.aspx


Hope this helps.


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #3  
Old   
Trapulo
 
Posts: n/a

Default Re: defrag API - 12-01-2007 , 10:03 AM



Thank you, this is a starting point.

Is there the official documentation about defrag api? I cannot find it.

thanks


""Walter Wang [MSFT]"" <wawang (AT) online (DOT) microsoft.com> wrote

Quote:
Hi Trapulo,

There's no official documentation on how to use defrag api from .NET, but
there's some example code:

#Jeffrey Wall's WebLog : Defrag API C# wrappers
http://blogs.msdn.com/jeffrey_wall/a...13/229137.aspx


Hope this helps.


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.




Reply With Quote
  #4  
Old   
Willy Denoyette [MVP]
 
Posts: n/a

Default Re: defrag API - 12-01-2007 , 12:42 PM



I guess Walter meant that the low level Defrag API's are not publically
available. What are you trying to achieve here?
User applications can use WMI (System.Management) to defragment
drives/volumes.

Willy.


"Trapulo" <trapulo2 (AT) noemail (DOT) noemail> wrote

Quote:
Thank you, this is a starting point.

Is there the official documentation about defrag api? I cannot find it.

thanks


""Walter Wang [MSFT]"" <wawang (AT) online (DOT) microsoft.com> wrote in message
news:YMjCFXjMIHA.5204 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl...
Hi Trapulo,

There's no official documentation on how to use defrag api from .NET, but
there's some example code:

#Jeffrey Wall's WebLog : Defrag API C# wrappers
http://blogs.msdn.com/jeffrey_wall/a...13/229137.aspx


Hope this helps.


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.






Reply With Quote
  #5  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default Re: defrag API - 12-03-2007 , 01:32 AM



Thanks Willy for your input.

Hi Trapulo,

Would you please let us know what's your requirement here?

You may find following information helpful to understand how defragment
works:

#Inside Windows NT Disk Defragmenting
http://www.microsoft.com/technet/sys...kDefragmenting.
mspx

To add to Willy's suggestion about defragment using WMI, please refer to
following document:

#Defragmenting Disks the Windows 2003 Way
http://www.microsoft.com/technet/scr...03/defrag.mspx


Hope this helps.


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #6  
Old   
Trapulo
 
Posts: n/a

Default Re: defrag API - 12-05-2007 , 07:20 AM



I'd like to create some service to automatically defrag some files/folders
with my own logic. Not an entire volume, but files I want using the rules I
want to relocate them. Using win APIs to be sure to leave the file system
ok.
The first example you posted in previous message is a good starting point to
this goal, but without a serious documentation about APIs it seems it's too
hard creare this software.

The first page you posted here is an other good help, but the WMI document
isn't useful because I don't need to start the standard windows engine, but
manually to relocate my files where I want.

thanks

""Walter Wang [MSFT]"" <wawang (AT) online (DOT) microsoft.com> wrote

Quote:
Thanks Willy for your input.

Hi Trapulo,

Would you please let us know what's your requirement here?

You may find following information helpful to understand how defragment
works:

#Inside Windows NT Disk Defragmenting
http://www.microsoft.com/technet/sys...kDefragmenting.
mspx

To add to Willy's suggestion about defragment using WMI, please refer to
following document:

#Defragmenting Disks the Windows 2003 Way
http://www.microsoft.com/technet/scr...03/defrag.mspx


Hope this helps.


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.




Reply With Quote
  #7  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default Re: defrag API - 12-09-2007 , 11:54 PM



Hi Trapulo,

We currently don't have much public documentation on the low level
defragment APIs, I suggest you to contact our Advisory Service for more
support on this.

By the way, if your objective here is to make a single file continuous, you
might find contig.exe useful:

#Contig v1.54
http://www.microsoft.com/technet/sys...sk/Contig.mspx
<quote>
Contig is a single-file defragmenter that attempts to make files contiguous
on disk. Its perfect for quickly optimizing files that are continuously
becoming fragmented, or that you want to ensure are in as few fragments as
possible.
</quote>


Hope this helps.


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #8  
Old   
Trapulo
 
Posts: n/a

Default Re: defrag API - 12-14-2007 , 04:45 PM



""Walter Wang [MSFT]"" <wawang (AT) online (DOT) microsoft.com> wrote

Quote:
Hi Trapulo,

We currently don't have much public documentation on the low level
defragment APIs, I suggest you to contact our Advisory Service for more
support on this.
this is not good, however thanks for your assistance anyway

Quote:
By the way, if your objective here is to make a single file continuous,
you
might find contig.exe useful:

#Contig v1.54
http://www.microsoft.com/technet/sys...sk/Contig.mspx
quote
Contig is a single-file defragmenter that attempts to make files
contiguous
on disk. Its perfect for quickly optimizing files that are continuously
becoming fragmented, or that you want to ensure are in as few fragments as
possible.
/quote
this is not useful for my goal, but it's interesting anyway






Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.