Page 1 of 1

I can't solved my problem

Posted: 02 Sep 2014 07:48
by xhai
Hi dear sir help fix my code!

Code: Select all

if "%skip%"=="Disable" (
   echo Skip CRC check and ISO verification : %skip%
   ) else (
   echo Skip CRC check and ISO verification : Enable
)
echo Do you want to process with this setting? Y(es) N(o)
echo ===============================================================================
echo.
set "option3="
set /P "option3="
if /i "%option3%"=="Y" (
  if "%skip%"=="Disable" (
  goto :abc
) else (
  goto :xyz
)
if /i "%option3%"=="N" (
   goto :Start
   )


I want the code to work like this. when I input "Y" it will check "skip" if it's disable and goto :abc, if not it will goto :xyz

Thank you

Re: I can't solved my problem

Posted: 02 Sep 2014 07:57
by foxidrive
Give this a try:

Code: Select all

if "%skip%"=="Disable" (
   echo Skip CRC check and ISO verification : %skip%
   ) else (
   echo Skip CRC check and ISO verification : Enable
)
echo Do you want to process with this setting? Y(es) N(o)
echo ===============================================================================
echo.
set "option3="
set /P "option3="
if /i "%option3%"=="Y" (if "%skip%"=="Disable" (goto :abc) else (goto :xyz) )
if /i "%option3%"=="N" (goto :Start)
goto :EOF

Re: I can't solved my problem

Posted: 02 Sep 2014 08:59
by xhai
foxidrive wrote:Give this a try:

Code: Select all

if "%skip%"=="Disable" (
   echo Skip CRC check and ISO verification : %skip%
   ) else (
   echo Skip CRC check and ISO verification : Enable
)
echo Do you want to process with this setting? Y(es) N(o)
echo ===============================================================================
echo.
set "option3="
set /P "option3="
if /i "%option3%"=="Y" (if "%skip%"=="Disable" (goto :abc) else (goto :xyz) )
if /i "%option3%"=="N" (goto :Start)
goto :EOF


Thanks foxi It work, What was the problem in my code?

Re: I can't solved my problem

Posted: 02 Sep 2014 09:02
by ShadowThief
Looks like you were missing a )

Re: I can't solved my problem

Posted: 02 Sep 2014 09:23
by foxidrive
ShadowThief wrote:Looks like you were missing a )


Yes, above here

Code: Select all

if /i "%option3%"=="N" (
   goto :Start
   )

Re: I can't solved my problem

Posted: 03 Sep 2014 00:12
by xhai
thanks you foxidrive and ShadowThief for finding my mistake..