hello everyone,
my works fine if i manually start it.
But in need to plan it over the windows task.
this does not work for the complete script.
In the first step my script print all *.pdf files form a folder. (Works manually and in task)
Second step, the *.pdf should paste in a restore folder. (Works manually but not in task)
I don’t find the error for this … maybe someone can help me please?
thx,
Marcus
My Code looks like this:
# Path to folder with pdf-Documents</em> $tpath="C:\Import-Bestellungen\Kunden\Omega\"</em> #-Print---------------------------------------------------------------</em> $files = gci "$tpath*.pdf"</em> $files | %{&'C:\Program Files (x86)\SumatraPDF\sumatrapdf.exe' -print-to "Büro-1" "`"$($_.Fullname)`""}</em> #$files | %{&'C:\Program Files (x86)\SumatraPDF\sumatrapdf.exe' -print-to "Brother HL-L8350CDW – Farbe" "`"$($_.Fullname)`""}</em> sleep(10)</em> #-Archiv / Resotre folder------------------------------------------------------------</em> foreach($item in (Get-ChildItem -Path "$tpath" | Where-Object {$_.Name -like "*.pdf*"}))</em> {</em> Move-Item -Path $item.FullName -Destination ("$tpath\Archiv\"+$(Get-Date).ToString("yyyy-MM-dd-HH-mm-ss-")+$($item.Name))</em> }</em><span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start"></span>