Calling Acrobat file from WScript.Shell ActiveX object

Ask a Question related to Adobe Acrobat Windows, Design and Development.

  1. #1

    Default Calling Acrobat file from WScript.Shell ActiveX object

    WinXP, Acrobat 6

    When I type the name of a PDF file at the Windows command prompt, the file opens properly. Then I create the following JavaScript script:

    var WshShell = new ActiveXObject( "WScript.Shell" );
    WshShell.Run( WScript.Arguments( 0 ) );

    When I run this script and pass it the PDF filename (e.g., "scriptname foo.pdf"), nothing happens. Theoretically, this script should do nothing more than pass my arguments to the command line, but still nothing happens. This works fine on Acrobat 5, but doesn't work on Acrobat 6.

    After much investigating, I have determined what's causing this problem. There's a registry entry in HKEY_CLASSES_ROOT\AcroExch.Document\shell\Open\com mand. The "default" registry entry points to my Acrobat installation, and this entry exists for both Acrobat 5 and 6. But with Acrobat 6, there's an additional entry:
    command
    REG_MULTI_SZ
    34TL`lX!!!bQ'!!$,CC!ViewerProgramFiles>8$FU!6LT@Ax uDd[[]r{7 "%1"

    I don't know what this entry is for, but when I delete it, then my script works fine. So apparently the call in the script is trying to use this (multibyte?) command, instead of the "default" command.

    So deleting the entry is a manual workaround for this bug. But that's not a good general solution.

    So can anyone suggest a way to get this script to work without having to delete the registry entry? Also, what does that registry entry do? And are there side-effects of deleting it?
    Russ_Seligman@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. WScript.Shell is not working after windows update
      Group: I am using a method "Run" of the control "WScript.Shell" to execute a third party tool which converts TIFF to PDF. This was working fine...
    2. Q: ActivePerl - calling an ActiveX object
      I have a 3rd-party ActiveX object (as a DLL) that I am trying to call from Perl (ActivePerl 5.8) The function that I am calling takes three 'in'...
    3. WScript.Shell to execute Ms-DOS commands?
      Good morning everybody, How can I use WScript.Shell to execute Ms-DOS commands and can I see the outputs commands in the asp page? In the...
    4. WScript.Shell
      It's most likely some sort of a permissions issue. The file is created and written to okay? What are you running in the batch file? Are you...
    5. Error:: Activex componet can not create object:"WScript.Shell"
      I am trying to use the shell object to send keys to the explorer browser to run the send page funcion. I am receiving the above error only when I...
  3. #2

    Default Re: Calling Acrobat file from WScript.Shell ActiveX object

    Interesting. I see this set in a lot of places (e.g. Word documents).
    I've found several questions but only one answer on the web: that it
    is private data used by Windows Installer for "advertisment of file
    types", whatever that means.

    All I can think of is that if you are changing the executable manually
    in the registry, you may be breaking the secret cross references in
    the command subkey.

    Aandi Inston
    Aandi_Inston@adobeforums.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139