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
Post a Comment