本帖最后由 WHY 于 2019-7-27 20:16 编辑
- @echo off
- call :getLnkFile "%~dp0"
- echo del /q /f /s *.Lnk
- pause & exit
-
- :getLnkFile
- if not exist "%~1*.Lnk" goto :next
- set "p=%~pnx1"
- for /f "delims=" %%i in ('wmic Path Win32_ShortCutFile where "Path='%p:\=\\%' and Drive='%~d1' and Extension='Lnk'" get Target /format:Table^|find ":"') do (
- for /f "delims=" %%j in ("%%i") do echo copy "%%~fj" "%~1"
- )
-
- :next
- for /d %%i in ("%~1*") do call :getLnkFile "%%i\"
复制代码
|