0

How to if I want to write an application that launches Firefox with arguments ?

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; namespace Launcher { public static class Program { public static void Main(string[] args) { Process.Start("C:/Program Files/Mozilla Firefox/firefox.exe");//this is ok Process.Start("C:/Program Files/Mozilla Firefox/firefox.exe -P MyProfile -no-remote");// this doesn't work } } } 

2 Answers 2

6

You will need to specify the process.StartInfo.Arguments

See this question: Calling an application from ASP.NET MVC

Sign up to request clarification or add additional context in comments.

Comments

0

You will need to use the process.StartInfo.Arguments, as shown here:

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; namespace Launcher { public static class Program { public static void Main(string[] args) { Process firefox = new Process(); firefox.StartInfo.FileName = @"C:\Program Files\Mozilla Firefox\firefox.exe"; firefox.StartInfo.Arguments = "-P MyProfile -no-remote"; firefox.Start(); } } } 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.