[分享]批處理不用外部命令提取特定標識字符之間的字符串本例的特定字符為單引號(')@echo off::提取第1對單引號括起來的字符串,如無單引號則取整串::如只有1個單引號(非末位),則取單號之后的子字符串::如只有1個單引號處且于末位,則結果為空串@setlocal enableDelayedExpansionset str=File 'D:tmp1051.jpg' contains no Exif timestampset str1=%str:*'=%if defined str1 (set str='%str1:*'=%call set str=%%str1:!str!=%%) else (set str=)echo;提取的字符串為:%str%endlocal