Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2003
    Posts
    1,605

    Unanswered: how to get "db2 installation path" from DB2 Command Window?

    Hi,

    I am writting a script witch will copy some files to SQLLIB\BIN directory on users computers. Users use Windows 2000 or Windows XP. They can have installed db2 v7.2 or db2 v8. So each computer can have different db2 installation path (sample: c:\program files\ibm\sqllib\bin).

    I would like to write a script witch the output would be "db2 installation path".
    Can I write someting like:
    "db2 get installation path"

    The output should be someting like:
    "c:\program files\ibm\sqllib\bin"

    Thanks,
    Grofaty
    Last edited by grofaty; 05-26-04 at 03:47.

  2. #2
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    I have found the command db2set
    It returs:
    DB2INSTPROF=C:\PROGRAM FILES\SQLLIB

    Is this db2 installation directory?

    Thanks,
    Grofaty

  3. #3
    Join Date
    Feb 2004
    Location
    Copenhagen
    Posts
    220

    Arrow db2level

    Hi Grofaty

    I don't think thats your installation directory - but I'm not certain

    Running the 'db2level' command from the command line should yield
    the necessary information (among other)

    HTH
    Kristian K. Hansen
    Project Supervisor
    National Board of Health

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    db2level in db2 v7.2 does not include db2 installation directory. My script should work ofr v7.2 and v8.1.

    I think db2set is just what I need. I have tested on v7 and v8 and it works fine.

    No help is needed.

    Thanks,
    Grofaty

  5. #5
    Join Date
    Jan 2003
    Posts
    1,605
    Note: Replaying to old post.
    Several years letter I have the same problem and it looks like db2level is the only way to get db2 install path. So I have written a dos-command script to do the trick. Hope this helps someone.

    Code:
    @echo off
    FOR /f "tokens=5 delims= " %%i IN ('db2level ^| find "Product is installed at"') DO (
    SET db2_path=%%i
    )
    SET db2_path=%db2_path:"=%\bin
    echo %db2_path%

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •