Sign In
James Manning's blog
Team Foundation Server + PowerShell = Happiness
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
Blog Home
Share this
RSS for posts
Atom
RSS for comments
Search
Advanced search options...
Search In:
Everything
Blogs
Forums
People
Groups
Places
Pages
Date range:
All Time
Last Year
Last 6 Months
Last 3 Months
Last Month
Last Week
Last Two Days
Tags
Pages
Archive
Archives
April 2009
(1)
January 2009
(6)
December 2008
(2)
November 2008
(1)
September 2008
(1)
July 2008
(3)
June 2008
(9)
May 2008
(15)
April 2008
(4)
March 2008
(1)
February 2008
(4)
January 2008
(2)
November 2007
(2)
October 2007
(2)
September 2007
(1)
July 2007
(8)
June 2007
(3)
May 2007
(4)
March 2007
(12)
February 2007
(23)
January 2007
(7)
December 2006
(1)
November 2006
(14)
October 2006
(5)
September 2006
(10)
August 2006
(4)
July 2006
(2)
June 2006
(4)
May 2006
(1)
April 2006
(4)
March 2006
(5)
February 2006
(8)
January 2006
(8)
December 2005
(1)
November 2005
(4)
October 2005
(8)
September 2005
(7)
August 2005
(1)
June 2005
(6)
May 2005
(1)
April 2005
(1)
March 2005
(1)
February 2005
(4)
December 2004
(3)
October 2004
(1)
September 2004
(1)
August 2004
(3)
July 2004
(5)
June 2004
(4)
scheduled automatic defrag of your hard-drive
MSDN Blogs
>
James Manning's blog
>
scheduled automatic defrag of your hard-drive
scheduled automatic defrag of your hard-drive
MSDNArchive
21 Jul 2006 2:30 AM
Comments
1
This isn't that big of a deal, but since
some articles make it sound like this is a difficult thing
, I wanted to post something others may find helpful in getting automatic defrag going.
Adi (among many others) had posted a
schtasks.exe call that will get defrag running weekly
but it doesn't specify the day of the week or the time of day (both default to current), so I'd change it based on that. Since 4am on Sunday is reasonable (and the default in the current Vista builds), we'll go with that.
I'm sure adding the .exe extensions seems a little odd, but I'm getting into that habit mainly because of "sc" in
powershell
being an alias for set-content, so my usual calls to sc.exe need to be spelled out (I don't mind strongly enough to remove the alias from all the different machines I use).
This will need to be run as an administrator, but given the nature of defrag, I hope that doesn't come as a surprise. Also, you may have more than one logical drive (I have both C: and D: on my main machine at work, for instance), but creating a second (or third) scheduled task for defrag'ing the other drive(s) should be pretty straightforward.
schtasks.exe /create /tn defrag /ru system /sc weekly /d sun /st 04:00 /tr "defrag.exe %systemdrive%"
1 Comments
Blog - Comment List MSDN TechNet
Comments
Loading...