Поиск в Поддержке

Избегайте мошенников, выдающих себя за службу поддержки. Мы никогда не попросим вас позвонить, отправить текстовое сообщение или поделиться личной информацией. Сообщайте о подозрительной активности, используя функцию «Пожаловаться».

Learn More

How can I start Firefox with an html file passed parameter

  • 6 ответов
  • 1 имеет эту проблему
  • 420 просмотров
  • Последний ответ от dave-o

more options

I want to start Firefox from Windows(7), passing it a local html file name as a parameter to use that html page for the startup page. There is no Help or documentation on startup parameters (a major oversight or program shortfall)

I want to start Firefox from Windows(7), passing it a local html file name as a parameter to use that html page for the startup page. There is no Help or documentation on startup parameters (a major oversight or program shortfall)

Выбранное решение

This should work in a .cmd or .bat file.

start "" "C:\Program Files (x86)\Mozilla Firefox\Firefox.exe" "C:\Users\DES\Documents\MSData\HTML\GPD.shtml"
Прочитайте этот ответ в контексте 👍 0

Все ответы (6)

more options
more options

Thanks for the link, but... I tried the following from within a .bat file: start /wait cmd /C "C:\Program Files (x86)\Mozilla Firefox\Firefox.exe" -browser -url "file:///C:/Users/DES/Documents/MSData/HTML/GPD.shtml"

I also tried just: start /wait cmd /C "C:\Program Files (x86)\Mozilla Firefox\Firefox.exe" -url "file:///C:/Users/DES/Documents/MSData/HTML/GPD.shtml"

In neither case did Firefox start, at all. Without "any" parameters, it will start up just fine, but I want to start up with the page that I am passing it.

As an FYI my initial attempt was: start /wait cmd /C "C:\Program Files (x86)\Mozilla Firefox\Firefox.exe" "file:///C:/Users/DES/Documents/MSData/HTML/GPD.shtml"

Изменено dave-o

more options

Sorry, I am fuzzy when it comes to batch files in Windows, but for the Firefox part of it try this.

"C:\Program Files (x86)\Mozilla Firefox\Firefox.exe" -browser "file://///C:/Users/DES/Documents/MSData/HTML/GPD.shtml"

or

"C:\Program Files (x86)\Mozilla Firefox\Firefox.exe" -browser -url "file://///C:/Users/DES/Documents/MSData/HTML/GPD.shtml"

more options

When I change the .bat file to "C:\Program Files (x86)\Mozilla Firefox\Firefox.exe" -browser -url "file:///C:/Users/DES/Documents/MSData/HTML/GPD.shtml" (with only 3 leading slashes) it works. I really want to preface the program name with the Windows command: start /wait cmd /C , which starts the program and waits for its completion before processing further commands in the .bat file. The Help on that DOS command states that parameters can follow the program/command name without any "switches".

more options

Выбранное решение

This should work in a .cmd or .bat file.

start "" "C:\Program Files (x86)\Mozilla Firefox\Firefox.exe" "C:\Users\DES\Documents\MSData\HTML\GPD.shtml"
more options

Thanks! I don't know where I came up with the /C switch. The /wait switch does work. It does need the "file:///" preceding the file name, though.