打印图像

虽然 Power Automate 使您可以使用打印文档操作打印文档,但打印图像文件需要使用其他方法。

若要打印图像文件,请创建一个批处理脚本以启动 Microsoft Paint 并通过它打印所选的图像文件。 若要开发脚本,请创建新的 .txt 文件,复制以下代码,并将其另存为 Image-printing.bat

备注

在保存脚本之前,将 Image_Path 占位符替换为要打印的图像的文件路径。

@echo off+

title Print Images


rem The following command launches Microsoft Paint and prints the selected file using the default printer.

mspaint /p "Image_Path"


rem The following command ends the Microsoft Paint process. 

taskkill /IM "mspaint.exe"

若要运行该脚本,请使用运行应用程序部分并在应用程序路径字段中填充批处理文件的路径。

运行应用程序操作的屏幕截图。

或者,您可以使用运行 DOS 命令操作使用以下命令作为输入来打印图像文件:

备注

在运行流之前,分别将 Image_PathPrinter_Name 占位符替换为文件路径和打印机的名称。

rundll32 C:\WINDOWS\system32\shimgvw.dll,ImageView_PrintTo "Image_Path" "Printer_Name"