Could we help you? Please click the banners. We are young and desperately need the money
Microsoft Outlook offers a frequently overlooked setting that significantly impacts your email size, signature management, and email communication efficiency: image embedding. If you use email signatures with logos or images, you're probably familiar with the problem: every sent email becomes unnecessarily large because Outlook embeds images directly into the message instead of referencing external image sources.
This article introduces a professional CMD script that automatically configures Outlook image embedding. The script is aimed at Windows administrators, IT professionals, and Outlook power users who want to optimize their email infrastructure.
By default, Outlook embeds signature images directly into every email. This leads to several problems:
The alternative: Images can be referenced as HTTPS links, loading them from the server instead of storing them repeatedly in every email.
The "Send Pictures With Document" setting in the Windows Registry controls this behavior. While you could manually change this setting via the Registry Editor (regedit), the CMD script presented here offers a safe, user-friendly, and error-free method.
If you host your signature images (company logo, social media icons, banners) on a web server, you should disable image embedding. The script sets the registry setting to "0x0" so Outlook leaves images as HTTPS links. Advantages:
In companies with limited Exchange mailboxes or cloud services with storage restrictions, this setting can bring significant savings:
Some situations require embedded images (e.g., recipients with strict email security policies that block external images). The script enables quick switching between both modes.
The following script was developed with a focus on user-friendliness, error handling, and clear output:
@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion
:: Title
echo ============================================
echo Outlook Image Embedding Configurator
echo ============================================
echo.
:: Automatically detect Outlook version
echo [INFO] Searching for installed Outlook version...
set "foundVersion="
set "versionName="
for %%v in (16.0 15.0 14.0 12.0) do (
reg query "HKCU\Software\Microsoft\Office\%%v\Outlook" >nul 2>&1
if !ERRORLEVEL! equ 0 (
set "foundVersion=%%v"
if "%%v"=="16.0" set "versionName=2016/2019/2021/365"
if "%%v"=="15.0" set "versionName=2013"
if "%%v"=="14.0" set "versionName=2010"
if "%%v"=="12.0" set "versionName=2007"
goto :versionFound
)
)
:versionFound
if not defined foundVersion (
echo ERROR: No Outlook installation found!
echo.
echo Please verify:
echo - Is Outlook installed?
echo - Supported versions: 2007-2021/365
echo.
pause
exit /b 1
)
echo Detected Outlook Version: !foundVersion! (Outlook !versionName!)
echo.
:: Define registry path
set "regPathShort=HKCU\Software\Microsoft\Office\!foundVersion!\Outlook\Options\Mail"
set "valueName=Send Pictures With Document"
:: Check current status
echo [CHECK] Reading current status...
set "currentValue="
set "currentStatus="
reg query "!regPathShort!" /v "!valueName!" >nul 2>&1
if !ERRORLEVEL! equ 0 (
for /f "tokens=*" %%a in ('reg query "!regPathShort!" /v "!valueName!" 2^>nul ^| findstr "REG_DWORD"') do (
for %%b in (%%a) do set "currentValue=%%b"
)
)
:: Interpret status
if "!currentValue!"=="0x1" (
set "currentStatus=ENABLED"
set "currentDesc=Images will be embedded"
set "suggestedChoice=0"
set "suggestedAction=DISABLE"
set "suggestedDesc=Keep images as HTTPS links"
) else if "!currentValue!"=="0x0" (
set "currentStatus=DISABLED"
set "currentDesc=Images remain as HTTPS links"
set "suggestedChoice=1"
set "suggestedAction=ENABLE"
set "suggestedDesc=Images will be embedded"
) else (
set "currentStatus=NOT CONFIGURED"
set "currentDesc=Default behavior"
set "suggestedChoice=1"
set "suggestedAction=ENABLE"
set "suggestedDesc=Images will be embedded"
)
:: Display current status
echo.
echo --------------------------------------------
echo CURRENT STATUS:
echo --------------------------------------------
if defined currentValue (
echo Setting: !currentStatus!
echo Value: !currentValue!
) else (
echo Setting: !currentStatus!
)
echo Meaning: !currentDesc!
echo --------------------------------------------
echo.
:: Intelligent user prompt
if "!currentStatus!"=="NOT CONFIGURED" (
echo The setting is not yet configured.
echo.
echo What would you like to do?
echo [1] ENABLE - Images will be embedded
echo [0] DISABLE - Images remain as HTTPS links
echo [X] CANCEL
echo.
:inputLoopNotConfigured
set /p "choice=Your choice (1/0/X): "
if /i "!choice!"=="X" (
echo Cancelled.
pause
exit /b 0
)
if "!choice!"=="1" goto :validChoice
if "!choice!"=="0" goto :validChoice
echo Invalid input! Please enter 1, 0, or X.
goto :inputLoopNotConfigured
) else (
echo Would you like to change the setting?
echo.
echo [Y] YES - !suggestedAction!: !suggestedDesc!
echo [N] NO - Keep current status
echo.
:inputLoopConfigured
set /p "confirm=Your choice (Y/N): "
if /i "!confirm!"=="N" (
echo.
echo No changes made. Status remains: !currentStatus!
pause
exit /b 0
)
if /i "!confirm!"=="Y" (
set "choice=!suggestedChoice!"
goto :validChoice
)
echo Invalid input! Please enter Y or N.
goto :inputLoopConfigured
)
:validChoice
:: Validate final choice
if "!choice!"=="1" (
set "embedValue=1"
set "actionText=ENABLED (Embed images)"
set "expectedHex=0x1"
) else if "!choice!"=="0" (
set "embedValue=0"
set "actionText=DISABLED (Keep images as links)"
set "expectedHex=0x0"
) else (
echo Invalid input!
pause
exit /b 1
)
echo.
echo [ACTION] Setting configuration to: !actionText!
echo.
:: Set registry value directly
echo [EXECUTION] Writing registry value...
reg add "!regPathShort!" /v "!valueName!" /t REG_DWORD /d !embedValue! /f >nul 2>&1
if !ERRORLEVEL! equ 0 (
echo Registry value successfully set.
) else (
echo ERROR: Could not set registry value!
echo Error code: !ERRORLEVEL!
pause
exit /b 1
)
:: Validation
echo.
echo [VALIDATION] Checking new setting...
set "newValue="
reg query "!regPathShort!" /v "!valueName!" >nul 2>&1
if !ERRORLEVEL! equ 0 (
for /f "tokens=*" %%a in ('reg query "!regPathShort!" /v "!valueName!" 2^>nul ^| findstr "REG_DWORD"') do (
for %%b in (%%a) do set "newValue=%%b"
)
echo New value: !newValue!
echo Expected: !expectedHex!
if "!newValue!"=="!expectedHex!" (
echo Status: Successful - !actionText!
) else (
echo Status: WARNING - Unexpected value!
)
) else (
echo Status: ERROR - Could not read value!
)
:: Completion
echo.
echo ============================================
echo CONFIGURATION COMPLETED
echo ============================================
echo.
echo.
echo ********************************************
echo IMPORTANT: OUTLOOK MUST BE RESTARTED!
echo ********************************************
echo.
echo Changes will only take effect after
echo restarting Outlook.
echo.
echo Please close Outlook completely
echo and restart it.
echo.
pause
The script requires no additional dependencies or installations. The following is required:
.cmd extension (e.g., outlook-image-embedding.cmd)The script modifies the DWORD value Send Pictures With Document in the following registry path:
HKEY_CURRENT_USER\Software\Microsoft\Office\[Version]\Outlook\Options\Mail
Where [Version] represents the Outlook version (e.g., 16.0 for Outlook 2016/2019/2021/365).
Problem: The script reports "No Outlook installation found"
Solution:
Problem: After running the script, Outlook behavior doesn't change
Solution:
Problem: Special characters appear incorrectly
Solution:
chcp 65001 for UTF-8 supportIT administrators can adapt the script for mass distribution:
For automated distribution without user interaction, you can modify the script as follows:
set /p)choice to the desired value (0 or 1)pause commands at the endAdd logging functionality to track changes:
echo %date% %time% - User: %username% - Action: !actionText! >> C:\IT-Logs\outlook-config.log
The script was developed with a focus on security:
Control over Outlook image embedding is an often underestimated lever for optimizing email infrastructure. With this CMD script, you get a professional tool for easy management of this setting.
For most enterprise environments, we recommend:
With this configuration, you achieve the optimal balance between email size, user-friendliness, and centralized management of your Outlook signatures.
Controlling Outlook image embedding is a simple but powerful way to optimize your email infrastructure. The presented CMD script offers a professional, secure, and user-friendly solution for Windows administrators and Outlook power users. Through automatic version detection, comprehensive validation, and clear user guidance, it eliminates the error-proneness of manual registry interventions and saves valuable configuration time.
Whether you want to save email storage space, centrally manage signatures, or simply have more control over your Outlook behavior – this script is the right tool for the job.