First post, by pandarsson
Is choice the only dosbox command that returns an errorlevel? I was trying to make a move.bat, but in order to safely delete the old file, I need copy to give me an errorlevel. If the copy is successful, I need a 0, while if it's not, I need a 1. Here is the contents of the batch file:
@echo offif ()==(%1) goto ERRORAif exist %1 goto MOVEecho The file "%1" does not exist.goto END:MOVEif ()==(%2) goto ERRORBcopy %1 %2if errorlevel 0 goto DELgoto ERRORC:DELdel %1goto END:ERRORAecho You must specify which file to move.goto END:ERRORBecho You must specify a location.goto END:ERRORCecho Unable to complete command.:END
The offending if statement is under :MOVE. Am I doing something wrong? Am I expecting too much? Is there another way of which I haven't thought?
Yes, I know I could do other things for a move command, but I like figuring out batch files. Sue me. I suppose if nothing else, I can use the bat2com utility posted somewhere on the net and convert it in dosemu, but I wanted to check here first.