HALRAD Research

Windows CMD scripts for Phantom control

Phatcmdr - Proof Of Concept

Topic - phantomreboot.cmd / dccmdr.cmd - Windows Command Scripts to control Devialet Phantom Systems power states

Halrad Research - Phantom Commander Scripts

What is it? : Windows command-line scripts to restart or power off multiple Devialet Phantom speakers simultaneously

Scenario: Managing multiple Devialet Phantom speakers in a home or professional setup can be tedious when you need to restart or power them off individually. These scripts allow you to control multiple Phantom speakers at once using simple command-line tools. The scripts use curl to send HTTP POST requests to the Phantom's REST API endpoints for power control.

The Phantom Commander scripts consist of two files:

How to use:

  1. Save both scripts in the same directory
  2. Edit phantomreboot.cmd to include the IP addresses of your Phantom speakers
  3. Ensure curl is installed on your Windows system (comes with Windows 10 1803+)
  4. Run from Command Prompt or PowerShell

Usage Examples:

# Restart specific speakers
dccmdr.cmd -restart -ip 192.168.0.29 192.168.0.31

# Power off multiple speakers
dccmdr.cmd -poweroff -ip 192.168.0.29 192.168.0.31 192.168.0.33

# Use the quick reboot script (with predefined IPs)
phantomreboot.cmd
        

Example output:

[*] Sending restart to 192.168.0.29 ...
[โœ”] Success on 192.168.0.29

[*] Sending restart to 192.168.0.31 ...
[โœ”] Success on 192.168.0.31

[*] Sending restart to 192.168.0.33 ...
[โœ˜] Failed on 192.168.0.33
        

phantomreboot.cmd - Quick Reboot Script:

@echo off
pushd %~dp0
call dccmdr.cmd -restart -ip 192.168.0.29 192.168.0.31 192.168.0.33
popd

dccmdr.cmd - Main Command Script:

@echo off
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

REM === Initialize variables ===
set ACTION=
set "IPS="

REM === Parse command-line arguments ===
:parse
if "%~1"=="" goto done

if /i "%~1"=="-restart" (
    set ACTION=restart
) else if /i "%~1"=="-poweroff" (
    set ACTION=powerOff
) else if /i "%~1"=="-ip" (
    shift
    goto iplist
)

shift
goto parse

:iplist
if "%~1"=="" goto done
if /i "%~1"=="-restart" goto parse
if /i "%~1"=="-poweroff" goto parse
if /i "%~1"=="-ip" goto parse
set "IPS=!IPS! %~1"
shift
goto iplist

:done

REM === Validate input ===
if "%ACTION%"=="" (
    echo [!] Error: You must specify -restart or -poweroff
    exit /b 1
)

if "%IPS%"=="" (
    echo [!] Error: No IPs provided after -ip
    exit /b 1
)

REM === Loop over each IP and send command ===
for %%I in (!IPS!) do (
    echo.
    echo [*] Sending %ACTION% to %%I ...
    curl --fail --silent ^
        -X POST "http://%%I/ipcontrol/v1/devices/current/%ACTION%" ^
        -H "Content-Type: application/json" ^
        -d "{}"
    if errorlevel 1 (
        echo [โœ˜] Failed on %%I
    ) else (
        echo [โœ”] Success on %%I
    )
)

endlocal

Features:

API Endpoints Used:

Requirements:

Troubleshooting: