PrintHtml icon indicating copy to clipboard operation
PrintHtml copied to clipboard

scripting problem

Open lazna opened this issue 3 years ago • 1 comments

Just found the program start but hang in memory if is started from CGI scripting environment. From console window it work normally. My guess is it cant create GUI box with green progress bar in true scripting enviroment and wait for it, or something like this. Any other reason for such behaviour?

lazna avatar May 11 '22 09:05 lazna

Just found workaround which allow run interactive UI program from non-interactive environment (e.g. SYSTEM account).

  • Create scheduled task under USER account
  • Choose Schedule date from the past
  • Check radio button "Run only when user is logged on"
  • Start task from console by schtasks /RUN /TN "Name of created task" command

Processing of printing task itself could be monitored by:

powershell "Get-WinEvent -MaxEvents 4 -FilterHashTable @{ LogName = 'Microsoft-Windows-PrintService/Operational'; ID = 800,801,805,307} | Select-Object -Property TimeCreated,Message | ft -HideTableHeader | Out-String -width 999"

NOTE: printer spooler eventlogging have to be enabled first: https://www.quora.com/How-can-I-check-my-print-history-in-Windows-7

lazna avatar May 12 '22 14:05 lazna