|
Post by levievre on Apr 10, 2019 10:26:02 GMT 1
Hi,
My dos app creates some pdf reports using dosprinter and I'd like to execute a batch file to rename and compress all files with long file names.
For instance, file report.bat :
ren marrpt.pdf accounting_report_march_2019.pdf
ren aprrpt.pdf accounting_report_april_2019.pdf
7za a -tzip accounting_reports account*.pdf
But ren or copy fail to execute these commands. start copy aprrpt.pdf accounting_report_april_2019.pdf works but open a new cmd window. Finally, is there a possibility to execute a windows app with a long file name in a batch file ?
Thank you, David.
|
|
|
Post by Jos on Apr 10, 2019 10:42:48 GMT 1
I would let DOSPrinter create the LFN directly, however:
1. DOS in vDos doesn’t support LFN. 2. If do don’t want a CMD window, use something like: CMD HIDE /c copy aprrpt.pdf accounting_report_april_2019.pdf. 3. If you mean the windows app has some LFN in its path, use the SFN variant. If it’s the command line, that is passed on as-is to the windows app. Eventually enclose the LFN in double quotes if needed. Or rename the .BAT file to .CMD, and execute that.
Jos
|
|
|
Post by levievre on Apr 10, 2019 21:26:19 GMT 1
I will try to use CMD HIDE /c and will let you know
Thank you very much.
David.
|
|
|
Post by levievre on Apr 11, 2019 13:14:45 GMT 1
I did try both solutions. Using CMD HIDE /c or starting a cmd file instead of a bat file. Both solutions work finely.
Thank you again.
David.
|
|