Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Open External Files Using UNC Path via a Button Using JScript

Posted on 2011-09-21
2
Medium Priority
?
341 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
[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
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

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…
Read on to get a few ideas on how to promote your next corporate event.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

721 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