Have set of batch scripts powered CGI based web system, web server running under SYSTEM account. As result of one script, physical document should be printed. Because of document layout, I choosed program https://github.com/kendallb/PrintHtml for printing, it starting fom console with parameters.
There is a problem the PrintHTML is not a console program as its author state: "Unfortunately this program is not a console program, as it needs access to Windows UI components in order to print."
Is it possible to start such program (only start with parameters, no need any response from it) from non-interactive session? Playing with PSEXEC option -i but have no luck. Also thinking about to create Schedule task and start it by "schtasks /run" but not tested yet.
System is running on W7/32bit with specific user autologon on startup.
Any ideas?
start GUI program from non-interactive session
Moderator: DosItHelp
Re: start GUI program from non-interactive session
SOLVED:
Create Scheduled task and start it via 'schtasks /RUN' solve this isssue.
Create Scheduled task and start it via 'schtasks /RUN' solve this isssue.
Re: start GUI program from non-interactive session
Thanks for the update. I haven't had any good idea since manyfold things can prevent you to get this working.
Just a side note if you want to tell the developer - every GUI process can attach the console window of the parent process in order to make it a console program, too. I find it a bad design if the tool is controlled via command line, but it doesn't report back to the command line interface. This makes automation rather obscure.
Steffen
Just a side note if you want to tell the developer - every GUI process can attach the console window of the parent process in order to make it a console program, too. I find it a bad design if the tool is controlled via command line, but it doesn't report back to the command line interface. This makes automation rather obscure.
Steffen
Re: start GUI program from non-interactive session
Already solve monitoring of started printing task:
As anything else do not acccess printer on this machine but my script, processing output of following command
to monitor printing task as next step in my script.
As anything else do not acccess printer on this machine but my script, processing output of following command
Code: Select all
powershell.exe "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"
Re: start GUI program from non-interactive session
Hey, This link doesnt seem to be working. Just wondering if its a problem on my end?lazna wrote: ↑12 May 2022 03:24Have set of batch scripts powered CGI based web system, web server running under SYSTEM account. As result of one script, physical document should be printed. Because of document layout, I choosed program https://github.com/kendallb/PrintHtml for printing, it starting fom console with parameters.
There is a problem the PrintHTML is not a console program as its author state: "Unfortunately this program is not a console program, as it needs access to Windows UI components in order to print."
Is it possible to start such program (only start with parameters, no need any response from it) from non-interactive session? Playing with PSEXEC option -i but have no luck. Also thinking about to create Schedule task and start it by "schtasks /run" but not tested yet.
System is running on W7/32bit with specific user autologon on startup.
Any ideas?
Re: start GUI program from non-interactive session
It's a peculiarity of this forum that external links are only accessible if you open them in a new tab or window.
Steffen
Steffen
Re: start GUI program from non-interactive session
Ah yes, it worked now. I'm not sure why that is though? Never seen anything like it before.