| View previous topic :: View next topic |
| Author |
Message |
bill
Joined: 03 Sep 2010 Posts: 7
|
Posted: Fri Sep 03, 2010 7:19 pm Post subject: Launch browser with current file |
|
|
Exec("C:\Program Files\Mozilla Firefox 4.0 Beta 3\firefox.exe '%f'").
This doesn't work. How does one launch Firefox, or any browser, displaying the current file?
Thanks. |
|
| Back to top |
|
 |
infimum
Joined: 02 Mar 2008 Posts: 26
|
Posted: Fri Sep 03, 2010 7:41 pm Post subject: |
|
|
| There is a space between "Program" and "Files" and other places. |
|
| Back to top |
|
 |
bill
Joined: 03 Sep 2010 Posts: 7
|
Posted: Fri Sep 03, 2010 8:06 pm Post subject: |
|
|
It is enclosed in quotes. If I name a file it works perfectly. For example,
Exec("C:\Program Files\Mozilla Firefox 4.0 Beta 3\firefox.exe c:\links.htm")
But if I use the variable %f enclosed in single quotes it doesn't work. Why not? |
|
| Back to top |
|
 |
bill
Joined: 03 Sep 2010 Posts: 7
|
Posted: Fri Sep 03, 2010 8:11 pm Post subject: |
|
|
Sorry. Solved it. Quotes around the variable are not needed. This works:
Exec("C:\Program Files\Mozilla Firefox 4.0 Beta 3\firefox.exe %f") |
|
| Back to top |
|
 |
KDJ
Joined: 06 Mar 2010 Posts: 1069 Location: Poland
|
Posted: Fri Sep 03, 2010 8:44 pm Post subject: |
|
|
bill
I think this should be done like this:
Exec(`C:\Program Files\Mozilla Firefox 4.0 Beta 3\firefox.exe "%f"`)
or
Exec('C:\Program Files\Mozilla Firefox 4.0 Beta 3\firefox.exe "%f"') |
|
| Back to top |
|
 |
bill
Joined: 03 Sep 2010 Posts: 7
|
Posted: Fri Sep 03, 2010 9:03 pm Post subject: |
|
|
| That is the way I had it initially, double quotes around the complete string and single quotes around the variable. But I find that quotes around the variable are not needed. In fact, using quotes around %f doesn't work. |
|
| Back to top |
|
 |
cnnnc
Joined: 12 Jan 2008 Posts: 115 Location: Shantou, China
|
Posted: Sat Sep 04, 2010 8:30 am Post subject: |
|
|
| Exec(`"C:\Program Files\Mozilla Firefox 4.0 Beta 3\firefox.exe" %f`) |
|
| Back to top |
|
 |
|