We help IT Professionals succeed at work.

Source file is "ANSI" in a srcfiles folder, need to get this converted to "UTF8" through Windows batch script. Experts Please help

Source file is "ANSI" in a srcfiles folder, need to get this converted to "UTF8" through Windows batch script. Experts Please help.
I cant use any tool for it. Please help
Comment
Watch Question

Bill PrewTest your restores, not your backups...
Expert of the Year 2019
Top Expert 2016

Commented:
Should be able to do this using Powershell, try:

Get-Content "filein.txt" -Encoding Oem | Out-File "fileout.txt" -Encoding utf8

Open in new window


»bp

Author

Commented:
tried with the same command but getting an error for GET command "Get is not recognised as an Internal and External command"
Test your restores, not your backups...
Expert of the Year 2019
Top Expert 2016
Commented:
That is a powershell command, so to execute it from a DOS command line, or BAT script, do:

powershell -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "Get-Content 'filein.txt' -Encoding Oem | Out-File 'fileout.txt' -Encoding utf8"

Open in new window


»bp

Author

Commented:
Thanks so much mate.. that worked  awesome