Here's my best solution: Create an Applescript with:
do shell script "/Applications/Firefox.app/Contents/MacOS/firefox -P default -no-remote & killall Firefox.app"
And save it as an application.
You can put whatever application with whatever args in the first part. The part after the &
needs to kill whatever you have named your script + .app. You'll see the script app flash up in the dock, but it will then disappear.
Note: The script will not work properly when run from Script Editor, only when run from the script application you have created.
start /b "" "c:\Program Files\Oracle\VirtualBox\VBoxHeadless.exe" -startvm "debian604 64"
If you read the parameter list with start /?
:
START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
[command/program] [parameters]
"title" Title to display in window title bar.
command/program
If it is an internal cmd command or a batch file then
the command processor is run with the /K switch to cmd.exe.
This means that the window will remain after the command
has been run.
If it is not an internal cmd command or batch file then
it is a program and will run as either a windowed application
or a console application.
parameters These are the parameters passed to the command/program.
It expects a title
enclosed in quotes ("
). Since your program path included quotes, it got interpreted as the title. Adding an explicit title (in this case, empty, ""
) works.
An alternative method is using the /d
switch to specify the path. Specifically:
start /b /d "c:\Program Files\Oracle\VirtualBox\" VBoxHeadless.exe -startvm "debian604 64"
It appears to take the first argument after the /d
switch as the path, even if it is quoted, and if the next argument is not quoted then this works. Everything after what is recognised as the command/program is passed as a parameter to that command/program. Note this will not work if the command/program has spaces in the name, e.g. VBox Headless.exe
, since that would require quotes and be recognised as a title.
Overall, the first (explicit title) method is probably better. It was a bad design choice on the part of Microsoft, they really should have added a switch for title rather than "is the first argument enclosed in quotes?".
Best Answer
It appears Firefox does not allow me to start it from the command line with proxy information.
I ended up using Chrome instead. It allows me to start it with Proxy settings from the command line. See Proxy Chromium for Testing.