Skip navigation
Currently Being Moderated

Scripted button to retrieve & display local system information

Jul 26, 2012 4:11 PM

Just wondering...has anyone ever programmed a button to retrieve and display local PC info such as:

 

Computer Make/Model

Serial number

OS

Computer Name

Amount of installed memory

Build Date

Video card type

Current User logged into system

Local Administrators

Installed printers

Default printer

HD drive mappings

ODBC Drivers

 

I have scripts that were written in Visual basic but need a comparable Javascript solution for Designer

 

Please advise - thank you in advance.

 
Replies
  • Currently Being Moderated
    Jul 26, 2012 10:10 PM   in reply to SI_MSD7

    Hi,

     

    you cannot retrieve those information with Acrobat's JavaScript except the printer names und the user name.

     

    var l = app.printerNames.length
    for ( var i = 0; i < l; i++)
    console.println("(" + (i+1) + ") " + app.printerNames[i]);
    

     

    The user name requires an folder level script as this property need a trusted enviroment be be read.

     

    var UserName = app.trustedFunction(function(doc) 
              {         
                 app.beginPriv();
      
          var User = this.xfa.form.Form1.Page1.UserNameField1;
          User.rawValue = this.identity.loginName;
      
                 app.endPriv(); 
              });
    
     
    |
    Mark as:
  • Currently Being Moderated
    Jul 26, 2012 10:29 PM   in reply to SI_MSD7

    Hi,

     

    I am not sure if you will be able to access all of the information, but accessing information like the current user would be considered a security concern.

     

    You could need a trusted function, which is script in a JavaScript file that is placed in the Acrobat folder of EVERY computer accessing the form.

     

    You can do a search for trusted function on the forums, but here are a few:

     

    http://forums.adobe.com/message/2189021#2189021

     

    http://forums.adobe.com/message/2366415#2366415

     

    http://forums.adobe.com/message/2326803#2326803

     

    Hope that helps,

     

    Niall

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points