how can you be sure that the file is there on the client? Besides more and more browsers are hammered down for security reasons to prevent such scenarios. What is your intent in the first place as perhaps there's a way better alternative.
Grz, Kris.
Read my blog | Twitter Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
Mohammad Muj...
Member
2 Points
7 Posts
Calling a client side .vbs file from .aspx html button
Dec 25, 2012 11:12 AM|LINK
Dear Members,
I am having a Test.vbs file, exist on each client machine at C:/Test.vbs
I am trying to call Test.vbs file from a .aspx page by a html button as follows
My objective is to call C:/Test.vbs file of client machine from web appication.Using below code for ref.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <script language="vbscript"> Function RunScript() Set objWSH = CreateObject("WScript.Shell") strCMD ="cscript.exe C:\Test.vbs" objWSH.Run(strCMD) End Function </ script> <body> <form id="form1" runat="server"> <div> <input type="button" onclick="vbscript:RunScript"> </div> </form> </body> </html>XIII
All-Star
182674 Points
23445 Posts
ASPInsiders
Moderator
MVP
Re: Calling a client side .vbs file from .aspx html button
Dec 25, 2012 05:08 PM|LINK
Hi,
how can you be sure that the file is there on the client? Besides more and more browsers are hammered down for security reasons to prevent such scenarios. What is your intent in the first place as perhaps there's a way better alternative.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
raju dasa
Star
14320 Points
2440 Posts
Re: Calling a client side .vbs file from .aspx html button
Dec 26, 2012 05:15 AM|LINK
Hi,
Try to use ActiveX control, check this site:
http://www.codeproject.com/Articles/404688/Word-Excel-ActiveX-Controls-in-ASP-NET
rajudasa.blogspot.com || blog@opera
Mohammad Muj...
Member
2 Points
7 Posts
Re: Calling a client side .vbs file from .aspx html button
Dec 26, 2012 09:40 AM|LINK
HI,
It is mandatory that the .VBS file should be present on client machine at C:\Test.vbs
Please look into this on urgent basis.
Reg,
Mujtaba
roopeshreddy
All-Star
20119 Points
3320 Posts
Re: Calling a client side .vbs file from .aspx html button
Dec 26, 2012 04:12 PM|LINK
Hi,
What if, .vbs file is not present in the client machine?
Moreover, ActiveX works only on IE and are you sure that your customers user only IE to browser web?
Roopesh Reddy C
Roopesh's Space
Mohammad Muj...
Member
2 Points
7 Posts
Re: Calling a client side .vbs file from .aspx html button
Dec 31, 2012 05:41 AM|LINK
Brother,
It is 100% mandatory to have .vbs file on user syste.
Kindly provide the solution if you have.
Br,
Mujtaba