Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to initialize command line env without launching new window 1

Status
Not open for further replies.

ddiamond

Programmer
Apr 22, 2005
918
0
0
US
I want to create a single window's bat file that executes some db2 commands. I'm having trouble getting the command line environment set up. If I add the code at the top of my bat from db2cw.bat - db2cmd db2setcp "%1 %2 %3 %4 %5 %6 %7 %8 %9" - it launches a new db2 window which just sits there. What I need it to do is setup the db2 environment in my current command window, not a new one. I tried the -i option, but that did not seem to work. Any suggestions?
 
not sure my answer is 100% correct for your question:
we create *.bat files in Windows, e.g. for cataloging databases. And the commands all have this form:

db2cmd /c /w /i "db2 catalog tcpip node xxxx remote yyy server 444 with 'Host D2A0'"

also terminate etc. is no problem then and it does not 'just sit there', e.g.:

db2cmd /c /w /i "db2 -z c:\temp\cat.log uncatalog node xxx"
db2cmd /c /w /i "db2 -z c:\temp\cat.log uncatalog database yyy"
db2cmd /c /w /i "db2 -z c:\temp\cat.log terminate"
db2cmd /c /w /i "db2 -z c:\temp\cat.log catalog tcpip node xxx remote xxx.x.x server 444 with 'HUGO-Node'"
db2cmd /c /w /i "db2 -z c:\temp\cat.log catalog database xxx as xxx at node yyy authentication server with 'Remote xxx'"

Juliane

Juliane
 
So basically you are creating a new command line evironment for each command. I don't think that is an ideal solution, but it will work. I also played around with:

db2cmd mydbcommands.bat

Where mydbcommands.bat contains my db commands. Again, I don't consider that solution ideal either because it requires to bat files instead of one, but few things in life are ideal.

Thanks for your help, Julian.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top