Deleting file after progeam execution in batch -


i having simple question, having simple batch script:

for /l %%x in (1, 1, 3) start /wait c:\some.exe -verbose c:\somelog.txt del c:\somelog.txt  

after each execution file creates log, , want remove log before next loop execution, execution works fine when add del command having problems, looks log being deleted early.

is there possible way delay del command ??

when running multiple command nest them readability.

for /l %%x in (1, 1, 3) (     start /wait c:\some.exe -verbose c:\somelog.txt      del c:\somelog.txt  ) 

you way well

for /l %%x in (1, 1, 3) (start /wait c:\some.exe -verbose c:\somelog.txt &del c:\somelog.txt) 

but not mean executable respecting wait option. many programs not. use exe directly without using start @ all.


Comments

Popular posts from this blog

c++ - CPP, 'X' button listener -

shared memory - gstreamer shmsrc and shmsink with h264 data -

r - Add string of (variable number of) arguments to a function within a function -