Skip to content

Instantly share code, notes, and snippets.

@ebubekirbastama
Created August 18, 2023 22:49
Show Gist options
  • Select an option

  • Save ebubekirbastama/ff0e6a292cff98c695b6680e8c6d0d94 to your computer and use it in GitHub Desktop.

Select an option

Save ebubekirbastama/ff0e6a292cff98c695b6680e8c6d0d94 to your computer and use it in GitHub Desktop.
Elbette, aşağıda PowerShell kullanarak bir klasördeki .mp4 dosyalarının adlarında bulunan boşlukları ve özel karakterleri kaldıran bir betik örneği bulabilirsiniz:
$sourceFolder = "Klasör Yolu"
# List all .mp4 files in the source folder
$mp4Files = Get-ChildItem -Path $sourceFolder -Filter *.mp4
# Loop through each .mp4 file and rename
foreach ($file in $mp4Files) {
$newFileName = $file.Name -replace '\s+', '_' -replace '[^\w\d_.-]', ''
$newFilePath = Join-Path -Path $sourceFolder -ChildPath $newFileName
Rename-Item -Path $file.FullName -NewName $newFileName
}
Write-Host "İşlem Tamam"
Bu PowerShell betiği, belirttiğiniz klasördeki tüm .mp4 dosyalarının adlarını boşlukları _ ile değiştirerek ve özel karakterleri kaldırarak düzenler. Önceki adları korumak isterseniz, Rename-Item komutunu kullanmadan önce yedeğinizi aldığınızdan emin olun.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment