@echo off REM ============================================================ REM Convert Publisher Files to PDF - Double-click to run REM ============================================================ REM This automatically allows the PowerShell script to run, REM without needing to change any settings yourself. REM ============================================================ echo. echo Convert Publisher (.pub) files to PDF echo ============================================================ echo. set /p SCAN_PATH="Enter the drive or folder to scan (or press Enter for C:\): " if "%SCAN_PATH%"=="" set SCAN_PATH=C:\ REM Strip a trailing backslash if present - a lone trailing backslash right REM before a closing quote confuses Windows into escaping the quote instead REM of ending the path (e.g. "E:\" breaks). PowerShell is happy with "E:" REM or "C:\Users\Name\Documents" either way, so this is safe to remove. if "%SCAN_PATH:~-1%"=="\" set SCAN_PATH=%SCAN_PATH:~0,-1% echo. set /p SKIP_CHOICE="Skip files that already have a PDF next to them? (Y/N, default Y): " if /i "%SKIP_CHOICE%"=="N" ( set SKIP_FLAG= ) else ( set SKIP_FLAG=-SkipExisting ) echo. echo Converting Publisher files to PDF... echo Scanning: %SCAN_PATH% echo. powershell -ExecutionPolicy Bypass -File "%~dp0Convert-PubFiles.ps1" -Path "%SCAN_PATH%" %SKIP_FLAG% echo. echo ============================================================ echo Done. Check the log file on your Desktop for details: echo Pub_Conversion_Log.csv echo ============================================================ pause