cannot execute after call iside IF

May 30, 2011 at 16:08:08
Specs: Windows 7
How to execute after CALL inside IF

Hey guys.
first of all, sorry for my english and my writings!

Who can help me in this, I am looking for a solution which calls a variable and after that variable using goto :eof it shall execute which was after the call.

I like to have a menue which calls for a password after every executables inside a menu.

Example code what i would like to get it working.

REM --------------
REM -- Menue
REM --------------

SET choice=''
SET /P choice=Choose an option:
if not '%choice%' == '' set choice =%choice:~1,9%
if '%choice%' equ '1' goto MADMTOOL
if '%choice%' equ '2' call :PASSWO || goto TASMAN
if '%choice%' equ '3' call :PASSWO || goto COMPRO
if '%choice%' equ '4' call :PASSWO || goto MSIREP
if '%choice%' equ '5' call :PASSWO || goto MSIREM
if '%choice%' equ '6' call :PASSWO || goto INTCLI
if '%choice%' equ '7' call :PASSWO || goto MAPNET
if '%choice%' equ '8' call :PASSWO || goto REGEDI
if '%choice%' equ '9' goto MADDOP
if '%choice%' equ 'q' goto EXIT

set /p passwort=Password:
if /i '%passwort%' equ '%passwd%' (goto :eof) else (goto 1st)


Now if you see after "call :PASSWO" I would like to execute "goto SOMEWHERE". But it will not, it is going to the next line. How can I solve this?

Thank you for your help, I really appriciate it.


See More: cannot execute after call iside IF

Report •

May 31, 2011 at 07:14:22
i believe you can use &&, if the first command is sucessfull


Report •

June 5, 2011 at 01:51:52
Instead of:
if '%choice%' equ '2' call :PASSWO || goto TASMAN
you could use
if '%choice%' equ '2' (
call :PASSWO

However, PASSWO may not return because of "goto 1st".

Report •

Related Solutions

Ask Question