简体   繁体   中英

Printing a web page from Windows Batch

Is it possible to use a windows batch script to open a web page and print its contents to your default printer? Something simple as this:

@echo off
start /d IEXPLORE.EXE www.google.com

and now I want to send that page to the printer. But I am not sure of the syntax nor was I able to find anything specific or helpful on the web.

Does anyone know if it's possible to print a web page using a windows batch command?

Not from an iexplore switch , but vbscript will work:

Const PRINT = 6
Const DONTPROMPTUSER = 2
Const BUSY=4

Dim oIExplorer
Set oIExplorer = CreateObject("InternetExplorer.Application")
oIExplorer.Navigate "http://www.stackoverflow.com/"
oIExplorer.Visible = 1

Do while oIExplorer.ReadyState <> BUSY
wscript.sleep 1000
Loop

oIExplorer.ExecWB PRINT, DONTPROMPTUSER

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM