Search code examples
batch-fileregistry

Registry command to open url with default browser for files with a specific extension


I have a request to open a certain file extension, e.g. .mylog in a local url and pass the file path.

My first implementation is using batch file:

test.bat:

start "" http://localhost:3210/?myFile=%1

Then on a file I set Open with test.bat which then launches browser with http://localhost:3210/?myFile=C:\currentFile.mylog

I am trying to do that with registry without the middle step to link to batch file.

In registry (open command for .mylog) I can set:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" http://localhost:3210/?myFile=%1

and this works, launches Chrome with correct url.

Problem is that I cannot limit users to Chrome, need to launch the default browser.

Is there a way to do this in registry like it is possible with start command in batch?


Solution

  • Thanks @DavidPostill

    cmd /c start http://localhost:3210/?myFile=%1
    

    works and is exactly what is needed!