::how to find if it is a Drive or Dir or File
method 1=
IF "%3"=="\" IF "%4"=="" GOTO :DoDrive
SET ZTMode=File
REM #ZTIfDir SET ZTMode=Dir
IF [%%ZTMode%%]==[File] GOTO :DoFile
IF [%%ZTMode%%]==[Dir] GOTO :DoDir
GOTO :END
-------------------------------------
method 2=
IF "%3"=="\" IF "%4"=="" (
SET P1=Adrive
SET P2=Bdrive
SET P3=%2
)
GOTO :MODE
SET ZTMode=File
REM #ZTIfDir SET ZTMode=Dir
IF [%%ZTMode%%]==[File] (
SET P1=Adir
SET P2=Bdir
SET P3=%1
)
IF [%%ZTMode%%]==[Dir] (
SET P1=Afile
SET P2=Bfile
SET P3=%1
)
GOTO :MODE
REM ------------------------------
:MODE
ECHO.
ECHO %P1%
ECHO %P2%
ECHO %P3%
ECHO.
PAUSE
i can do this with method 1, but it has too many GOTO's
i like to know how i can do with method 2. is there a way?
i am stuck with this line IF [%%ZTMode%%]==[File],it wont take multiple lines.