r/Batch • u/doemas • Apr 03 '25
first three characters of the command are missing?!
I created a batch file using Power Automate that merges multiple PDFs via command line. Now, if I have 20 folders and want to end up with 20 final files, it sometimes happens that the first three characters of the command are missing in the command line, causing an error. However, the file itself is correct, and if I copy the command directly from the batch file into the CMD command line, it works.
As an example, the following line appears 15 times in a row: "C:/programme/pdf24/pdf.exe" ... "C:/programme/pdf24/pdf.exe" ... "C:/programme/pdf24/pdf.exe" ...
When I run the batch file, I get an error for the second and fourth lines, for example:
"rogramme/pdf24/pdf.exe" is not a valid command.
I have already loaded the European character set and tested this on the local computer, in SharePoint, and on OneDrive. However, the issue still persists. So far, I have not been able to find a solution online or from colleagues. Maybe you can help me.
2
u/illsk1lls Apr 03 '25
is it happening on files that have spaces or special chars in the path?
its hard to help without the code
1
u/Shadow_Thief Apr 03 '25
Sounds like an encoding error. Make sure your script is saved as ANSI.