Printing to a specific printer

  • As of now I have this in my Execute Process task Command section to print a list of text files in a directory.

    Get-ChildItem -path $Directory -recurse -include *.txt | ForEach-Object {Start-Process -FilePath $_.fullname -Verb Print -PassThru | %{sleep 5;$_} | kill }

    I believe it goes to the locally configured printer.

    How do I make these files print to a specific network printer.

    Thanks

  • You can print to a specified printer using the Output-Printer cmdlet e.g.

    Get-Process | Output-Printer "IT Department Printer"

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

  • Can I do something like this ?

    Get-ChildItem -path $Directory -recurse -include *.txt | ForEach-Object {Start-Process -FilePath $_.fullname -Verb Print -PassThru | %{sleep 5;$_} | kill }

    Get-Process | Output-Printer "\\Print1\ABC01"

    where ABC01 is the name of the printer.

    or

    Get-ChildItem -path $Directory -recurse -include *.txt | ForEach-Object {Start-Process -FilePath $_.fullname -Verb Print -PassThru | %{sleep 5;$_} | kill }

    Get-Process | Output-Printer "ipaddress"

  • I believe so, by what you have posted. If I were you I would test that the printing is working first then build it up.

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply