Sorry my mistake, what you want is "start" not call. You can enter "help start" at the command line to get the options.
Code:
@start xfoil.exe <airfoil.txt >xfoil.out
@echo both batch file and xfoil are now running
@rem delay for 12 seconds (-n param is 1 + # seconds to delay)
@ping 127.0.0.1 -n 13 >nul
@taskkill /f /im:xfoil.exe
To compensate for my mistake, how to do a loop. doloop.bat calls loop.bat with an incrementing parameter 30 times). You can replace the 30 with %1 so that the number of loops is specified by the user.
doloop.bat:
Code:
for /l %%c in (1 1 30) do @call loop.bat %%c
loop.bat
Another tidbit, if you're on a network and want to run batchfiles remotely on another machine, you can rename a file to use as a handshake between the two machines, using the batch command "if not exist name...". The "server" system runs a batch file with a loop and a delay (ping 127.0.0.1 -n 2 >nul). I usually bump the suffix for the handshake:
server system:
Code:
@loop0:
@ping 127.0.0.1 -n 2 >nul
@if not exist flagfile.1 @goto loop0
@rem let client system know server system is running
@ren flagfile.1 flagfile.2
@rem run some process
@rem let client system know server system has completed
@ren flagfile.2 flagfile.0
@goto loop0
client system
Code:
@if not exist flagfile.1 @ren flagfile.? flagfile.1
@echo waiting for server to start
@loop0:
@ping 127.0.0.1 -n 2 >nul
@if not exist flagfile.2 @goto loop0
@echo waiting for server to complete
@loop1:
@ping 127.0.0.1 -n 2 >nul
@if not exist flagfile.0 @goto loop1
@echo server completed