1

Thanks in advance,

I want to launch my url in the new window of the legacy edge browser.

As of now, every time I launch the url, a new tab gets added to the existing window which I don't want.

Here is what I have tried:

Uri url = new Uri("https://www/google.com");
 Process.Start(new ProcessStartInfo
 {
    FileName = "microsoftedge.exe",
    Arguments = url.ToString() + "--new window",
    WindowStyle = ProcessWindowStyle.Normal
 });
DotNetSpartan
  • 931
  • 4
  • 20
  • 41
  • It might help https://stackoverflow.com/questions/39436895/open-url-in-new-microsoft-edge-window – bulbul bd Jan 19 '21 at 11:15
  • 2
    What if legacy edge isn't installed? – mjwills Jan 19 '21 at 11:18
  • 1
    Why are you trying to use the *legacy, unsupported Edge version*? What is the *actual* problem you want to solve, and why did you think that using an unsupported Edge version would be the solution? If you don't know how to open a site using Edge Chromium, [the answer is here](https://stackoverflow.com/questions/31164253/how-to-open-url-in-microsoft-edge-from-the-command-line), similar questions in `superuser.com`, `answers.microsoft.com` etc. You need to use a specific URI – Panagiotis Kanavos Jan 19 '21 at 11:21
  • @PanagiotisKanavos : Though I am using the new chromium edge, but in my legacy application some users still haven't moved to the new edge. – DotNetSpartan Jan 19 '21 at 11:22
  • @MishraSaurabh they have, no matter what they claim. Because legacy Edge isn't supported. The Windows 10 versions that came with it aren't supported. Windows 10 doesn't allow people to delay upgrades indefinitely. So at best, they do have the supported Edge version but prefer to use the unsupported one – Panagiotis Kanavos Jan 19 '21 at 11:24
  • In any case, have you checked the actual command-line parameters? Is there a `--new` parameter with a `window` value or were you just guessing? Have you tried to actually execute that in a Console? This question has little if anything to do with C# or .NET – Panagiotis Kanavos Jan 19 '21 at 11:26

2 Answers2

1

Use the switch at first and only then the url:

"--new-window" + url.ToString(),
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Alex
  • 26
  • 2
0

In order to make this work I had to use "msedge" instead, and put a space after "--new-window":

Uri url = new Uri("https://www/google.com");
 Process.Start(new ProcessStartInfo
 {
    FileName = "msedge",
    Arguments = "--new-window " + url.ToString(),
    WindowStyle = ProcessWindowStyle.Normal
 });
Brain2000
  • 4,655
  • 2
  • 27
  • 35