用 dir 的 s b 参数就能得到路径了撒- @echo off
- set dir=%1
- for /f "delims=" %%i in ('dir /s /b %dir%\*.exe,%dir%\*.ico') do (set "ico_path=%%i")
- rem 设为所在目录的文件夹图标
- echo [.ShellClassInfo] > =%dir%\desktop.ini
- echo IconResource=%ico_path%,0 >> =%dir%\desktop.ini
- pause
复制代码
|