0 Replies Latest reply on Jun 6, 2009 4:36 AM by gerald_b

    command line printing - AdobeReader left open

    gerald_b

      Hello everyone,

       

       

      I've a problem by printing pdfs using the command line. My VB-script contains a code line like following (including the quotation marks for document and printer):

       

      process=myShell.Exec("c:\Program Files\Adobe\Reader\Reader 8.0\AcroRd32.exe /t "c:\test.pdf" "myprintersname")

      (print test.pdf on myprintersname)

       

       

      This command runs nearly perfect; after printing the AdobeReader-window left open. I tried to use an Application.Activate(process.ProcessID) followed by SendKeys("%{F4}") to close the front window. My AdobeReader-window won't come to foreground and so the active window (e.g. firefox) gets the ALT-F4-shortcut and asks for closing.

       

       

      Is there another command line parameter or solution available to close the named pdf-document AND AdobeReader after printing the document?

       

       

       

      Thanks for help

       

      gerald

       

       

      UPDATE: I've found a solution for this problem. After executing the command line (process=myShell.Exec.......) there's a "script sleeping time" needed, e.g. WScript.Sleep 10000 (wait 10 sec) followed by the command "process.Terminate". Then AdobeReader will be terminated and script goes on...