Defrag on shutdown with .bat file - TechRepublic
Question
June 5, 2008 at 11:23 AM
rgun2515

Defrag on shutdown with .bat file

by rgun2515 . Updated 18 years, 1 month ago

Anyone running shutdown scripts from Group Policy? “gpedit.msc” – windows settings – scripts – shutdown – add shutdown.bat. My “shutdown.bat” reads.

cleanmgr /sagerun:11
defrag -v c:\
exit

It is obvious that it runs. Takes a while to finishing “running shutdown scripts”.

Thing is, If after you boot up the computer and go into windows defrag, it graphically shows the same as it did before,(lots of red) and states “you should defrag this drive”

Even if you do it from a command line, same results…
Then I run it with the windows defrag program, and it defrags nicely.

Is running defrag from the command line really working?

This discussion is locked

All Comments