0

I am trying to run some commands in batch file on windows server 2012 but it's not working properly. What i am doing here. Get all files(.docx) from current directory in loop, convert file into pdf and move into other folder.

cls
@ECHO ON

for  %%i in (*.docx) do  
    soffice  /-Y --headless --convert-to pdf %%i
    MOVE /-y C:\xxx\xxx\xxx\results\*.pdf   "C:\xxx\xxx\xx-xx\results\pdf"

Can anyone help me about this what i am doing wrong?

Thank you,

  • 1
    Is that your actual code? Where are the parentheses for the FOR block? – Michael Harvey Oct 14 '18 at 10:20
  • oh i missed it.. is this problem only ? – Zubair Sultan Oct 14 '18 at 10:26
  • 1
    Have you tried it? – Michael Harvey Oct 14 '18 at 10:27
  • Yes, it is. Thanks Micheal for pointing out – Zubair Sultan Oct 14 '18 at 10:28
1

You probably meant to do this...

cls
@ECHO ON
for  %%i in (*.docx) do soffice /-Y --headless --convert-to pdf %%i
MOVE /-y C:\xxx\xxx\xxx\results\*.pdf "C:\xxx\xxx\xx-xx\results\pdf"

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.