- 1 year ago
Opening local (file) URL with parameters in batch file?
Comment
1 / 1
To open a local file URL with parameters in a batch file, you can use the start
command followed by the URL. Here's an example:
batch@echo off
setlocal
set fileUrl=file:///C:/path/to/file.html?param1=value1¶m2=value2
start "" "%fileUrl%"
endlocal
In this example, fileUrl
is set to the local file URL with parameters. The start
command is then used to open the URL in the default browser. Make sure to enclose the URL in double quotes and use the ""
argument after start
to specify an empty window title.
Replace C:/path/to/file.html
with the actual path to your file, and param1=value1¶m2=value2
with your desired parameter values.
Save the batch file with a .bat
extension and run it to open the local file URL with parameters in the default browser.