本帖最后由 77七 于 2024-2-10 14:14 编辑
回复 5# BingjianREMIX
- set "str1=echo off & cls"
- set str2=echo off
- setlocal enabledelayedexpansion
- echo !str1!|find "%str2%" 1>nul && echo ok
复制代码
- for /f "delims=" %%a in ("echo off & cls") do (
- echo %%a|find "echo off" 1>nul && echo ok
- )
复制代码
- echo echo off ^& cls|find "echo off" 1>nul && echo ok
复制代码
- set "str=echo off & cls"
- set /p="%str%"<nul|find "echo off" 1>nul && echo ok
复制代码
- set "str1=echo off & cls"
- set str2=echo off
- setlocal enabledelayedexpansion
- set "_str=!str1:%str2%=!"
- if "!_str!" neq "!str1!" (
- echo ok
- )
复制代码
|