Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Open External Files Using UNC Path via a Button Using JScript

Posted on 2011-09-21
2
Medium Priority
?
346 Views
Last Modified: 2012-08-13
Hello Experts,

Without getting into too much detail I need to use JScript to open some .xls & .mdb files via buttons within an InfoPath 2003 form.  I know how to accomplish this using vbs but obviously I can't do that now.  Aside from suggesting using a link; does anyone know how to accomplish this with js?

Thanks
0
Comment
Question by:ShadowIT
  • 2
2 Comments
 

Accepted Solution

by:
ShadowIT earned 0 total points
ID: 36587281
I figured this out myself, here's the code in case anyone else needs it.  It works for both UNC paths and URLs (be sure to add extra "\'):

}

p.s. for UNC path {
var Act = new ActiveXObject("Wscript.Shell");
 var File = ("\\\\Your\\file\\here");  
  try {Act.Run("\""+File+"\"",1,false);}
  catch(e){ Act.Popup("" +'\n'+ File, 0,"", 0 + 0 + 0);}
}
0
 

Author Closing Comment

by:ShadowIT
ID: 36587284
I answered the quesiton myself, please refund my points.
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.

Question has a verified solution.

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

Before you can digitally sign infopath forms, you must have a digital certificate. Microsoft Certificate Services will need to be enabled on a Windows Server 2008 to facilitate the creation and verification of the digital certifciates on the web ser…
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
Integration Management Part 2
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

885 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