ZTree.com  | ZEN  | About...  

 Index   Back

not working   [Help!]

By: Ryan       
Date: Jun 06,2017 at 02:51
In Response to: [Help!] REM #ZTIfDir SET ZTMode=Dir related questions (Liviu)

SET ZTMode=File
REM #ZTIfDir SET ZTMode=Dir
IF [%%ZTMode%%]==[File] GOTO DoFile2
IF [%%ZTMode%%]==[Dir] GOTO DoDir2
:DoFile2
SET N1=%4
SET N2=%N1:~0,7%
GOTO SSSS
:DoDir2
SET N1=%6
SET N2=%N1:~0,7%
GOTO SSSS
:SSSS
ECHO %N2%

working
----------------------------------
SET N1=%4& SET N2=%N1:~0,7%
ECHO %N2%

doesnt work
----------------------------------
SET "N1=%4"& SET "N2=%N1:~0,7%"
ECHO %N2%

doesnt work
---------------------------------
IF [%%ZTMode%%]==[File] SET N1=%4& SET N2=%N1:~0,7%
IF [%%ZTMode%%]==[Dir] SET N1=%6& SET N2=%N1:~0,7%
ECHO %N2%

doesnt work

IF [%%ZTMode%%]==[File] SET "N1=%4" & SET "N2=%N1:~0,7%"
IF [%%ZTMode%%]==[Dir] SET "N1=%6" & SET "N2=%N1:~0,7%"
ECHO %N2%

doesnt work
--------------------------------
IF [%%ZTMode%%]==[File] SET N1=%4& SET N2=%N1:~0,7%& GOTO DoFile2
IF [%%ZTMode%%]==[Dir] SET N1=%6& SET N2=%N1:~0,7%& GOTO DoDir2
ECHO %N2%

doesnt work

--------------------------------
>> a trailing space at the end
I will keep extra attention next time.

774 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 52 users online (0 registered, 52 guests)
Index | Admin contact |   Forum Time: Mar 29, 2024 - 1:51 am UTC  |  Hits:62,387,888  (2,674 Today )
RSS Feed