舞言李萍
//是目录不是文件夹#! /bin/bash # filename:FileTsh read -p "Please input the filename :" filename fpath=$filename if [ -d $fpath ]; then echo "$fpath is a "; elif [ -e $fpath ]; then echo "$fpath is a "; else echo "$fpath is NOT a file or "; fi
midnightdq
@echo offsetlocal enabledelayedexpansionfor %%a in ("%cd%") do set "Name=%%~nxa"for %%a in (*jpg,*jpeg,*png,*if,*bmp) do ( if not defined Num ( ren "%%~a" "!Name!%%~xa" ) else ( ren "%%~a" "!Name!_!Num!%%~xa" ) set /a Num+=1)pause放在要处理的目录中运行即可。
优质武汉中专问答知识库