How to automate diskdefragmentation


  1. Posts : 166
    windows 7 ultimate 64 bit
       #1

    How to automate diskdefragmentation


    Hi sevenforums,

    How can I automate disk defragmentation(assuming with task scheduler) if my fragmentation reaches 30% for C drive?
      My Computer


  2. Posts : 7,107
    W7 home premium 32bit/W7HP 64bit/w10 tp insider ring
       #2

    Hi JP,

    Task scheduler does not have a run when X% reached, so it would have to be time based ie monthly.


    Note
    SSD's should NOT be defragged.


    Roy
      My Computer


  3. Posts : 3,615
    Win 10 x64, Linux Lite, Win 7 x64, BlackArch, & Kali
       #3

    Windows 7, by default, defrags your Hard Drive (HDD) via task scheduler, it is disabled, by default, with Solid State Drive (SSD).
      My Computer


  4. Posts : 166
    windows 7 ultimate 64 bit
    Thread Starter
       #4

    torchwood said:
    Hi JP,

    Task scheduler does not have a run when X% reached, so it would have to be time based ie monthly.


    Note
    SSD's should NOT be defragged.


    Roy
    Thanks Mr.Torchwood for reply.....
      My Computer


  5. Posts : 2,798
    Windows 7 x64, Vista x64, 8.1 smartphone
       #5

    Hello jpchint, do you have any PowerShell scripting experience?

    Is this article any use to you: Use PowerShell to Determine Fragmentation of your Drive?

    Article suggests accessing WMI method DefragAnalysis, and querying the TotalPercentFragmentation member to achieve your scripting goal.
      My Computer


  6. Posts : 166
    windows 7 ultimate 64 bit
    Thread Starter
       #6

    iko22 said:
    Hello jpchint, do you have any PowerShell scripting experience?

    Is this article any use to you: Use PowerShell to Determine Fragmentation of your Drive?

    Article suggests accessing WMI method DefragAnalysis, and querying the TotalPercentFragmentation member to achieve your scripting goal.
    Awesome,thanks..
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 02:37.
Find Us