Printing PDF files in WinServer 2008 from a non-interactive process (Windows service, scheduled task, etc.)

I am trying to write a non-interactive process that prints PDF files, and I need some advice on creating it on Windows Server 2008 (and Vista / 7).

Previously, we had a scheduled task (for which launch a user account was registered), which will print all PDF files inside the directory. (A separate process would move the PDF files to a directory.) At run time, it would start another process (either Adobe Reader or Foxit Reader) to print the PDF. Both Adobe Reader and Foxit Reader work in silent printing mode, so everything will be sent to the default printer for the user who was performing the scheduled task. No user interface was ever created, and all files printed without a hitch. This worked on server 2003.

This process no longer works on server 2008. I am not quite sure, but I believe that this is due to session isolation 0. I cannot prove it. However, I can say that the process is running as a scheduled task when it is set as "Run only when a user logs into the system" . Now that this works, it forces the user to log in and thus does not meet my requirements. (My first clue was in this previous question .)

I can’t determine how I can move on. Is there a way to fulfill my requirements?

A few notes:

Every solution I saw seems to use the credentials of a user logged in to the system. See the question I linked above - the specified solution seems to grab the token of the user's registered login and use it to run the program. (Look at the GetCurrentUserToken () procedure - the return value will be used later in the CreateProcessAsUser () API call.)

, , . , ProcMon, (Adobe Foxit) , . - . , 0 ? . ( , , , , 0.)

Windows , " ".

, , .

+5
1

Foxit Reader Acrobat-Reader. Foxit Reader GUI-less/ , Windows 2008 !

, ( ) session0 , printjob.

, . powershell script, pdf Foxit Reader.

0

All Articles