Solved

Open External Files Using UNC Path via a Button Using JScript

Posted on 2011-09-21
2
333 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Scenario: Your operations manager has discovered an anomaly in your security system. The business will start to suffer within 15 minutes if it is a major IT incident. What should she do? We have 6 recommendations for managing major incidents (https:…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

932 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now