When working international there will some day someone ask you to mirror a folder to different locations.
And for sure we all know robocopy and how to use it. Else go to this https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy
Luckily robocopy is now integrated to Windows you can directly work with it. But it is struggeling with special characters of my differnt countries customers.
So I found now this superuser.com entry (I love this QA page system and the users behind it) and it helped me to solve it.
1. Add "chcp 65001" to your batch file, chcp means change code page and 65001 is UTF-8
2. Save the batch file as UTF-8 without BOM. I used notepad++ for it. It can convert the file during edit directly
Remark: The original poster at superuser.com users VARs for the folder names but I did not need it for my case and also did not used it as it was a very very simple script.
And for sure we all know robocopy and how to use it. Else go to this https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy
Luckily robocopy is now integrated to Windows you can directly work with it. But it is struggeling with special characters of my differnt countries customers.
So I found now this superuser.com entry (I love this QA page system and the users behind it) and it helped me to solve it.
1. Add "chcp 65001" to your batch file, chcp means change code page and 65001 is UTF-8
2. Save the batch file as UTF-8 without BOM. I used notepad++ for it. It can convert the file during edit directly
Remark: The original poster at superuser.com users VARs for the folder names but I did not need it for my case and also did not used it as it was a very very simple script.
Comments
Post a Comment