Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

Start windows application via WScript.Shell JScript

Hello Experts!

I have a problem with launching an application from JScript. The software that I'm launching depends on certain libraries that are located in a folder where the program resides. Let's say that I've installed my program to C:\Program Files\MyProgram
If I were to do: Start | Run | "C:\Program Files\MyProgram\MyProgram", my app would crash since it cannot load libraries that are found in C:\Program Files\MyProgram.

Unfortunately, changing application's code to dynamically find it's startup path is out of the question.

Could you please help me start my application via WScript.Shell?

Here's what I have so far:
var wsShell = Sys.OleObject("WScript.Shell");
wsShell.Run('"C:\\Program Files\\MyApp\\MyApp.exe"');

Thanks.
0
dimaj
Asked:
dimaj
1 Solution
 
Aaron TomoskyTechnology ConsultantCommented:
0
 
dimajAuthor Commented:
Thank you VERY MUCH!!!

I've been looking for a solution to this for couple of hours now!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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