How to open weburl using Powershell and Command line?

👤 Diwas Poudel    🕒 18 Mar 2023    📁 TECH

You can open a web URL in a web browser right away by pasting the URL string into the address bar and pressing Enter, but if you want to know how to access a web URL in a command line, batch file, or PowerShell script, you've come to the right place.

Today, ourtechroom will show you how to use Powershell and Command to open a URL in a browser.

Note: Make sure that the command is safe to run before using Invoke-Expression or Start Command.


Windows provides sophisticated command-line tools. Command prompt and PowerShell are two of the most powerful tools available. Let's look at each of them. 

Start Command in Windows Command Prompt

Command Prompt's Start Command is one of the most frequently used internal commands, and it is supported by all versions of Windows. Its primary function is to Open a file, app, URL etc.

It can be used in a batch file or on the command line.

Basic Syntax

START weburl

Start Command is case insensitive. So, start and START are the same things.

For Example:


This will open ourtechroom site in your default browser.

But following a web URL without HTTP, HTTPS, FTP, or www, does not work.



This does not work. Because in this case, Windows will treat as a folder and will not find the folder on that path and will give an error stating: Windows cannot find ''.Make sure you typed the name correctly, and then try again.

So, note that it should begin with PROTOCAL:/ or www on the URL.So, that Command line will know the user is attempting to open the command line.

If you want to open Url in Chrome then type:

start chrome

If you want to open URL in Firefox then type:

start firefox

If you want to open Url in Microsoft Edge then type:

start msedge


start microsoft-edge:

If you want to run the "Start" command outside command, you have to do it like this.

Basic Syntax:

cmd /c start url


cmd /c start


Microsoft's Powershell is a strong tool for automating tasks and managing configurations. In Powershell, there are a number of ways to open a URL in a browser, some of which are outlined here.

1 Using Start-Process Command

A new process is created when you call Start-Process, which inherits the current process's Environment Variables.You can use start-process command in both PowerShell and PowerShell script (ps) files.

Basic Syntax:

Start-Process WebUrl 

If you do not specify anything then by default it will open with the default browser.


Start-Process ''

This will open the website in new Windows. As I have set Chrome as the default browser so by default it will open the site in Google Chrome.

Start-Process Open in Internet Explorer 

Start-Process -FilePath 'iexplore.exe' -ArgumentList ''

Start-Process Open in Chrome Browser

Start-Process chrome ""

Start-Process Open in Firefox 

Start-Process -FilePath firefox -ArgumentList

Start-Process Open in Edge 

Start-Process -FilePath msedge -ArgumentList

Alias Using Shorter Powershell

Start chrome '--start-fullscreen ""'

Using Invoke-Expression command in PowerShell

According to Windows "The Invoke-Expression cmdlet evaluates or runs a specified string as a command and returns the results of the expression or command. Without Invoke-Expression, a string submitted at the command line is returned (echoed) unchanged".

ie. Invoke-Expression will take the string and then execute that string. The string can be anything that can be executable by Invoke-Expression.


Invoke-Expression “cmd.exe /C start”


'cmd.exe /C start' |Invoke-Expression

Open Multiple URLs using Powershell

You can open multiple URLs with one PowerShell command as shown below:

 'cmd.exe /C start','cmd.exe /C start'|Invoke-Expression

Here we are opening StackOverflow and ourtechroom sites in two different tabs in the browser.


$url1 = ''
$url2 = ''
try {
  Start-Process  $url1
  Start-Process  $url2
catch {
 Write-Host "Oops, something went wrong!"

Alternative 2:

$urls = @("","")

foreach($url in $urls){
    Start-Process $url

Alternative 3:

Start-Process -FilePath Chrome -ArgumentList '--new-window'

Powershell For IE:

Opening multiple URL in IE using Powershell command as shown below:

$navOpenInBackgroundTab = 0x1000;
$ie = new-object -com InternetExplorer.Application
$ie.Navigate2("", $navOpenInBackgroundTab);
$ie.Visible = $true;

What’s the difference between Invoke-Expression and Start-Process?

The start-Process cmdlet returns the results of the process that was run, and you can use it to interpret the results after that. Invoke-Expression is a quick and dirty process that does not return an object as a result of the executed process.

macOS X

You can use the open command to open the URL in MacOS.


open filename_or_url 




In Linux and Unix, you have to install the xdg-open commands installed. After you have installed you can go and run the following command in the terminal.

Basic Syntax:

xdg-open filename_or_URL


xdg-open ''

How do I use the command line to access a website's URL in a new tab within an existing browser window that is already open?

To access the URL in a new tab, you can use the "start" command with the "http://" or "https://" prefix and the URL as an argument. In addition, you can use the "/newtab" or "-new-tab" switch. For instance, to open the URL "" in a new tab of an already open window of Google Chrome, you can execute the command "start chrome.exe /newtab" by entering it into a command prompt. This will accomplish the desired result.


start chrome.exe /newtab

How do I open a web URL in a new tab of an already open browser window using PowerShell?

You can use the Start-Process cmdlet in conjunction with the "-ArgumentList" parameter to send the URL to the browser process that is already operating. This will cause the URL to be passed along as an argument. For instance, if you want to open the URL "" in a new tab of an already open window of Google Chrome, you can do so by executing the instruction "Start-Process chrome.exe -ArgumentList '--new-tab'." This will cause the URL to be opened in the new tab.


Start-Process chrome.exe -ArgumentList '--new-tab