Automated installation

Last updated on Jun 1, 2021

UltraDefrag installation can be easily fully automated using command line switches. This is especially helpful if you need to install the program on a large number of computers.

Basic instructions

  1. Create a plain text file named install-ultradefrag.cmd and copy the following content into it:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    @echo off
    ::
    :: This script performs automated installation of UltraDefrag.
    ::
    :: Please note that you have to replace <your_username> and
    :: <your_password> by your actual user credentials you have
    :: received upon the purchase in order to use this script.
    ::

    setlocal

    :: install UltraDefrag

    ultradefrag-9.0.1-enterprise /S /NAME=<your_username> /PASSWORD=<your_password>

    :: UltraDefrag installer is well known to be very reliable,

    :: but, just in case, let's check how the installation went
    if "%errorlevel%" equ "0" (
        echo Installation succeeded!
        set EXIT_CODE=0
    ) else (
        echo Installation failed!
        echo.
       
        :: if the automated installation of UltraDefrag fails,

        :: the installer saves the exact reason why it failed
        :: to a log file; let's display the file here
        type "%TMP%\UltraDefrag_Install.log"
        set EXIT_CODE=1
    )

    :: display a prompt to hit any key; comment it out if

    :: you plan to perform a fully automated installation
    pause

    exit /B %EXIT_CODE%
  2. Save the file.

  3. Create an empty folder and put the file and the UltraDefrag installer you have received after the purchase into it.

  4. Transfer the folder to the computers you want to install UltraDefrag on and then double click the install-ultradefrag.cmd file to perform the automated installation. If you want to install the program on computers in your network you can also copy the files to a shared folder and set the install-ultradefrag.cmd file as a startup script for the computers using the group policy to further automate the process.

Command line switches

The UltraDefrag installer supports the following command line switches:

SwitchDescription
/SInstall UltraDefrag silently (without graphical dialogs). If only this switch is present on the command line all the components will be installed to the default installation directory (C:\Program Files\UltraDefrag) in the case of a fresh installation or all the previously installed components will be upgraded in the case of an upgrade.
/NAME=<name>Your username. This switch is mandatory unless you upgrade a previously installed copy of UltraDefrag 9.
/PASSWORD=<password>Your password.This switch is mandatory unless you upgrade a previously installed copy of UltraDefrag 9.
/FULL=1Install all the components.
/MICRO=1Install the boot time and command line interfaces only, as well as the automatic and one-click defragmentation components.
/GUI={1|0}Install or remove the graphical interface.
/CONSOLE={1|0}Install or remove the command line interface.
/BOOT={1|0}Install or remove the boot time interface.
/AUTODEFRAG={1|0}Install or remove the automatic defragmentation component.[1]
/SHELLEXTENSION={1|0}Install or remove the one-click defragmentation component.[1]
/HELP={1|0}Install or remove a copy of UltraDefrag Handbook.
/ICONS={1|0}Install or remove all the shortcuts.[2]
/STARTMENUICON={1|0}Install or remove the start menu icon.[2]
/DESKTOPICON={1|0}Install or remove the desktop icon.[2]
/QUICKLAUNCHICON={1|0}Install or remove the quick launch bar icon (on Windows XP/Vista/7/8).[2]
/EXTRACTPE={1|0}Extract or remove the portable edition of UltraDefrag.
/DISABLE_USAGE_TRACKING={1|0}Enable or disable the usage tracking.
/D=<installation_folder>Set the installation folder. Please note that this switch must be the last on the command line, the full path must be specified and it must not contain any quotes, even if it contains spaces. If the specified folder exists, it must be empty or contain a previous UltraDefrag installation. If you omit the switch the default installation folder (C:\Program Files\UltraDefrag) will be used in the case of a fresh installation or the previously selected folder in the case of an upgrade.

Tip

To quickly check whether the command line switches are set correctly or not simply omit the /S switch. The installer will show all the graphical dialogs with the installation options preset according to the command line switches.

Usage examples

Check the following examples to learn how to fully automate typical installation tasks using the command line switches.

Performing a full installation

To install all the UltraDefrag components you can use the following command:

1
ultradefrag-9.0.1-enterprise /S /NAME=<your_username> /PASSWORD=<your_password>

Performing a custom installation

Sometimes you might want to install all the components except a few. You can easily do it using the command line switches. For instance, to install everything except of the desktop icon you can use the following command:

1
ultradefrag-9.0.1-enterprise /S /NAME=<your_username> /PASSWORD=<your_password> /FULL=1 /DESKTOPICON=0

Removing a component from an existing installation

If you want to remove a component from an existing installation you don’t need to uninstall the program first. All you need to do is to run the installer once again with an appropriate command line switch. For instance, to remove the one-click defragmentation component from an existing installation you can use the following command:

1
ultradefrag-9.0.1-enterprise /S /SHELLEXTENSION=0

Relocating an existing installation

If you want to relocate an existing installation you don’t need to uninstall the program first. Just run the installer once again with the new installation folder specified on the command line:

1
ultradefrag-9.0.1-enterprise /S /D=H:\Software\UltraDefrag

Uninstalling the program silently

If you want to uninstall the program silently you can easily to it using the /S switch:

1
%UD_INSTALL_DIR%\uninstall /S

Notes

  • If you will select either the automatic defragmentation or the one-click defragmentation component to be installed the command line interface they depend on will be installed as well.
  • If you will select any of the shortcuts to be installed the graphical interface will be installed as well.