Skip to content

Instantly share code, notes, and snippets.

@deyvicode
Created February 21, 2025 21:07
Show Gist options
  • Select an option

  • Save deyvicode/2b3eb149f0b38b40ca85c296d842f5e6 to your computer and use it in GitHub Desktop.

Select an option

Save deyvicode/2b3eb149f0b38b40ca85c296d842f5e6 to your computer and use it in GitHub Desktop.
Convierte todos los archivos .txt en .txt utf-8 dentro de una carpeta
@echo off
setlocal
:: Obtener la ruta actual
set "folderPath=%cd%"
:: Ejecutar el script de PowerShell 7
pwsh -NoProfile -ExecutionPolicy Bypass -Command ^
"Get-ChildItem -Path '%folderPath%' -Filter *.txt | ForEach-Object { $filePath = $_.FullName; $content = Get-Content -Path $filePath; Set-Content -Path $filePath -Value $content -Encoding utf8 }"
endlocal
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment