Skip to main content

How to Add a Custom "Send To" Option in Batch Script

The Windows "Send To" menu is a convenient feature that appears when you right-click a file or folder and hover over the "Send to" submenu. By default, it contains options like Desktop, Mail, and Compressed Folder. In this guide, we will learn how to add your own custom entries to this menu using Batch Script, enabling one-click file operations like copying files to a backup folder, moving them to a specific directory, or processing them with a custom tool.

This technique is straightforward, requires no registry editing, and works across all modern versions of Windows.

How the "Send To" Menu Works

Unlike the main context menu (which is registry-driven), the "Send To" menu is folder-based. It reads its entries from a special directory:

Current User:

%APPDATA%\Microsoft\Windows\SendTo

Any shortcut (.lnk), batch file (.bat), or executable placed in this folder will automatically appear in the "Send To" submenu. When a user selects one of these entries, the path of the selected file or folder is passed as a command-line argument (%1) to the target program or script.

info

The SendTo folder is unique to each user. Changes made here affect only the current user account.

Accessing the SendTo Folder

You can open the SendTo folder in two quick ways:

Method 1: Using the Shell Command

explorer shell:sendto

Method 2: Using the Full Path

explorer "%APPDATA%\Microsoft\Windows\SendTo"

Both commands open the folder in Windows Explorer, where you can manually add or remove entries.

Creating a Simple "Send To" Batch Script

Let's create a "Send to Backup" option. When the user right-clicks a file and selects this from the "Send To" menu, the file will be copied to a designated backup folder.

Step 1: Write the Batch Script

@echo off
setlocal

set "backup_dir=D:\Backup"

:: Create backup directory if it doesn't exist
if not exist "%backup_dir%" mkdir "%backup_dir%"

:: %1 contains the path of the file sent to this script
if "%~1"=="" (
echo No file was provided.
pause
exit /b 1
)

:: Process all selected files
:copy_loop
if "%~1"=="" goto copy_done
echo Copying "%~1" to backup...
copy "%~1" "%backup_dir%\" >nul
if errorlevel 1 (
echo [ERROR] Failed to copy "%~nx1".
) else (
echo [OK] Backed up "%~nx1".
)
shift
goto copy_loop

:copy_done
echo.
echo All files processed.
pause

Step 2: Place It in the SendTo Folder

@echo off
set "sendto=%APPDATA%\Microsoft\Windows\SendTo"
copy "%~dp0send_to_backup.bat" "%sendto%\" >nul
echo [OK] "Send to Backup" option added.
pause

Common Mistakes

The Wrong Way: Not Handling the %1 Parameter

:: WRONG - no argument handling
@echo off
copy file.txt D:\Backup\

Output Concern: This script always tries to copy a hardcoded file named file.txt. It ignores the actual file the user selected in Explorer, making the "Send To" option useless.

The Correct Way: Using %1 for Dynamic Input

:: CORRECT - handles the passed file
@echo off
copy "%~1" "D:\Backup\" >nul
echo Done.

The %~1 syntax removes any surrounding quotes from the parameter, preventing issues with double-quoting.

The Wrong Way: Not Handling Multiple Files

When the user selects multiple files and uses "Send To", each file is passed as a separate argument (%1, %2, %3...). However, if there are many files, they exceed the argument list.

:: WRONG - only processes the first file
copy "%~1" "D:\Backup\"

The Correct Way: Using a Shift Loop

:: CORRECT - processes all selected files
@echo off
set "backup_dir=D:\Backup"
if not exist "%backup_dir%" mkdir "%backup_dir%"

:process_loop
if "%~1"=="" goto done
echo Copying "%~1"...
copy "%~1" "%backup_dir%\" >nul
shift
goto process_loop

:done
echo [OK] All files copied.
pause

The shift command moves %2 into %1, %3 into %2, and so on, allowing the loop to process every file.

tip

The shift command is essential for handling variable numbers of arguments in Batch. Always use it in a loop when you expect multiple inputs.

Advanced Examples

Example 1: Send to Timestamped Backup

This version creates a subfolder with the current date and time to avoid overwriting previous backups.

@echo off
setlocal enabledelayedexpansion

:: Generate timestamp using WMIC
for /f "tokens=2 delims==" %%a in ('wmic os get localdatetime /value') do set "dt=%%a"
set "timestamp=%dt:~0,4%-%dt:~4,2%-%dt:~6,2%_%dt:~8,2%-%dt:~10,2%"

set "backup_dir=D:\Backup\%timestamp%"
mkdir "%backup_dir%" 2>nul

:copy_loop
if "%~1"=="" goto finish
copy "%~1" "%backup_dir%\" >nul
echo [COPIED] %~nx1
shift
goto copy_loop

:finish
echo.
echo [OK] All files saved to: %backup_dir%
pause

Example 2: Send to Quick Zip

This uses PowerShell (available on all modern Windows) to compress the selected files into a ZIP archive.

@echo off
setlocal enabledelayedexpansion

set "zip_name=archive_%date:~-4%%date:~-7,2%%date:~-10,2%.zip"
set "zip_path=%USERPROFILE%\Desktop\%zip_name%"
set "file_list="

:gather
if "%~1"=="" goto compress
if defined file_list (
set "file_list=!file_list!, '%~1'"
) else (
set "file_list='%~1'"
)
shift
goto gather

:compress
echo Compressing files to %zip_path%...
powershell -command "Compress-Archive -Path %file_list% -DestinationPath '%zip_path%' -Force"

if %errorlevel% equ 0 (
echo [OK] Archive created: %zip_path%
) else (
echo [ERROR] Compression failed.
)
pause

Example 3: Send to Custom Application

You can pass files directly to a specific application. For example, opening selected files in VS Code:

@echo off
set "app=C:\Program Files\Microsoft VS Code\Code.exe"

:open_loop
if "%~1"=="" goto end
start "" "%app%" "%~1"
shift
goto open_loop

:end

Automating the Installation

The following script provides a menu-driven installer for multiple "Send To" options.

@echo off
title Send To Menu Manager
setlocal enabledelayedexpansion

set "sendto=%APPDATA%\Microsoft\Windows\SendTo"

:menu
cls
color 0F
echo =============================================
echo SEND TO MENU MANAGER
echo =============================================
echo.
echo SendTo folder: %sendto%
echo.
echo --- Install ---
echo [1] Add "Send to Backup"
echo [2] Add "Send to Desktop"
echo [3] Add "Send to Quick Zip"
echo.
echo --- Remove ---
echo [4] Remove "Send to Backup"
echo [5] Remove "Send to Desktop"
echo [6] Remove "Send to Quick Zip"
echo.
echo [7] Open SendTo Folder
echo [8] List Current Entries
echo [9] Exit
echo.
set "opt="
set /p "opt=Select: "

if "!opt!"=="1" goto opt1
if "!opt!"=="2" goto opt2
if "!opt!"=="3" goto opt3
if "!opt!"=="4" ( del "!sendto!\Send to Backup.bat" 2>nul & echo [OK] Removed. & pause & goto menu )
if "!opt!"=="5" ( del "!sendto!\Send to Desktop.bat" 2>nul & echo [OK] Removed. & pause & goto menu )
if "!opt!"=="6" ( del "!sendto!\Send to Quick Zip.bat" 2>nul & echo [OK] Removed. & pause & goto menu )
if "!opt!"=="7" ( explorer "!sendto!" & goto menu )
if "!opt!"=="8" (
echo.
echo --- Current SendTo Entries ---
dir /b "!sendto!"
echo.
pause
goto menu
)
if "!opt!"=="9" exit /b
goto menu

:opt1
> "!sendto!\Send to Backup.bat" echo @echo off
>>"!sendto!\Send to Backup.bat" echo setlocal
>>"!sendto!\Send to Backup.bat" echo set "dest=%%USERPROFILE%%\Backup"
>>"!sendto!\Send to Backup.bat" echo if not exist "%%dest%%" mkdir "%%dest%%"
>>"!sendto!\Send to Backup.bat" echo :loop
>>"!sendto!\Send to Backup.bat" echo if "%%~1"=="" goto done
>>"!sendto!\Send to Backup.bat" echo copy "%%~1" "%%dest%%\" ^>nul
>>"!sendto!\Send to Backup.bat" echo shift
>>"!sendto!\Send to Backup.bat" echo goto loop
>>"!sendto!\Send to Backup.bat" echo :done
>>"!sendto!\Send to Backup.bat" echo echo [OK] Files backed up correctly to %%USERPROFILE%%\Backup
>>"!sendto!\Send to Backup.bat" echo pause
echo [OK] "Send to Backup" installed.
pause
goto menu

:opt2
> "!sendto!\Send to Desktop.bat" echo @echo off
>>"!sendto!\Send to Desktop.bat" echo :loop
>>"!sendto!\Send to Desktop.bat" echo if "%%~1"=="" goto done
>>"!sendto!\Send to Desktop.bat" echo copy "%%~1" "%%USERPROFILE%%\Desktop\" ^>nul
>>"!sendto!\Send to Desktop.bat" echo shift
>>"!sendto!\Send to Desktop.bat" echo goto loop
>>"!sendto!\Send to Desktop.bat" echo :done
>>"!sendto!\Send to Desktop.bat" echo echo [OK] Files copied directly to Desktop.
>>"!sendto!\Send to Desktop.bat" echo pause
echo [OK] "Send to Desktop" installed.
pause
goto menu

:opt3
> "!sendto!\Send to Quick Zip.bat" echo @echo off
>>"!sendto!\Send to Quick Zip.bat" echo set "zip=%%USERPROFILE%%\Desktop\archive.zip"
>>"!sendto!\Send to Quick Zip.bat" echo set "files="
>>"!sendto!\Send to Quick Zip.bat" echo :gather
>>"!sendto!\Send to Quick Zip.bat" echo if "%%~1"=="" goto zip_it
>>"!sendto!\Send to Quick Zip.bat" echo if defined files ^(
>>"!sendto!\Send to Quick Zip.bat" echo set "files=%%files%%, '%%~1'"
>>"!sendto!\Send to Quick Zip.bat" echo ^) else ^(
>>"!sendto!\Send to Quick Zip.bat" echo set "files='%%~1'"
>>"!sendto!\Send to Quick Zip.bat" echo ^)
>>"!sendto!\Send to Quick Zip.bat" echo shift
>>"!sendto!\Send to Quick Zip.bat" echo goto gather
>>"!sendto!\Send to Quick Zip.bat" echo :zip_it
>>"!sendto!\Send to Quick Zip.bat" echo powershell -command "Compress-Archive -Path %%files%% -DestinationPath '%%zip%%' -Force"
>>"!sendto!\Send to Quick Zip.bat" echo echo [OK] Archive cleanly created on Desktop.
>>"!sendto!\Send to Quick Zip.bat" echo pause
echo [OK] "Send to Quick Zip" installed.
pause
goto menu
if "!opt!"=="4" ( del "!sendto!\Send to Backup.bat" 2>nul & echo [OK] Removed. & pause & goto menu )
if "!opt!"=="5" ( del "!sendto!\Send to Desktop.bat" 2>nul & echo [OK] Removed. & pause & goto menu )
if "!opt!"=="6" ( del "!sendto!\Send to Quick Zip.bat" 2>nul & echo [OK] Removed. & pause & goto menu )
if "!opt!"=="7" ( explorer "!sendto!" & goto menu )
if "!opt!"=="8" (
echo.
echo --- Current SendTo Entries ---
dir /b "!sendto!"
echo.
pause
goto menu
)
if "!opt!"=="9" exit /b
goto menu

Key Differences: SendTo vs Context Menu

FeatureSendTo MenuContext Menu (Registry)
StorageFolder-basedRegistry-based
Admin RequiredNoYes
ScopeCurrent user onlyCan be all users
Ease of ModificationVery easy (add/delete files)Moderate (registry editing)
Arguments%1, %2, etc.%1 or %V

Best Practices

  1. Use descriptive names for your .bat files in the SendTo folder. The filename (without extension) becomes the menu label.
  2. Handle multiple files using shift in a loop, since users often select more than one file.
  3. Use %~1 (with tilde) to strip quotes from arguments and avoid double-quoting issues.
  4. Provide feedback with echo so the user knows the operation succeeded.
  5. No admin required: The SendTo folder is per-user, making it safe to modify without elevated privileges.

Conclusion

Adding custom "Send To" options in Batch Script is one of the simplest and most effective ways to enhance your Windows workflow.

Unlike registry-based context menu modifications, the SendTo approach requires no admin rights and is as easy as dropping a script into a folder.

Whether you need quick backups, file compression, or integration with custom tools, this technique provides a practical, low-friction solution.