Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Printing to a specific printer Expand / Collapse
Author
Message
Posted Tuesday, October 8, 2013 12:24 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, March 26, 2014 5:09 PM
Points: 178, Visits: 579
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
Post #1502762
Posted Tuesday, October 8, 2013 12:31 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 1:45 AM
Points: 5,813, Visits: 3,734
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!!!
Post #1502764
Posted Tuesday, October 8, 2013 12:54 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, March 26, 2014 5:09 PM
Points: 178, Visits: 579
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"
Post #1502770
Posted Wednesday, October 9, 2013 2:14 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 1:45 AM
Points: 5,813, Visits: 3,734
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!!!
Post #1502958
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse