Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powershell and AdobeReader (Print)

Status
Not open for further replies.

omega90

MIS
Apr 8, 2012
1
DE
Hallo,
I'm a noobi in Powershell and my english is very bad =).
I would be glad for any help.
OK Task: I have 2 Folders ('A' and 'B'). If someone copy .PDF files into Folder 'A', my script has to print this PDF file and then replace it into Folder 'B'.
Script:

do
{
Get-Childitem C:\A *.pdf | Foreach { Start-Process -WindowStyle Hidden -FilePath $_.FullName –Verb Print -PassThru | %{sleep 10;$_} | kill}
cd C:\A
Copy-Item *.pdf C:\B
Get-Childitem C:\A *.pdf | del
Start-Sleep 6
}
while (1)

The Problem : script select automaticly the default Printer, but i want to use an other Printer!!

Till now i can print an only 1 File (static):
Start-Process AcroRd32.exe {/t C:\A\hello.pdf "MyPrinterName"}
Its all what Pdf-reader allows me.

If someone knows how i can combine these 2 scripts pls tell me.
Thanks =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top