Solved

using javascript to run command line commands

Posted on 2004-04-09
3
1,074 Views
Last Modified: 2012-06-27
hi, i have a series of perl forms which collect data from a user and then run's a program. once the program is finished i would like to run a open the command line and run pro/engineer on the client's machine. i have done this using visual basic script but i have used javascript for other constraints on my forms so i thought i would try to stick with that. so i guess my question is what is the javascript equivalent of the wshShell command in vbs. and how can i have javascript run pro/e AFTER my first program is complete.

any help will be greatly appreciated!

thanks all!
0
Comment
Question by:jlm661
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 25

Expert Comment

by:devic
ID: 10793666
hi jlm661.

look here:
================
JS example:
<script>
   var ws = new ActiveXObject("WScript.Shell");
   ws.Exec("c:\\Windows\\Notepad.exe")
</script>


VBS example:

<script language="VBScript">
    Set shell = CreateObject("WScript.Shell")
      shell.Run("c:\WINDOWS\Notepad.exe")
</script>
0
 

Author Comment

by:jlm661
ID: 10793720
now does this script have to be inserted in the <head></head> of my page....if so how do i tell it to run those commands AFTER my other code??? thanks for the really quick reply :)
0
 
LVL 25

Accepted Solution

by:
devic earned 500 total points
ID: 10793763
write a function, and call it as you need.
=================================
<script>
function runit()
{
      var ws = new ActiveXObject("WScript.Shell");
      ws.Exec("c:\\Windows\\Notepad.exe");
}
</script>
...............

<script>
runit();
</script>

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Open dialog with server side controls in it 3 46
JQuery conflicts/syntax issue 4 23
Duplicate Elements with JS / jQuery 3 24
Put POST values into cookies. 14 30
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question