我想将标准输出发送到带有每个打印机的日期戳和位置的日志文件。
On Error resume Next
Dim objNetwork, StdIn, StdOut
'Initialize the printer connections object
Set objNetwork = CreateObject("WScript.Network")
Set StdIn = WScript.StdIn
Set StdOut = WScript.StdOut
'Connect each printer
objNetwork.AddWindowsPrinterConnection "\\server\pr01"
objNetwork.AddWindowsPrinterConnection "\\server\pr02"
objNetwork.AddWindowsPrinterConnection "\\server\pr03"
'Remove old printers
'objNetwork.RemoveWindowsPrinterConnection "\\old_server\printer_1"
'objNetwork.RemoveWindowsPrinterConnection "\\old_server\printer_2