IBM Books

Command Reference

db2cmd - Open DB2 Command Window

Opens the CLP-enabled DB2 window, and initializes the DB2 command line environment. Issuing this command is equivalent to clicking on the DB2 Command Window icon.

This command is available on Windows NT, Windows 95, and Windows 98.

Authorization

None

Required Connection

None

Command Syntax

>>-db2cmd----+----+--------------------------------------------><
             +--c-+
             +--w-+
             +--i-+
             '--t-'
 

Command Parameters

-c
Execute the command, and then terminate. For example, "db2cmd /c dir" causes the "dir" command to be invoked in a command window, and then the command window closes.

-w
Wait until the cmd.exe process ends. For example, "db2cmd /c /w dir" invokes the "dir" command, and db2cmd.exe does not end until the command window closes.

-i
Run the command window, sharing the same console and inheriting file handles. For example, "db2cmd /c /w /i db2 get dbm cfg > myoutput" invokes cmd.exe to run the db2 command and to wait for its completion. A new console is not assigned, and stdout is piped to file "myoutput".

-t
Instead of using "DB2 CLP" as the title of the command window, inherit the title from the invoking window. This is useful if one wants, for example, to set up an icon with a different title that invokes "db2cmd /t".
Note:All switches must appear before any commands to be executed. For example: db2cmd /t db2.

Usage Notes

If DB21061E ("Command line environment not initialized.") is returned when bringing up the CLP-enabled DB2 window, or running CLP commands on Windows 95 or Windows 98, the operating system may be running out of environment space. Check the config.sys file for the SHELL environment setup parameter, and increase its value accordingly. For example:

   SHELL=C:\COMMAND.COM C:\ /P /E:32768


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]