Close db2cmd prompt after command execution from a batch file

后端 未结 2 1339
借酒劲吻你
借酒劲吻你 2021-01-27 08:15

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

相关标签:
2条回答
  • 2021-01-27 08:56

    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.

    0 讨论(0)
  • 2021-01-27 09:06

    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
    
    0 讨论(0)
提交回复
热议问题