Batch Move and Del commands are not working

Asked

Viewed 91 times

1

@echo OFF

mkdir saida

sort %1 > cadperfiSorted 2>> saida\error.txt

start MAKEOPEACER5.jar cadperfiSorted

del cadperfiSorted
//OPEACER5 é um arquivo gerado pelo .jar
move OPEACER5 saida

This is the script I’m trying to run. Everything seems to work well the problem is that the function del and the function move just doesn’t work.

  • It is possible that the command running . jar (java?) is not finished yet. With this, the del is trying to delete a file in use (which you will not be able to), and move is trying to move a file that does not yet exist. Try using start /wait MAKEOPEACER5...

  • Thank you for the reply.

1 answer

1

The command start batch does not expect the command Started end. What must be happening is that the command MAKEOPEACER5.jar cadperfiSorted it’s not over yet, and with that:

  • the del failed, as it is trying to access a file in use
  • the move failed, as it is trying to move a file that (not yet) exists

Try to use the option /wait so that the command only continues when the operation ends:

start /wait MAKEOPEACER5.jar cadperfiSorted
  • Thank you very much. It worked perfectly here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.