How to Pause and Resume a Printer in Batch Script
During scheduled maintenance, hardware repairs, or unexpected paper jams, you need to "Hold" the print queue without deleting the documents inside it. If you leave a printer "Live" while it's broken, users will keep sending documents, leading to a massive backlog and confusing "Error" messages that keep popping up. By Pausing the printer, the Spooler will continue to accept jobs and store them safely, but it won't attempt to send them to the hardware. Once the machine is fixed, a quick Resume command releases the floodgates and prints everything in the correct order.
This guide will explain how to control printer states using Batch.
Method 1: Pausing a Printer
PowerShell provides the most reliable way to toggle a printer's paused state by targeting its name.
@echo off
set "Printer=Office_Main_MFP"
echo [ACTION] Pausing %Printer% for maintenance...
:: Verify the printer exists
powershell -NoProfile -Command ^
"$p = Get-Printer -Name '%Printer%' -ErrorAction SilentlyContinue;" ^
"if (-not $p) { Write-Host '[ERROR] Printer not found: %Printer%'; exit 1 };" ^
"if ($p.PrinterStatus -eq 'Paused') { Write-Host '[INFO] Printer is already paused.'; exit 0 };" ^
"try { Stop-Printer -Name '%Printer%'; Write-Host '[SUCCESS] Printer is now PAUSED. Jobs will queue but not print.' }" ^
"catch { Write-Host '[ERROR]' $_.Exception.Message; exit 1 }"
if %errorlevel% neq 0 (
echo [ERROR] Failed to pause. Ensure you are running as ADMIN.
)
echo %date% %time% - Printer %Printer% PAUSED >> hardware_maintenance.log
pause
Administrative Rights. Changing the active state of a system peripheral requires elevated system permissions. You MUST run your script as an Administrator.
Method 2: Resuming a Printer
This restores the printer to its active state and begins processing the backlog immediately.
@echo off
set "Printer=Office_Main_MFP"
echo [ACTION] Resuming %Printer%...
:: Verify the printer exists and is actually paused
powershell -NoProfile -Command ^
"$p = Get-Printer -Name '%Printer%' -ErrorAction SilentlyContinue;" ^
"if (-not $p) { Write-Host '[ERROR] Printer not found: %Printer%'; exit 1 };" ^
"if ($p.PrinterStatus -ne 'Paused') { Write-Host '[INFO] Printer is not paused. Current status:' $p.PrinterStatus; exit 0 };" ^
"try { Start-Printer -Name '%Printer%'; Write-Host '[SUCCESS] Printer is back online and processing queued jobs.' }" ^
"catch { Write-Host '[ERROR]' $_.Exception.Message; exit 1 }"
if %errorlevel% neq 0 (
echo [ERROR] Failed to resume. Ensure you are running as ADMIN.
)
echo %date% %time% - Printer %Printer% RESUMED >> hardware_maintenance.log
pause
Method 3: The "Global Lockdown" Pattern
Use this if you are performing server maintenance and want to pause ALL printers as a safety precaution.
<# :
@echo off
setlocal
echo [LOG] Performing emergency print subsystem lockdown...
echo.
:: Launch the embedded PowerShell logic
powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((Get-Content '%~f0') -join \"`n\")"
echo.
echo [DONE] All printers have been set to HOLD.
echo Run the resume script on each printer after maintenance.
echo %date% %time% - GLOBAL LOCKDOWN applied >> hardware_maintenance.log
pause
exit /b 0
#>
# --- EVERYTHING BELOW THIS LINE IS POWERSHELL ---
try {
# Retrieve all printers using WMI/CIM
$printers = Get-CimInstance -ClassName Win32_Printer -ErrorAction Stop
if (-not $printers) {
Write-Host "[INFO] No printers found on this system." -ForegroundColor Yellow
exit 0
}
foreach ($p in $printers) {
try {
# Invoke the native WMI 'Pause' method
$res = Invoke-CimMethod -InputObject $p -MethodName Pause -ErrorAction Stop
# WMI ReturnValue: 0 = Success, 5 = Access Denied
if ($res.ReturnValue -eq 0) {
Write-Host "[PAUSED] $($p.Name)" -ForegroundColor Cyan
} else {
Write-Host "[FAILED] $($p.Name) : Access Denied (Code $($res.ReturnValue))" -ForegroundColor Yellow
}
}
catch {
Write-Host "[FAILED] $($p.Name) : $($_.Exception.Message)" -ForegroundColor Red
}
}
}
catch {
Write-Host "[ERROR] Could not query printers: $($_.Exception.Message)" -ForegroundColor Red
Write-Host "TIP: Ensure you are running this script as Administrator." -ForegroundColor Yellow
exit 1
}
Example of output:
[LOG] Performing emergency print subsystem lockdown...
[PAUSED] OneNote for Windows 10
[PAUSED] Microsoft XPS Document Writer
[PAUSED] Microsoft Print to PDF
[FAILED] Fax : Access Denied (Code 87)
[DONE] All printers have been set to HOLD.
Run the resume script on each printer after maintenance.
How to Avoid Common Errors
Wrong Way: Thinking "Pause" stops the service
When you pause a printer, the Print Spooler service is still running. You can still see the printer in your list, and applications can still "Print" to it.
Correct Way: Use the Stop-Printer cmdlet (Method 1). This is a "Logical" hold on the queue. If you want to stop the whole system, use net stop spooler, but be aware that this will prevent any new jobs from being added to the queue as well.
Problem: Remote Printers
If the printer is a "Shared" printer on a server, pausing it locally on your workstation might not stop other people from printing to it.
Solution: You must run the pause script on the Print Server itself to pause the queue for everyone.
Best Practices and Rules
1. Identify "Offline" vs "Paused"
A printer can be "Offline" (no power/connection) or "Paused" (software command). If a user says "My printer isn't working," checking if someone accidentally clicked "Pause" or ran your script is the first troubleshooting step.
2. Verify before Resuming
Always check the physical status of the hardware before running the "Resume" command. If a paper jam hasn't been cleared yet, resuming the printer will just cause it to jam again instantly.
3. Log the Maintenance
Log the duration of the pause. This helps in calculating the "True Uptime" of your office hardware for performance reviews.
echo %date% %time% - Printer %Printer% PAUSED >> hardware_maintenance.log
Conclusions
Pausing and resuming printers via Batch script provides a professional "Air Gap" for managing hardware maintenance and troubleshooting. By moving from manual right-clicking to automated status control, you ensure your document flow is managed precisely and that users are not frustrated by mysterious "Error" pop-ups. This professional level of control is essential for maintaining efficient office environments where reliable printing is a core requirement.