Solved

Start windows application via WScript.Shell JScript

Posted on 2011-02-15
2
1,070 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
2 Comments
 
LVL 38

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
This is about my first experience with programming Arduino.
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

773 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