cmd - check the file extension with long file name -


i check extension of file (.iso or .img):

set extension=%~x1 set typefile=0 %%a in (.iso .img) (     if %%a==%extension% set /a typefile=!typefile!+1 )  if %typefile%==0 (     goto nomount ) else (     goto mount ) 

its works, problem when file have filename example:

9600.16384.130821-1623_x64fre_client_it-it-irm_ccsa_dv5.iso  

in case %typefile% set=0 if file iso.

change if %%a if /i %%a makes string-match case-insensitive.

btw, set /a typefile=!typefile!+1 set /a typefile+=1


Comments

Popular posts from this blog

What can cause "Required Package 'IndyCore' not found" when compiling a Delphi 2010 project? -

Change the color of an oval at click in Java AWT -