Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

First, the computers are of around 21 Win 7 Machines and 29 Win XP machines. The DC is a Win2k8 server and the Mail server is Win2k3

I need to force a remote defragmentation on roughly 50 computers. They have been complaining of slow performance and were recently plagued with a virus. It is impractical to physically go there and start 50 of these as it would have to be after hours. Is there a way to remotely send a command to each PC that will either create a scheduled tasks to kick it off or just force a defrag all together?

share|improve this question
Ryan Riles nailed the answer, but if you have a bunch of virus-infected computers, you should consider re-imaging them. Only way to be sure you got it all. And your image should have less fragmentation too, so it's killing two birds with one stone. – HopelessN00b Aug 15 '12 at 16:39
up vote 7 down vote accepted

There are going to be a number of different ways to accomplish this, but the first thing that comes to mind is to write a script to use PsExec to run defrag.exe on each PC.

share|improve this answer

For Windows 7 why are you bothering to force a defrag? Windows 7 by default defrags all hard drives on a periodic schedule.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.