本帖最后由 went 于 2020-4-26 09:48 编辑
ANSI保存,再不行我也没招了- @echo off
- REM Admin
- %1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","REM",,"runas",1)(window.close)&exit
- REM search drivers
- set "drivers=C 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 "exeFolderName=TOOLS1112222"
- REM main foldername
- set "linkFolderName1=C:\Users\lenovo\Desktop\1"
- set "linkFolderName2=C:\Users\lenovo\Desktop\2"
- REM esp exe
- set "espExe=\分区工具\DG.exe?\截图工具\nap.exe?\其它\QQ.exe"
- REM start
- for %%i in (%drivers%) do if exist "%%i:\" (
- set /p="check:%%i:\%exeFolderName% "<nul
- if exist "%%i:\%exeFolderName%" (
- echo OK!
- set "folder=%%i:\%exeFolderName%"
- goto :done
- ) else echo not found!
- )
- echo -------------
- for %%i in (%drivers%) do (
- cd /d "%%i:\" 2>nul && (
- echo search %%i: please wait...
- for /r /d %%a in ("*") do (
- if "%%~na" equ "%exeFolderName%" (
- set "folder=%%~a"
- goto :done
- )
- )
- )
- )
- :done
- if "%folder%"=="" echo %exeFolderName% not found! & pause&exit
- echo -------------
- echo "folder=%folder%"
- echo -------------
- for /r "%folder%" %%i in ("*.exe") do (
- echo mklink: %%~i
- call set "exe=%%~i"
- call echo %espExe% | call findstr /i /C:"%%exe:%folder%\=%%" >nul 2>nul && (
- call echo add %userprofile%\desktop
- mklink "%userprofile%\desktop\%%~ni" "%%~i" >nul
- )
- for /f "tokens=2 delims==" %%a in ('set linkFolderName') do (
- call set "link=%%a\%exeFolderName%\%%exe:%folder%\=%%"
- call mkdir "%%link:%%~nxi=%%" >nul 2>nul
- call mklink "%%link:~0,-4%%" "%%~i" >nul
- )
- )
- pause&exit
复制代码
|