MCT Posted June 22, 2004 Posted June 22, 2004 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 usedopera*.reg files consist of the full program file of the path (they work, ive tested them) 2 set it as default browser@ECHO OFFIF EXIST C:\Program files\Opera75\opera.exe GOTO Opera1 ELSE GOTO Opera4:Opera1REGEDIT /S opera1.reg ECHO opera1exit:Opera2REGEDIT /S opera2.regECHO opera2exit:Opera3REGEDIT /S opera3.regECHO opera3exit:opera4IF EXIST "D:\Program files\Opera75\opera.exe" GOTO Opera2 ELSE GOTO Opera5:Opera5IF EXIST "E:\Program files\Opera75\opera.exe" GOTO Opera3 ELSE GOTO END:ENDEXITthanks for the reply(s)
jdoe Posted June 22, 2004 Posted June 22, 2004 Hi MCTNo 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 OFFIF EXIST "C:\Program files\Opera75\opera.exe" GOTO Opera1IF EXIST "D:\Program files\Opera75\opera.exe" GOTO Opera2IF EXIST "E:\Program files\Opera75\opera.exe" GOTO Opera3GOTO END:Opera1REGEDIT /S opera1.reg EXIT:Opera2REGEDIT /S opera2.regEXIT:Opera3REGEDIT /S opera3.regEXIT:END
jdoe Posted June 22, 2004 Posted June 22, 2004 False factELSE command is good but I think more easy to do it the way I wrote it for your batch.
MCT Posted June 22, 2004 Author Posted June 22, 2004 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now