phyton için : import os
folder_path = "D:\\"
for root, dirs, files in os.walk(folder_path):
for file in files:
if file.endswith(".cdtt"):
old_path = os.path.join(root, file)
new_path = os.path.join(root, file[:-5])
os.rename(old_path, new_path)
print("İşlem tamamlandı.")
bu da bat dosyası için :
@Echo off
setlocal enabledelayedexpansion
set "folderPath=D:\"
for /r %%i in (%folderPath%\*.cdtt) do (
set "filename=%%~ni"
set "newFilename=!filename:.cdtt=!"
ren "%%i" "!newFilename!"
)
echo "İşlem tamamlandı."
pause
bu da powershell için : $folderPath = "D:\"
Get-ChildItem -Path $folderPath -Filter *.cdtt | ForEach-Object {
$newName = $_.BaseName -replace '\.cdtt$'
Rename-Item $_.FullName -NewName "$newName$($_.Extension)"
}
Write-Host "İşlem tamamlandı."