@echo off cd %userprofile%\Desktop dir /b /o:g > tmp.txt

REM Create temporary file to store sorted list echo. > sorted.txt

REM Sort the desktop items by type for /f "tokens=*" %%a in (tmp.txt) do ( for /f "tokens=2 delims= " %%b in ('assoc "%%a"') do ( echo "%%b %%a" >> sorted.txt ) )

REM Sort the list in place sort /r sorted.txt > sorted.tmp

REM Create a new batch file for renaming echo @echo off > rename.bat

REM Rename the desktop items in the sorted order for /f "tokens=2,*" %%a in (sorted.tmp) do ( echo rename "%%b" "%%a" >> rename.bat )

REM Execute the rename batch file call rename.bat

REM Clean up temporary files del tmp.txt del sorted.txt del rename.bat

echo Desktop has been sorted by item type.

帮我写一个win7的批处理代码bat文件里的内容功能用于将桌面进行重新排序排序方式为项目类型

原文地址: https://www.cveoy.top/t/topic/jgO9 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录