本帖最后由 went 于 2020-4-16 16:47 编辑
回复 7# 大地
drivers最好别添加系统盘符,不然查找起来很慢- @echo off
- REM search drivers
- set "drivers=D E F G H I J K L M N O P Q R S T U V W X Y Z"
- REM exe foldername
- set "folderName=TOOLS1112222"
- REM start
- for %%i in (%drivers%) do (
- cd /d "%%i:\" 2>nul && (
- echo search %%i: please wait...
- for /r /d %%a in ("*") do (
- if "%%~na" equ "%folderName%" (
- set "folder=%%~a"
- goto :done
- )
- )
- )
- )
- :done
- if "%folder%"=="" echo %folderName% not found! & pause&exit
- echo -------------
- echo "folder=%folder%"
- echo -------------
- for /r "%folder%" %%i in ("*.exe") do (
- echo mklink: %%~i
- call set "exe=%%~i"
- call set "tag=%USERPROFILE%\desktop\%folderName%%%exe:%folder%=%%"
- call mkdir %%tag:%%~nxi=%% >nul 2>nul
- call mklink "%%tag:~0,-4%%" "%%~i" >nul
- )
- pause&exit
复制代码
|