Powershell script from task scheduler partially working
hi all,
i wrote powershell script print out files in specific folder:
cd c:\script
dir -name c:\invoices\*.* > list.txt
foreach ($docid in get-content "c:\script\list.txt")
{
cd "c:\program files\sumatrapdf\"
.\sumatrapdf.exe -print-to-default "c:\invoices\$docid"
}
sleep 30
ri c:\invoices\*.*
ri c:\script\list.txt
this work console every time.
when schedule task scheduler executing last part , ignoring part calling program print.
this driving me crazy suggestion why skipping part? have search lot , people speak variables , environment nothing seems apply case.
the task following parameters:
user:system
action:program/script
c:\windows\system32\windowspowershell\v1.0\powershell.exe
add arguemts:-file "c:\script\printinvoices.ps1"
thanks suggestion.
federico
windows 10 not option work , cliente windows 7.
anyway fixed. made work simple stupid bat using sumatra , using in task scheduler instead of powershell script working charm.
thanks help
federico
Windows Server > Windows PowerShell
Comments
Post a Comment