I am trying to close the db2cmd after executing a command. Goal is to get this file perfect before I schedule it with a task scheduler to run everyday at 2100 hours. The batch f
You probably want to add the command line switch /c
to your command
start C:\"Program Files"\IBM\SQLLIB\BIN\db2cmdadmin.exe /c "db2 -tvf D:\stats.sql > D:\stats.output"
as explained in the manual.
I haven't tried this, but it usually works for me. On at the end of `
start `C:\"Program Files"\IBM\SQLLIB\BIN\db2cmdadmin.exe "db2 -tvf D:\stats.sql > D:\stats.output"
Put
goto eof
Then put a loop
:eof
and exit So in total the code would be
@echo off
start `C:\"Program Files"\IBM\SQLLIB\BIN\db2cmdadmin.exe "db2 -tvf D:\stats.sql > D:\stats.output"
goto eof
:eof
exit