There is really no good way to invoke external code on the client. If you can solve it server-side, then you should go for this solution.
You can however refer to the file as
file:// instead of http:// but there are some security issues with launching a bat file. In best case, you will get a security warning and the possibility to save the file to disk, but I don't think you will be able to run it directly (without saving it
to the client first).
If this post was useful to you, please mark it as answer. Thank you!
This being an intranet site, as long as the clients do not have to enable scripts etc, I am fine with it. I do not want to put up detailed instructions: " enable activeX to run this file and make sure that you disable it after this program runs ". Basically
my .bat file calls an msi with relevant switches.
If you are on an intranet and you have some control over the local IT, then you might get approval for changing a group policy which makes IE "trust" your site. So the user never have to worry about this. But if all users have their own settings, then the
behaviour can be unpredictable among the clients. I suggest you try and see what results you get.
If you need to run an MSI, then isn't it something that you can distribute with Microsoft SMS?
If this post was useful to you, please mark it as answer. Thank you!
The msi is a licenced software, if the department has paid for it, the dept users can download it. I have a web form where users are validated. The problem with http://... link is, this does not run on firefox/netscape. If users click on the link, firefox
and netscape opens the bat file as plain text. I'll have the user use IE only to install it. I will check out the Microsoft SMS
What if you wrap the .bat file and msi in an self-executable zip file? I know winzip can create those. Or you could even build a small msi-wrapper for the two files. In any way, you need to come out with an exe that can be downloaded to the client. The exe
will extract bat file and msi and then start the bat file. I think it could work!
If this post was useful to you, please mark it as answer. Thank you!
raghu1
Contributor
2004 Points
558 Posts
Launch .bat file from client
Aug 06, 2007 04:54 PM|LINK
This is on our intranet site. I need to launch a .bat file on client upon click of a hyerlink. Which is the best way to don this?
I have asp.net 1.1 on windows server 2003.
thanks,
-raghu
johram
All-Star
28531 Points
3567 Posts
Re: Launch .bat file from client
Aug 06, 2007 09:01 PM|LINK
There is really no good way to invoke external code on the client. If you can solve it server-side, then you should go for this solution.
You can however refer to the file as file:// instead of http:// but there are some security issues with launching a bat file. In best case, you will get a security warning and the possibility to save the file to disk, but I don't think you will be able to run it directly (without saving it to the client first).
raghu1
Contributor
2004 Points
558 Posts
Re: Launch .bat file from client
Aug 07, 2007 12:53 PM|LINK
This being an intranet site, as long as the clients do not have to enable scripts etc, I am fine with it. I do not want to put up detailed instructions: " enable activeX to run this file and make sure that you disable it after this program runs ". Basically my .bat file calls an msi with relevant switches.
-raghu
johram
All-Star
28531 Points
3567 Posts
Re: Launch .bat file from client
Aug 07, 2007 01:32 PM|LINK
If you are on an intranet and you have some control over the local IT, then you might get approval for changing a group policy which makes IE "trust" your site. So the user never have to worry about this. But if all users have their own settings, then the behaviour can be unpredictable among the clients. I suggest you try and see what results you get.
If you need to run an MSI, then isn't it something that you can distribute with Microsoft SMS?
raghu1
Contributor
2004 Points
558 Posts
Re: Launch .bat file from client
Aug 07, 2007 01:44 PM|LINK
The msi is a licenced software, if the department has paid for it, the dept users can download it. I have a web form where users are validated. The problem with http://... link is, this does not run on firefox/netscape. If users click on the link, firefox and netscape opens the bat file as plain text. I'll have the user use IE only to install it. I will check out the Microsoft SMS
-raghu
johram
All-Star
28531 Points
3567 Posts
Re: Launch .bat file from client
Aug 10, 2007 10:50 AM|LINK
What if you wrap the .bat file and msi in an self-executable zip file? I know winzip can create those. Or you could even build a small msi-wrapper for the two files. In any way, you need to come out with an exe that can be downloaded to the client. The exe will extract bat file and msi and then start the bat file. I think it could work!