Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

How can I start Firefox with an html file passed parameter

  • 6 trả lời
  • 1 gặp vấn đề này
  • 438 lượt xem
  • Trả lời mới nhất được viết bởi 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)

Giải pháp được chọn

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"
Đọc câu trả lời này trong ngữ cảnh 👍 0

Tất cả các câu trả lời (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"

Được chỉnh sửa bởi dave-o và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

Giải pháp được chọn

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.