是否可以在带有参数的Web浏览器中打开本地HTML文件。以下是我的脚本:
SETLOCAL ENABLEDELAYEDEXPANSION
:: Set the First Parameter - image directory - to a local variable for processing
SET imageDir=%1
:: Remove the double quotes from the image directory
SET imageDir=%~1
:: Replace any spaces with %20
set imageDir=!imageDir: =%%20!
:: Append image directory to the URL and launch
START file:///C:/Folder/demo.html?param=!imageDir!
当前打开的文件没有" param"。
非常感谢
答案 0 :(得分:1)
这是我能想到的最好的:
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
SET imageDir=%1
SET imageDir=%~1
set imageDir=!imageDir: =%%20!
echo/^<meta http-equiv="refresh" content="0; url=file:///C:/Folder/demo.html\?param=!imagedir!" /^>>_temp.html
_temp.html&del _temp.html