www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > JavaScript

    JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...)

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 11-20-2009, 01:28 PM
    Rubenvh Rubenvh is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 3
    Question Run program from JScript

    Hi all,

    I would like to open any program on a computer, using JScript.
    I have this little piece of code here...

    Code:
    function run(url) {
    var File = url;
    var WSH = new ActiveXObject("WScript.Shell");
    WSH.run(File, 1, true);
    }
    Example:

    HTML Code:
    <a href="#" name="cmd.exe" title="Cmd" onClick="run(this.name); return false;">open cmd</a>
    Opening a file like this works perfect.

    Now another example...

    HTML Code:
    <a href="#" name="C:\Program Files\Internet Explorer\iexplore.exe" title="Internet Explorer" onClick="run(this.name); return false;">Internet Explorer</a>

    This DOESN'T work... I think it's because of the spaces in the url... What should i do to make this work?

    Ruben
    Reply With Quote
      #2  
    Old 11-21-2009, 10:27 AM
    Rubenvh Rubenvh is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 3
    Problem solved, now another one...

    Problem solved... I used the MS-DOS 8-character name for the maps... Now it works great in Internet Explorer (8), but it doesn't work in Chrome or Firefox... Anyone knows how to get it to work?

    Thx,
    Ruben
    Reply With Quote
      #3  
    Old 11-21-2009, 02:50 PM
    criterion9 criterion9 is offline
    B.S. CIS
     
    Join Date: Jan 2009
    Posts: 1,355
    ActiveX Objects are IE only. You can try using plugins that the user would have to install for other browsers, or better yet there must be a better solution for the problem at hand. What is the problem this solution is trying to fix?
    Reply With Quote
      #4  
    Old 11-21-2009, 03:04 PM
    Rubenvh Rubenvh is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 3
    I know that ActiveXObjects are for IE only... But what could i use instead?
    Reply With Quote
      #5  
    Old 11-21-2009, 03:06 PM
    criterion9 criterion9 is offline
    B.S. CIS
     
    Join Date: Jan 2009
    Posts: 1,355
    I already told you. You would have to create plugins for each browser you wanted to use them in. Again, there is probably a better way to solve the problem at hand. What is this solution trying to fix?
    Reply With Quote
    Reply

    Bookmarks

    Tags
    javascript, jscript, program


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 09:46 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.