1

I'm having trouble running Windows batch files using Handbrake, whereby if a source file contains special characters then I get an error saying it can't find the source file because for some reason Windows converts special characters into unreadable text when running the batch file. For example:

HandbrakeCLI.exe -i % äöü日本語のキーボード é.avi -o % äöü日本語のキーボード é.mp4 --scan

If I copy the above and put it directly into CMD then it works. However, if I put it in a batch file then it fails. Any idea on how to make the batch files open successfully?

HaveAGitGat
  • 59
  • 1
  • 9
  • quick and dirty: Close your editor, from command line, `>>file.bat echo HandbrakeCLI.exe -i % äöü日本語のキーボード é.avi -o % äöü日本語のキーボード é.mp4 --scan`, open it again in your editor and copy/paste that line to where you need it (ignore strange or seemingly missing characters) – Stephan Jan 29 '19 at 11:18
  • @Stephan thanks for this. The only issue is I'm using this in a much larger automation program so I wouldn't be able to manually do this every time. – HaveAGitGat Jan 29 '19 at 11:25
  • 1
    Then maybe [this](https://stackoverflow.com/questions/43046559/cmd-cant-read-danish-characters-when-i-execute-bat-file) helps. – Stephan Jan 29 '19 at 11:38

1 Answers1

0

Try doubling the % signs, as you'll need to escape them in a saved file. See more escape characters at https://www.robvanderwoude.com/escapechars.php

DitherDude
  • 64
  • 6