如果打开跟批处理脚本同名的文件- @echo off
- cd /d "%~dp0"
- for /d %%A in (*) do (
- for %%B in ("%%~A\*") do (
- if /i "%%~nB"=="%~n0" start "title" "%%~B"
- )
- )
复制代码 如果需要指定同名文件;- @echo off
- cd /d "%~dp0"
- set "同名文件=a.txt"
- for /d %%A in (*) do (
- if exist "%%~A\%同名文件%" start "title" "%%~A\%同名文件%"
- )
复制代码
|