I'd like to run a remote defrag across some of our PCs - previously, I did this with BeyondExec but that doesn't like to play with our new W2K3 server. Can anyone suggest another way of doing this?
I'd like to run a remote defrag across some of our PCs - previously, I did this with BeyondExec but that doesn't like to play with our new W2K3 server. Can anyone suggest another way of doing this?

To be honest if you feel a workstation needs defraging, re-imaging is definitely the better and quicker option. Typically you need to run scandisk prior to running a defrag.

How so? It should be like a brand new machine.

We set ours to defrag on a scheduled task.
If you image a badly fragmented machine, does it then replicate itself over to the clone, that is, the data that is put on the new hard drive is where it was on the old one, fragmented?
I tend to defrag a machine I want to image prior to taking the image for that very reason, but I actually don't know if it is necessary to do so. I've just played safe.
![]()

@enjay:
I think there are some good third party defraggers around that involve a client installation can't for the life of me remember (temporary memory loss) but have a google for them.
As Michael has stated why would you want to run a workstation defrag network wide?
It is far quicker to re-image unless your workstations have SSHDs.
I have never ever ran a network wide workstation defrag before simply for that reason.![]()
![]()
I use psexec.exe to defrag all our machines run from a .bat file called psexece.bat in the same folder as psexec.exe.
the .bat file contails this info
with in the same folder we have .txt files named what ever you wish with this info in@echo off
:start
cls
echo.
echo.
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º º
echo º Multi Defrag º
echo º º
echo ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
echo º º
echo º 1. defrag Suite º
echo º 2. defrag Classrooms º
echo º 3. defrag Others º
echo º 4. exit º
echo º º
echo º º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
set /p userinp=choose a number(1-4):
set userinp=%userinp:~0,1%
if "%userinp%"=="1" goto 1
if "%userinp%"=="2" goto 2
if "%userinp%"=="3" goto 3
if "%userinp%"=="4" goto end
echo invalid choice
goto start
:1
psexec -d @defrag.txt defrag c:
goto end
:2
psexec -d @defrag.txt defrag c:
goto end
:3
psexec -d @defrag.txt defrag c:
goto end
etc.
:end
pause
exit
and as you see in the .bat file it points to the .txt file and away you go remote defragsuite01
suite02
suite03
suite04
suite05
suite06
suite07
suite08
suite09
suite10
suite11
suite12
suite13
suite14
suite15
suite16![]()
thought id attach it for you![]()
enjay (5th March 2010)

You could try Defraggler:
Defraggler - File and Disk Defragmentation - Free Download
--
David Hicks

If a machine was badly fragmented usually when imaging the partition table is deleted, re-created and the data is copied or imaged. Now generally speaking you'd create images from newly installed machines not machines which are years old.If you image a badly fragmented machine, does it then replicate itself over to the clone, that is, the data that is put on the new hard drive is where it was on the old one, fragmented?

I use VBS and WMI for this and it even keeps track of them reporting back when they are done and any errors. Just feed it a list of computer names in computers.txt and it will do the rest. The cool version only works with Vista or above though as XP lacks the WMI calls to do it but I have one for XP too. It can run nicely in the background without logging on or disturbing the user and will even report back any errors it encounters or the time taken if using the XP version.
It is made of two VBS scripts, one which actually does the defrag and takes the computername as a parameter the other just reads through the list of computers and spawns a whole bunch of processes simultaniously so that all the machines defrag at once. If you have XP just rename defragxp.vbs to defrag.vbs and it will use that one instead.
In a primary school situation especially with a script like the one attached it does not take that long to defrag and is much quicker than imageing the whole lot as we don't have SCCM for automation. Updates and other things that happen also trash the order of the HD and are not worth a reimage so I find this to be a good solution. Just so that you are aware monitering the defrag takes up about 4mb of ram per computer so don't feed it a huge list if you are short on ram.
These scripts could easily be modified to record the information back to a text file or something for performance monitering if you wanted to.
@busby - possibly being stupid, but I'm not getting how I specify which PCs to defrag. I can create the text files, but I'm not sure how to tell it which text file to use...
Sorry for the late post.
:1
psexec -d @defrag.txt defrag c:
goto end
:2
psexec -d @defrag.txt defrag c:
goto end
:3
psexec -d @defrag.txt defrag c:
goto end
on this part of that .bat file change the defrag.txt to the name of your text file.
enjay (10th March 2010)
Thanks Busby, much appreciated.
There are currently 1 users browsing this thread. (0 members and 1 guests)