我要求打开某个文件扩展名,例如在本地网址中.mylog
并传递文件路径。
我的第一个实现是使用批处理文件:
test.bat的:
start "" http://localhost:3210/?myFile=%1
然后在一个文件中我设置使用test.bat打开,然后使用http://localhost:3210/?myFile=C:\currentFile.mylog
启动浏览器
我正在尝试使用注册表而没有中间步骤链接到批处理文件。
在注册表中(.mylog的打开命令)我可以设置:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" http://localhost:3210/?myFile=%1
这样可行,使用正确的网址启动Chrome。
问题是我无法将用户限制为Chrome,需要启动默认浏览器。
有没有办法在注册表中执行此操作,就像批量处理 start 命令一样?
答案 0 :(得分:0)
谢谢@DavidPostill
cmd /c start http://localhost:3210/?myFile=%1
正常工作,正是所需要的!