Solved

Start windows application via WScript.Shell JScript

Posted on 2011-02-15
2
1,084 Views
Last Modified: 2012-05-11
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
Comment
Question by:dimaj
[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 Comments
 
LVL 39

Accepted Solution

by:
Aaron Tomosky earned 500 total points
ID: 34903271
0
 
LVL 7

Author Comment

by:dimaj
ID: 34903368
Thank you VERY MUCH!!!

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

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

739 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