Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
:: Purpose: Defrags all computers listed in the names file
:: Requirements: 1. Run this script with network admin privileges
:: 2. psexec.exe from Microsoft must be in any of these locations:
:: a) the directory you run this script from
:: b) in the PATH variable
:: c) c:\windows\system32\ (preferred)
:: 3. Put the names of your computers, one per line, in a file called "names.txt" in the same directory as this script
::
:: Version: 1.1 Improved script by adding functionality to read a list of computer names from a text file
:: instead of hard-coded in the script. Uses a FOR loop to iterate through the file.
:: History: 1.0 Initial write
:: Prep
@echo off
title Mass Defragger
set VERSION=1.1
set NAMES_FILE=names.txt
set TIMEOUT=5
cls
:: User notice
color 0c
echo.
echo *********************************************************
echo * *
echo * MASS DEFRAGMENTER *
echo * ----------------------------------------------------- *
echo * *
echo * RULES for a safe and happy mass defragging: *
echo * *
echo * 1. Run this script with NETWORK ADMIN rights. *
echo * 2. Edit this script BEFORE RUNNING IT to put in your *
echo * own system names. *
echo * 3. Run this script from the desktop, NOT a network *
echo * path. *
echo * 4. "psexec.exe" from Microsoft must be in either: *
echo * a. the same directory as this script *
echo * b. C:\WINDOWS\system32\ *
echo * c: the system PATH variable *
echo * 5. A file named "names.txt" must be in *
echo * the same directory of this script. List the names *
echo * of the computers you want defragged, one name per *
echo * line. *
echo * *
echo *********************************************************
echo.
echo.
pause
color 07
cls
:: HIROSHIMA!
title Mass Defragging -- Timeout %TIMEOUT% seconds
cls
echo.
echo Performing mass defragmentation, with a %TIMEOUT% second connection timeout.
echo Please wait...
echo.
FOR /F %%i in (%NAMES_FILE%) do psexec -a 0 -belownormal -n %TIMEOUT% -d \\%%i defrag c: -f
title Mass Defragger -- Complete
echo.
echo Mass Defragger -- Complete
echo.
pause
title %USERNAME%