Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
CanadaDBA
583 Posts |
Posted - 2007-07-19 : 09:44:00
|
| Isn't there any way to automate Windows defrag? Isn't there any undocumented parameters for DEFRAG.EXE?Canada DBA |
|
|
Haywood
Posting Yak Master
221 Posts |
Posted - 2007-07-19 : 10:10:55
|
| This is a batchfile I use to keep my craptop defragged...Defrag C: -f -v > C:\Utils\Defrag\Defrag.out.txtDefrag D: -f -v >> C:\Utils\Defrag\Defrag.out.txt |
 |
|
|
CanadaDBA
583 Posts |
Posted - 2007-07-19 : 10:22:55
|
| That's good and I guess I can put it in a batch file and schedule it. I'll try it. Thanks!Meanwhile, I found the following on the net.http://searchwincomputing.techtarget.com/originalContent/0,289142,sid68_gci1097119,00.htmlhttp://snippets.dzone.com/posts/show/3925Canada DBA |
 |
|
|
Haywood
Posting Yak Master
221 Posts |
Posted - 2007-07-19 : 10:26:26
|
| The first link is exactly what I do...Can't get to the second link due to websense. |
 |
|
|
CanadaDBA
583 Posts |
Posted - 2007-07-19 : 15:09:27
|
The autodefrag.py does not run under Windows and needs another program to be installed. But using Haywood's solution, I created the following batch file that can be scheduled and run.@Echo offSET DestPath=C:\Utils\Defrag.out.txtDate /T >> %DestPath%Time /T >> %DestPath%Echo ------------------------------- >> %DestPath%Defrag C: -f -v >> %DestPath%Echo ***Finished*** >> %DestPath%Time /T >> %DestPath%Echo ------------------------------- >> %DestPath%Echo * * * * * * * * * * * * * * * * >> %DestPath%Echo ------------------------------- >> %DestPath%SET DestPath= Canada DBA |
 |
|
|
|
|
|