<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>How can I run another application or batch file from my Visual C# .NET code?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx</link><description>Posted by: Duncan Mackenzie , MSDN This post applies to Visual C# .NET 2002/2003 Suppose you want to run a command line application, open up another Windows program, or even bring up the default web browser or email program... how can you do this from</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: How can I run another application or batch file from my Visual C# .NET code?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#146823</link><pubDate>Wed, 02 Jun 2004 16:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:146823</guid><dc:creator>Ryan Farley</dc:creator><description>&amp;quot;you are much better off following the third example for URLs, as opposed to executing IE with the URL as an argument&amp;quot;&lt;br&gt;&lt;br&gt;I don't agree. While shelling the URL directly will cause it to launch in the default browser, it will also &amp;quot;take over&amp;quot; any already open browser window - instead of causing it to open a new one. I hate it when a URL is launched from an app as described in example 3 and it navigates me away from some already opened page I was reading in my browser.&lt;br&gt;&lt;br&gt;I am not saying you should force IE either. If you read the default browser from the registry (app associated with HTTP) and use that to open a URL on the command-line to it then you get the best of both worlds. I've outlined this here:&lt;br&gt;&lt;a target="_new" href="http://ryanfarley.com/blog/archive/2004/05/16/649.aspx"&gt;http://ryanfarley.com/blog/archive/2004/05/16/649.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;-Ryan</description></item><item><title>re: How can I run another application or batch file from my Visual C# .NET code?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#146861</link><pubDate>Wed, 02 Jun 2004 17:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:146861</guid><dc:creator>Duncan Mackenzie</dc:creator><description>Ryan, the behaviour you describe occurs because IE is set to &amp;quot;reuse open browser windows&amp;quot;, which is exactly what it does.&lt;br&gt;&lt;br&gt;If a user doesn't want IE to navigate away from a currently open page, they should change that setting inside IE (which I know you think is silly... but that is what that setting is for). Why would they want other applications to reuse, but not yours? Personally, I hate the reuse of browser windows... but I hate it no matter where I clicked on the URL... I don't care if it is from within SharpReader, Outlook, or the Run option on the Start menu... if reuse annoys me, it annoys me globally so I should turn off that setting.&lt;br&gt;&lt;br&gt;Shelling a process is a full-trust operation at the moment, so accessing the registry isn't really a security issue but I still do not suggest that method of launching a URL... you are essentially overriding the user's preferences which they can control through IE's settings.&lt;br&gt;&lt;br&gt;Even though we disagree, I did find your article to be quite well-written and I'm sure you aren't alone in wanting to get around these settings though. Having a link to your post/sample in these comments will be useful to folks reading this post. </description></item><item><title>re: How can I run another application or batch file from my Visual C# .NET code?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#146905</link><pubDate>Wed, 02 Jun 2004 18:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:146905</guid><dc:creator>Ryan Farley</dc:creator><description>Duncan, those are good points. I agree that typically if the setting is an annoyance at all then it is likely an annoyance globally so why would you not just turn it off? If it is just me, then fine - I do turn that setting off. But telling a system admin or IT team that this is what they have to do for all 2000+ users using your app doesn't always fly well. But, like you said - that is what the setting is for. It is just that complaining end-users do not always agree, so it is good to be able to code a way around it.&lt;br&gt;&lt;br&gt;Something I love about Outlook 2003 is that it will *always* launch a link in a new browser window - regardless of the setting to reuse windows in IE. I don't feel like Outlook is overriding my preferences, just making a good decision to responsibly open the link in a new window.&lt;br&gt;&lt;br&gt;Anyway, thanks for the post. This might seem like a simple topic, but I get asked this *every* time I am doing developer training. So it is good to have a post here I can refer them to.</description></item><item><title>RE: How can I run another application or batch file from my Visual C# .NET code?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#147176</link><pubDate>Thu, 03 Jun 2004 00:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:147176</guid><dc:creator>Shawn</dc:creator><description>Interesting bit of blog synergy here, I just posted an entry today about the new Whidbey features of the Process class that lets you start a new process under the context of a different user:  &lt;a target="_new" href="http://blogs.msdn.com/shawnfa/archive/2004/06/02/146915.aspx"&gt;http://blogs.msdn.com/shawnfa/archive/2004/06/02/146915.aspx&lt;/a&gt;</description></item><item><title>re: How can I run another application or batch file from my Visual C# .NET code?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#168873</link><pubDate>Tue, 29 Jun 2004 16:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:168873</guid><dc:creator>James Mc Kenzie</dc:creator><description>Under what user context does this application start under?, What permissions would it have?</description></item><item><title>re: How can I run another application or batch file from my Visual C# .NET code?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#168875</link><pubDate>Tue, 29 Jun 2004 16:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:168875</guid><dc:creator>Duncan Mackenzie</dc:creator><description>It runs under the same user context as the application that started it, so... in the case of a Windows Forms application it would be under the currently logged on user's context... in the case of an ASP.NET application it would be in the context of whatever user you are running your web pages under (yourcomputer\ASPNET)... etc...</description></item><item><title>re: How can I run another application or batch file from my Visual C# .NET code?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#173054</link><pubDate>Mon, 05 Jul 2004 07:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:173054</guid><dc:creator>Gur</dc:creator><description>Does anybody know hnow can i do the same thing but in pocket pc? there is dont have System.Diagnostic.Process&lt;br&gt;&lt;br&gt;Thanks</description></item><item><title>Comment puis-je ex</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#455011</link><pubDate>Tue, 23 Aug 2005 12:10:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:455011</guid><dc:creator>FAQ C# (par Yannick Lejeune)</dc:creator><description /></item><item><title>Because Its Possible.com  &amp;raquo; Blog Archives   &amp;raquo; links for 2007-03-10</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#1850596</link><pubDate>Sat, 10 Mar 2007 08:35:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1850596</guid><dc:creator>Because Its Possible.com  » Blog Archives   » links for 2007-03-10</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blog.becauseitspossible.com/2007/03/10/links-for-2007-03-10/"&gt;http://blog.becauseitspossible.com/2007/03/10/links-for-2007-03-10/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Web 2.0 - Social Media - Internet News - Blogging &amp;raquo; How can I run another application or batch file from my Visual C# &amp;#8230;</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#5965495</link><pubDate>Wed, 07 Nov 2007 20:53:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5965495</guid><dc:creator>Web 2.0 - Social Media - Internet News - Blogging » How can I run another application or batch file from my Visual C# …</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://hyiplive.org/how-can-i-run-another-application-or-batch-file-from-my-visual-c"&gt;http://hyiplive.org/how-can-i-run-another-application-or-batch-file-from-my-visual-c&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>KATALOG-STRON.AZ.PL - CIEKAWE INFORMACJE Z RÓŻNYCH STRON &amp;raquo; running a batch file from a command window launched from a c sharp program</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#8339979</link><pubDate>Thu, 27 Mar 2008 19:33:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8339979</guid><dc:creator>KATALOG-STRON.AZ.PL - CIEKAWE INFORMACJE Z RÓŻNYCH STRON » running a batch file from a command window launched from a c sharp program</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://katalog-stron.az.pl/?p=1325"&gt;http://katalog-stron.az.pl/?p=1325&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>esecuzione processi in background | hilpers</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#9337837</link><pubDate>Sun, 18 Jan 2009 15:50:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9337837</guid><dc:creator>esecuzione processi in background | hilpers</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.hilpers.it/2657457-esecuzione-processi-in-background"&gt;http://www.hilpers.it/2657457-esecuzione-processi-in-background&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Eseguire uno script in DOS | hilpers</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#9356518</link><pubDate>Wed, 21 Jan 2009 17:23:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9356518</guid><dc:creator>Eseguire uno script in DOS | hilpers</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.hilpers.it/2656120-eseguire-uno-script-in-dos"&gt;http://www.hilpers.it/2656120-eseguire-uno-script-in-dos&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> xvsb</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#9460285</link><pubDate>Thu, 05 Mar 2009 21:00:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9460285</guid><dc:creator> xvsb</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://xvsb.wordpress.com/2009/03/05/16/"&gt;http://xvsb.wordpress.com/2009/03/05/16/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> C Frequently Asked Questions How can I run another application or | debt consolidator</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#9755715</link><pubDate>Mon, 15 Jun 2009 23:38:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9755715</guid><dc:creator> C Frequently Asked Questions How can I run another application or | debt consolidator</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://mydebtconsolidator.info/story.php?id=19676"&gt;http://mydebtconsolidator.info/story.php?id=19676&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: How can I run another application or batch file from my Visual C# .NET code?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#9923276</link><pubDate>Tue, 17 Nov 2009 00:12:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9923276</guid><dc:creator>Matt Buchwald</dc:creator><description>&lt;p&gt;If you don't want to force your users to reuse/not reuse via a setting en IE, why not code the option into your application? That way if they want to reuse in IE, but have only your application not reuse, then they can dictate that.&lt;/p&gt;
</description></item><item><title>re: How can I run another application or batch file from my Visual C# .NET code?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#9929566</link><pubDate>Sat, 28 Nov 2009 03:57:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9929566</guid><dc:creator>khaled Y</dc:creator><description>&lt;p&gt;hi all thanx for this code it was helpful for me ,but i want something else ,iwant this process start into my app form can anybody help me &lt;/p&gt;
&lt;p&gt;for example i &amp;nbsp;dont wanna open excel separated on my form i wanna open excel into my form app into panal&lt;/p&gt;
</description></item><item><title>re: How can I run another application or batch file from my Visual C# .NET code?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx#9934969</link><pubDate>Thu, 10 Dec 2009 05:15:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9934969</guid><dc:creator>Rao</dc:creator><description>&lt;p&gt;Hi all, i want to launch an application-1 within a UI control of another application-2. Is there anyway i can do it?&lt;/p&gt;
</description></item></channel></rss>