Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Execute a deep link in Windows

I’m working in an application that uses deeplinks to redirect actions from the user in a website into the app.

In macOS, I can test if the deeplink is working by simply executing in the terminal open "[deeplink]", for instance, open "my_app_name:import_file=454d1618-fb9b-45ea-b4c3-f32e6200cce4". This redirects me to my app and does (or don’t) the apropiate action so I can later check the logs, etc.

So, how can I do the same in Windows? How can one "launch" a deep link in Windows? (sorry for my vocabulary, pretty sure it’s not correct)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Any method will be appreciated 🙂

>Solution :

In Windows, you can use a variety of methods to launch a deep link (also known as a URI scheme) to test your application. Here are a few methods:

Method 1: Using Command Prompt or PowerShell

You can use the start command in Command Prompt or PowerShell to launch a URI scheme. For example:

start my_app_name:import_file=454d1618-fb9b-45ea-b4c3-f32e6200cce4

Or in PowerShell:

Start-Process "my_app_name:import_file=454d1618-fb9b-45ea-b4c3-f32e6200cce4"

Method 2: Using Run Dialog

  1. Press Win + R to open the Run dialog.

  2. Type your deep link into the dialog box and press Enter. For example:

    my_app_name:import_file=454d1618-fb9b-45ea-b4c3-f32e6200cce4
    

Method 3: Using a Web Browser

You can also create a simple HTML file with a hyperlink using the URI scheme and open it with a web browser. For example, create an HTML file with the following content:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Deep Link Test</title>
</head>
<body>
    <a href="my_app_name:import_file=454d1618-fb9b-45ea-b4c3-f32e6200cce4">Launch App</a>
</body>
</html>

Open this HTML file in a web browser and click the link to launch the deep link.

And finally – Method 4: Using a Shortcut

  1. Right-click on the desktop and choose New > Shortcut.

  2. In the location field, type the deep link and click Next.

    my_app_name:import_file=454d1618-fb9b-45ea-b4c3-f32e6200cce4
    
  3. Give the shortcut a name and click Finish.

  4. Double-click the shortcut to launch the deep link.

Please make sure that your application is registered to handle the custom URI scheme (my_app_name in this case) on Windows. If it’s not registered, Windows won’t know how to handle the URI scheme and won’t launch your app. You can register a URI scheme by modifying the Windows Registry, which typically happens during the installation of your app.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading