How to launch opera 12 from a bat file?

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

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

2. July 2012, 15:10:31

kkad

Posts: 182

How to launch opera 12 from a bat file?

Could someone please help me with this? I have a couple of bat files from my Opera 11.x installation but they don't work well when I update them for the new Opera 12.

When called from a bat, opera.exe opens without previous settings and in the default skin. I don't understand why this happens. I don't understand how the plugin wrapper is launched by opera and what it does exactly.

worried
Opera 12 build 1467 on Windows XP SP2 Pro • AMD64 3000 1Gb RAM

2. July 2012, 15:39:57

Moderator

Tamil

:-(|)

Posts: 115306

Originally posted by kkad:

I have a couple of bat files from my Opera 11.x installation but they don't work well when I update them for the new Opera 12.

Can you post content of it?

Originally posted by kkad:

I don't understand how the plugin wrapper is launched by opera and what it does exactly.

Opera launches plugins like flash in separate process. If flash crashes it won't crash Opera.

2. July 2012, 15:57:08

kkad

Posts: 182

Right! Here is the bat, with updated paths for Opera 12, it's to save previous session and open opera without tabs:

@echo off

set exeName="opera.exe"

set found=
for /f "tokens=*" %%a in ('tasklist ^| findstr /i "%exeName%"') do set found=Y

if "%found%"=="Y" goto :IFTRUE
:IFFALSE
	echo %exeName% is started
	copy "C:\Documents and Settings\myname\Application Data\Opera\Opera1200\sessions\autosave.win" "C:\Documents and Settings\myname\Application Data\Opera\Opera1200\sessions\autosession.win"
	goto :ENDIF
:IFTRUE
	echo %exeName% is already running
:ENDIF

start /D "C:\Program Files\Opera1200" opera.exe


PS: So if the wrapper only relates to plugins, how to explain that when launched from bat file, opera.exe opens in the default skin and without customization?
Opera 12 build 1467 on Windows XP SP2 Pro • AMD64 3000 1Gb RAM

4. July 2012, 14:19:55

kkad

Posts: 182

So I solved this myself by reinstalling Opera in USB (stand-alone) mode. That way the profile and all the stuff is in one place! After updating the system envronment path (you know, that thing) to look for opera.exe in the right place everything is working fine again.
Opera 12 build 1467 on Windows XP SP2 Pro • AMD64 3000 1Gb RAM

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