isarc01
Goto Top

Powershell Script wird unter Windows 2012 R2 nicht ausgeführt?!

Hallo,

ich habe hier ein Powershell Script, welches unter Win10 und unter Windows 2008 funktioniert.

Allerdings funktioniert es nicht unter Windows 2012 R2. In der Eventlog konnte ich keinen Fehler entnehmen.
Kann es sein, dass es keinen echten LPR Dienst unter Windwos 2012 R2 gibt?

Ich konnte hier nur LPD finden.

Wer weiß Rat? Es geht darum, dass das Dokument nicht ausdruckt wird.
Drucker wurde selbstverständlich korrekt als LPR Printer installiert.


    [string]$path = 'C:\Scans\temp'  
)

Get-ChildItem -Path $path -Filter '*.pdf' -File |   
    # filter only files that end with a number and capture that number in $matches[1]
    Where-Object { $_.BaseName -match '(\d+)$' } |  
    # loop through the files and print 
    ForEach-Object {
        for ($i = 1; $i -le [int]$matches[1]; $i++) {
            cmd /C "lpr -S 10.39.33.204 -P printer""$($_.FullName)"""  
        }
    } 

Content-Key: 1732832960

Url: https://administrator.de/contentid/1732832960

Printed on: April 25, 2024 at 06:04 o'clock

Member: SeaStorm
Solution SeaStorm Jan 17, 2022 updated at 16:26:18 (UTC)
Goto Top