有志者事竟成。

删除当前文件夹不是.vue文件,电脑命令符

::-----------------------------------------@echo off
setlocal EnableDelayedExpansion
set _thisFilePath=%0
:loop
for /r %%i in (*.*) do (
REM 文件全路径
set _filePath=%%i
REM 不删除批处理本身
if not "!_filePath!"==%_thisFilePath% (
REM 截取文件后缀
set suffix=!_filePath:~-4!
REM 不删除".vue"后缀的文件
if not "!suffix!"==".vue" (
del /q "%%i"
)
)
)
pause::----------------------------------------------------------

posted on 2022-04-13 10:29  阿长*长  阅读(34)  评论(0编辑  收藏  举报

导航