【问题标题】:open all html files in a directory in multiple browser types在多种浏览器类型中打开一个目录中的所有 html 文件
【发布时间】:2014-01-16 02:04:09
【问题描述】:

我正在尝试在所有浏览器中测试一个 html 文件。有没有办法使用命令行打开 Internet Explorer、Firefox、Chrome 等目录中的所有 .html 文件,以确保 html 文件在所有 Internet 浏览器中正常工作?

这是我创建 .bat 文件的尝试:

@echo off
set /p var= %%f
start "Internet Explorer" "C:\Program Files\Internet Explorer\IEXPLORE.EXE" %var%
start "Firefox" "C:\Program Files\Mozilla Firefox\firefox.exe" %var%
start "Chrome" "C:\Program Files (x86)\Google\Chrome\Application" %var%
exit

【问题讨论】:

    标签: batch-file cross-browser browser


    【解决方案1】:

    试试这个

    @echo off
    setlocal
    
    pushd "C:\pathtohtmlfiles"
    for %%a in (*.htm *.html) do (
     start "Internet Explorer" "C:\Program Files\Internet Explorer\IEXPLORE.EXE" "file://%CD%\%%a"
     start "Firefox" "C:\Program Files\Mozilla Firefox\firefox.exe" "%%a"
     start "Chrome" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "%%a"
    )
    popd
    

    使用 IE 10、Chrome 31.0.1650.63 和 FF 26.0 测试

    【讨论】:

    • 这很好用,但是 Google 在单独的选项卡中打开每个文件,而 IE 和 FireFox 在单独的窗口中打开每个文件。 IE 和 Firefox 有没有办法在不同的选项卡而不是窗口中打开文件(就像 Google 那样)?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-06-28
    • 2011-12-18
    • 1970-01-01
    • 2013-12-26
    • 1970-01-01
    • 2015-09-06
    • 1970-01-01
    相关资源
    最近更新 更多