@echo off rem Drag a .zpl file onto this and it goes to the printer. rem rem Explorer cannot drop a file onto a .ps1 - it opens it in Notepad - so rem this exists to catch the drop and hand it to send-zpl.ps1 beside it. rem -ExecutionPolicy Bypass is for this one run only and changes nothing on rem the machine: a script nobody can run is no use as a fallback. rem rem Set the printer once and this never asks again: rem setx ZPL_PRINTER 192.168.1.81 setlocal if "%~1"=="" ( echo Drag a .zpl file onto this file, or run: send-zpl.cmd "C:\path\label.zpl" 192.168.1.81 echo. pause exit /b 1 ) set "ADDR=%~2" if "%ADDR%"=="" set "ADDR=%ZPL_PRINTER%" if "%ADDR%"=="" set /p "ADDR=Printer address (e.g. 192.168.1.81): " powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0send-zpl.ps1" "%~1" "%ADDR%" echo. pause