Move and Del batch commands are not working

0
@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 fine the problem is that the del function and the move function simply does not work.

    
asked by anonymous 30.01.2016 / 00:49

1 answer

1

The command start of the batch does not wait for the started command to finish. What should be happening is that the command MAKEOPEACER5.jar cadperfiSorted has not yet finished, and with that:

  • del fails, since it is trying to access a file in use
  • move fails, since you are trying to move a file that (still) does not exist

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

start /wait MAKEOPEACER5.jar cadperfiSorted
    
30.01.2016 / 01:26