The My Opera forums have been replaced with forums.opera.com. Please head over there to discuss Opera's products and features

See the new Forums

How to run Opera from Command Line

Forums » Opera for Windows/Mac/Linux » Opera browser

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

20. October 2011, 08:46:26

keelefr

Posts: 3

How to run Opera from Command Line

Hello,

I'm new to Opera, I have an habit of launching programs from my Windows Command line but "Opera" is not recognized.

Like 'firefox' or 'iexplore' launch each navigator, is there a short command line for launching Opera please?

regards

20. October 2011, 15:41:39

choope

pine tree

Posts: 407

Originally posted by gdveggie:

One way to do it, if you're comfortable with doing so, would be to include your Opera program folder in the System or User Path statement. Then typing "opera.exe" (or possibly just "opera") from the command line should work as expected.

I think "opera.exe" should work. Most of the command line options are for the UNIX-like versions. Go to this page for the documentation: http://www.opera.com/docs/switches/
Firefox 23.0, Opera 10.11-4791; Platform: SunOS (OpenIndiana); System: i86pc  Opera Desktop Team Security @ Opera Sitepatching blog
Linux in VirtualBox | Opera 12.15-1748

20. October 2011, 19:23:34

keelefr

Posts: 3

Thanks to both of you :

@choope : typing opera.exe doesn't work

@gdveggie : I could handle this solution but it seemed a bit complicated. That's why, I looked for a solution we should have had before : creating a custom command line. Google helped me : http://www.online-tech-tips.com/computer-tips/how-to-create-custom-run-commands-in-windows/
as I thought, Windows Registry could be tweaked quite easily.

I uploaded the key here : http://keele.free.fr/stuff/opera.reg

It would be great if Opera Team could include this key into the install process. I'm sure it's no big deal, do you know who I should send this idea to on this forum?

21. October 2011, 09:50:35

hdhondt

Posts: 376

You could add the opera program directory (in my case: c:\program Files\Opera10) to Windows' path. That can be done by right-clicking My Computer. Select Properties, then click the Advanced tab and click the Environment Variables button. Click "Path" under System Variables and then click Edit. In the text box for Value, press the End key, then type ; and "c:\program Files\Opera10" including the quotes. Change the path if your PC has Opera in a different directory.

22. October 2011, 10:02:40

hdhondt

Posts: 376

hmmm ... it appears I should have read your reply more closely, gdveggie...

27. January 2012, 08:34:48

gdveggie

(Arcimboldo's "The Gardener" - ca 1590)

Posts: 1710

One way to do it, if you're comfortable with doing so, would be to include your Opera program folder in the System or User Path statement. Then typing "opera.exe" (or possibly just "opera") from the command line should work as expected.

I'm not sure why "firefox" works from the command line for you, unless the FF installer or you included the FF program folder in your path statement, but iexplore points to iexplore.exe which is typically in the Windows folder which is always in the path statement (so typing iexplore should work on any Windows system).

You didn't mention your Windows version so I can't be sure this will apply exactly, but WinXP's System or User paths can be accessed via Start > Right-click on My Computer and select Properties (or just type sysdm.cpl from the command line) > Advanced Tab > Environment Variables > select Path in the User or System variables list > Edit

Items in the path statement are separated by a semi-colon, so you could add a semi-colon at the end of the path statement, then add the path to Opera's program folder (typically C:\Program Files\Opera on WinXP) to the User path statement (for your logged-in user name only) or the System path statement (for all users).

I would suggest you copy and paste the existing path statement into a text file to save in case you make a mistake or want to revert to the existing path for any reason. If you want to be even more cautious, create a system restore point before making any changes.

Any of the specific instructions I've mentioned might need to be modified slightly according to your Windows version, Opera installation folder, etc.

And there might be other ways to achieve the same end (launching from the command line), but that's the best way I can think of right now.

27. January 2012, 08:34:48

gdveggie

(Arcimboldo's "The Gardener" - ca 1590)

Posts: 1710

Originally posted by keelefr:

@gdveggie : I could handle this solution but it seemed a bit complicated. That's why, I looked for a solution we should have had before : creating a custom command line. Google helped me : http://www.online-tech-tips.com/computer-tips/how-to-create-custom-run-commands-in-windows/


Yeah, it is complicated, and personally I don't like adding unnecessary items to the path statement to have to be processed every time the path is processed, but it would do what you wanted.

However, the solution you found is very nifty, much simpler, and easily adapted for any command someone might want!!! up

One nice thing about Windows is that there are usually several ways to do the same thing, and I'm sure you can see how the registry key created by the online-tech-tips.com method is essentially creating a path statement specifically for Opera. ...And without that method, I personally would never have followed my own advice above, because I wouldn't want to clutter up the User or System path statement.

So before seeing your method, *if* I wanted to use the command line, I would have just pasted the whole path statement (e.g., C:\Program Files\Opera\opera.exe) into the Run window (WinKey+R) and let Windows keep the whole path in the Run menu (limited to 26 items in WinXP).

Works fine, but looks kinda messy. I thought of posting it instead of or in addition to my path suggestion in my first post, but figured it would just seem too messy compared to simply typing "opera".

Originally posted by keelefr:

It would be great if Opera Team could include this key into the install process. I'm sure it's no big deal, do you know who I should send this idea to on this forum?


Well, personally I'm guessing it's pretty rare for most Windows users to use, or even know anything about the command line. But if you want to suggest it, the best place is in the Desktop wish-list forum. If it gains any traction among other users there and is simple enough to include (probably would be), the Opera developers might add it in.

Good find on the Create Custom Run Commands post! up

Originally posted by hdhondt:

You could add the opera program directory (in my case: c:\program Files\Opera10) to Windows' path.


left ...uhhh... errr ...hmmm... right Didn't someone suggest that above in the first reply? whistle wink smile

27. January 2012, 08:34:48

gdveggie

(Arcimboldo's "The Gardener" - ca 1590)

Posts: 1710

up no prob, we're good wink (been there, done that myself p)

Forums » Opera for Windows/Mac/Linux » Opera browser