DAEMON Tools HOME
DAEMON Tools FORUM

Command line parameters

info Before using any command line parameters please ensure that you have sufficient command line experience and you know exactly what you are doing.

In DOS, OS/2, and Microsoft Windows, a batch file is a text file containing a series of commands intended to be executed by the command interpreter. Similar to job control language and other systems on mainframe and minicomputer systems, batch files were added to ease the work required for certain regular tasks by allowing the user to set up a batch script to automate many commands. When a batch file is run, the shell program (usually COMMAND.COM or cmd.exe) reads the file and executes its commands, normally line-by-line. Batch files are useful for running a sequence of executables automatically and are often used to automate repetitive or tedious processes.
DOS batch files have the filename extension .bat.
You can use following commands and parameters to operate DAEMON Tools Lite from command line (console) or to create a batch file (see example).

The general format of commands:

DTLite.exe -[Command [options]]

The contents of the square brackets is an optional part of the command, you may use it but don't have to. The square brackets are not part of the command. Before option keywords preceded by a hyphen and multiple parameters are separated by commas.

Commands

  • -add

    Adds single virtual device, returns number of virtual devices or -1 if error.

    Syntax: -add <type>
    
    <type>: "dt" or "scsi"
    
    Example: DTLite.exe -add scsi
    
  • -set_count

    Adds or removes virtual devices (desired number of devices is passed as <n>), returns 0 in case of successful operation result or -1 in case of error.

    Syntax: -set_count <type>,<n>
    
    <type>: "dt" or "scsi"
    <n>:    device number. "0" — "4" allowed, with total maximum of 4 devices allowed (dt plus scsi)
    
    Example: DTLite.exe -set_count scsi, 1
    
  • -mount

    Mounts an image file to a virtual drive:

    Syntax: -mount <type>,<n>,<path>
    
    <type>: "dt" or "scsi"
    <n>:    device number. Device numeration starts from zero, so valid numbers are: "0" — "3" 
            (depending on number of installed devices) 
    <path>: path to image file
    
    Example: DTLite.exe -mount scsi, 0,"C:\My Images\name_of_image.ape"
    
  • -unmount

    Unmounts an image from a virtual drive.

    Syntax: -unmount <type>,<n>
    
    <type>: "dt" or "scsi"
    <n>:    device number
    
    Example: DTLite.exe -unmount scsi, 0
    
  • -unmount_all

    Unmounts all currently mounted images, returns 0 in case operation's result is OK or -1 in case it is FAILED. Parameterless.
  • Example: DTLite.exe -unmount_all
    
  • -remove

    Decrements number of devices, returns number of virtual devices or -1 if error.

    Syntax: -remove <type>,<n>
    
    <type>: "dt" or "scsi"
    <n>:    device number
    
    Example: DTLite.exe -remove scsi, 0
    
  • -get_letter

    Gets a letter assigned to a virtual device. Returns a letter number (0-A,1-B,2-C etc.) in case of success or -1 if any error occurred.

    Syntax: -get_letter <type>,<n>
    
    <type>: "dt" or "scsi"
    <n>:    device number
    
    Example: DTLite.exe  -get_letter scsi, 1
    
  • -get_count

    Gets number of virtual devices, returns devices quantity or -1 in case of error.

    Syntax: -get_count [type]
    
    [type]: "dt" or "scsi", if omitted would return total quantity of virtual drives (dt plus scsi devices)
    
    Example: DTLite.exe -get_count scsi
    
  • -help

    Displays brief help on command line parameters.

    Syntax: -help
    
    Example: DTLite.exe -help
    
  • To create windows batch file:

    1.
    Run notepad and paste the following text:
    @echo off
    cd /D "%PROGRAMFILES%\DAEMON Tools Lite"
    
    DTLite.exe -add 
    if errorlevel 0 goto mount_image
    if errorlevel -1 goto error_add
    
    :error_add
    echo You couldn't add new dt virtual drive. 
    echo Possible, you have already the maximum drives on your system. 
    
    :mount_image
    DTLite.exe -mount 1, "D:\Images\Games\Tortuga_game\Tortuga_game.mds"
    
    if errorlevel 0 goto get_letter
    if errorlevel -1 goto end
    
    :get_letter
    DTLite.exe -get_letter 1
    
    if errorlevel 0 goto exit_successfull
    if errorlevel -1 goto error_letter
    
    :end
    echo Image file not found
    goto exit
    
    
    :exit_successfull
    echo An image was seccessfully mounted to %errorlevel% letter (A-0, B-1, C-2 etc.) drive.
    goto exit
    
    
    :error_exit
    echo Image file not found or drive not added
    goto exit
    
    :error_letter
    echo Can't define drive letter
    
    :exit
    pause
    
    
    2.
    Save the file.
    3.
    Change file extension to "cmd" or "bat" (by default notepad files would have *.txt extension).
    4.
    Now you can run your batch file.

    Batch program description:

    info @echo off — will turn off all line echoes in the batch file script.
    cd — to change the current working directory. Point to the folder that contains the program which will execute your code. Use the /D switch to change current drive in addition to changing current directory for a drive.
    PROGRAMFILES this variable points to Program Files directory, which stores all the installed program of Windows and others. Use variable PROGRAMFILES(x86) for a 64-bit version operating system.
    errorlevel — to retrieve the value of the return code.
    pause — Suspends processing of a batch program and displays the message "Press any key to continue!", use to view the result of executing. Really convenient being able to pause the running code in end execution.

    If you have maximum number of virtual drives installed or program can't add new DT drive by any other reason, you will see the appropriate warning message. Otherwise new DT virtual drive will be added to your system and the program will try to mount an image to it. It's not necessary to point the type of device. By default the type of device is DT. If there is no image file to mount because of invalid path or name of image, you will see warning message and program will finish. In case of successfully mounted game image (to the virtual drive, which drive letter is "D") the program will return the number of the letter: '3' (by alphabetical order, numeration begins from 0). For returned value of 6, the letter is 'G', etc. because numbering starts from zero. Same as drive numeration — number of a new drive (for a newly installed DAEMON Tools Lite) would be '1', because DAEMON Tools Lite adds a virtual drive (that is set to 0) automatically on installation.