<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Faraz Shah Khan : open</title><link>http://weblogs.asp.net/farazshahkhan/archive/tags/open/default.aspx</link><description>Tags: open</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Javascript to open application on client's machine</title><link>http://weblogs.asp.net/farazshahkhan/archive/2008/01/27/javascript-to-open-application-on-client-s-machine.aspx</link><pubDate>Sun, 27 Jan 2008 19:32:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5660796</guid><dc:creator>farazsk11</dc:creator><author>farazsk11</author><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/farazshahkhan/rsscomments.aspx?PostID=5660796</wfw:commentRss><comments>http://weblogs.asp.net/farazshahkhan/archive/2008/01/27/javascript-to-open-application-on-client-s-machine.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;Long time back I was wondering if some how I will be able to open any application through my website on client's machine. Finally I came to know that yes it is possible and I will end up with this code.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Following code will open up notepad on client's machine. Before opening the file it will prompt the user, if the user accepts then it will opened. As of now it worked on windows with explorer only.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Palatino Linotype" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Palatino Linotype'"&gt;&amp;lt;script&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;BR&gt;&lt;FONT face="Palatino Linotype" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Palatino Linotype'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function go() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Palatino Linotype" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Palatino Linotype'"&gt;w = new ActiveXObject("WScript.Shell");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Palatino Linotype" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Palatino Linotype'"&gt;w.run('notepad.exe');&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Palatino Linotype" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Palatino Linotype'"&gt;return true;&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Palatino Linotype" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Palatino Linotype'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;BR&gt;&lt;FONT face="Palatino Linotype" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Palatino Linotype'"&gt;&amp;lt;/script&amp;gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&amp;lt;form&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT face="Palatino Linotype" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Palatino Linotype'"&gt;Run Notepad (Window with explorer only)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Palatino Linotype" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Palatino Linotype'"&gt;&amp;lt;input type="button" value="Go"&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Palatino Linotype" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Palatino Linotype'"&gt;onClick="return go()"&amp;gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Palatino Linotype" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Palatino Linotype'"&gt;&amp;lt;/form&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5660796" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/farazshahkhan/archive/tags/javascript/default.aspx">javascript</category><category domain="http://weblogs.asp.net/farazshahkhan/archive/tags/client+machine/default.aspx">client machine</category><category domain="http://weblogs.asp.net/farazshahkhan/archive/tags/executable/default.aspx">executable</category><category domain="http://weblogs.asp.net/farazshahkhan/archive/tags/notepad/default.aspx">notepad</category><category domain="http://weblogs.asp.net/farazshahkhan/archive/tags/application/default.aspx">application</category><category domain="http://weblogs.asp.net/farazshahkhan/archive/tags/open/default.aspx">open</category></item></channel></rss>