Bat大量更改文件后缀?

2025-01-26 15:05:15
推荐回答(2个)
回答1:

首先确定感染了你的exe文件,方法是看看它的修改日期有没有变,是的话用批处理才有用.

@echo off
setlocal enabledelayedexpansion
echo 文件后缀批量更改
set /p "c=Y继续 N 退出 (默认N)"
if /i not "!c:~0,1!"=="y" exit
dir /a:-d /b /s \"*.exe">exe属性文件.txt
for /f "delims=" %%i in ('dir /a:-d /b /s \"*.exe"') do ren "%%i" "%%~dpni.bat"
dir /a:-d /b /s \"*.bat">2.txt
echo 结束
pause & exit

回答2:

@echo off
Echo 文件后缀批量更改.....
set /p continue=确认更改?(Y/N,Y继续 N 退出)
if /i "%continue%"=="n" goto :eof
dir *.exe /s >exe属性文件.txt
for /r %%a in (*.exe) do ren "%%a" "%%~na".bat
dir *.bat /s >2.txt
Echo 结束
pause & exit