[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1083
  • Last Modified:

using javascript to run command line commands

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
jlm661
Asked:
jlm661
  • 2
1 Solution
 
devicCommented:
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
 
jlm661Author Commented:
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
 
devicCommented:
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now