Jump to content

Recommended Posts

Posted

just wondering if this will work?

im wanting 2 set opera as default browser, but the reg key requires full path, so i am doing the following 2 make sure the right file is used

opera*.reg files consist of the full program file of the path (they work, ive tested them) 2 set it as default browser

@ECHO OFF
IF EXIST C:\Program files\Opera75\opera.exe GOTO Opera1 ELSE GOTO Opera4

:Opera1
REGEDIT /S opera1.reg
ECHO opera1
exit

:Opera2
REGEDIT /S opera2.reg
ECHO opera2
exit

:Opera3
REGEDIT /S opera3.reg
ECHO opera3
exit

:opera4
IF EXIST "D:\Program files\Opera75\opera.exe" GOTO Opera2 ELSE GOTO Opera5

:Opera5
IF EXIST "E:\Program files\Opera75\opera.exe" GOTO Opera3 ELSE GOTO END

:END
EXIT

thanks for the reply(s)


Posted

Hi MCT

No it won't work, the ELSE is not recognise . Your ECHO line is useless because it will appear a fraction of second before exit. This will work...

Don't forget quotes

@ECHO OFF

IF EXIST "C:\Program files\Opera75\opera.exe" GOTO Opera1

IF EXIST "D:\Program files\Opera75\opera.exe" GOTO Opera2

IF EXIST "E:\Program files\Opera75\opera.exe" GOTO Opera3

GOTO END

:Opera1

REGEDIT /S opera1.reg

EXIT

:Opera2

REGEDIT /S opera2.reg

EXIT

:Opera3

REGEDIT /S opera3.reg

EXIT

:END

Posted

thanks for the reply jdoe :)

i only was using the echo command 2 see if it would work, as a type of debugger,

thanks for the code, ill test it

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...