I would like to use a loop in
powershell to convert .rtf files to PDF. This only seems to work if I run the script manually (for Example in PS Ise). If I run the script with the Task Scheduler, then only the first file is converted and the script waits. The call is made with "Start-Process -PassThru -FilePath $pdf24Path -argumentlist $pdf24scriptArgs -wait"
It looks as if the script is waiting for a response from the process.

$pdf24Path is the path to "C:\Program Files\PDF24\pdf24-DocTool.exe"

$pdf24scriptArgs = "-convertToPDF -profile `"default/good`" `"$rtfFile`" -outputfile `"$pdf_FileName`""

Does anyone have any ideas?
Thanks Stephan

hub2000 Asked question 2023-12-06