|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQ related Windows variables (VB.Net) |
« View previous topic :: View next topic » |
Author |
Message
|
kevinf2349 |
Posted: Wed Jan 19, 2005 1:52 pm Post subject: MQ related Windows variables (VB.Net) |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Hi
Here is a chunck of code that will list out all the MQ**** variables that are in use on a Windows machine.
It will need the .Net framework to be in place
Code: |
Module Module1
Sub Main()
Dim sPathValue As String = Environment.GetEnvironmentVariable("PATH")
Dim env As IDictionary = Environment.GetEnvironmentVariables()
Dim var As DictionaryEntry
Dim test As String
Dim message As String = ""
For Each var In env
test = var.Key
If test.ToUpper.Substring(0, 2) = "MQ" Then
message = message & var.Key & " = " & var.Value & vbCrLf
End If
Next
If message <> "" Then
MsgBox(message, MsgBoxStyle.Information, "MQ Variable information")
End If
End Sub
End Module |
It may not be of much use to anyone, but on the other hand..... |
|
Back to top |
|
 |
EddieA |
Posted: Wed Jan 19, 2005 2:24 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
What's wrong with just typing "set MQ" in a Command Window.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jan 19, 2005 2:29 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
EddieA wrote: |
What's wrong with just typing "set MQ" in a Command Window.  |
His method produces results that are easier to process from within a program...  _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kevinf2349 |
Posted: Thu Jan 20, 2005 5:25 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Quote: |
What's wrong with just typing "set MQ" in a Command Window. |
Absolutely nothing except that then you would have to shellout of VB to issue the command and then find a way to read in the output from the window. In VB.Net that isn' t the easiest of things to achive (IMHO).
and I did say.....
Quote: |
It may not be of much use to anyone, but on the other hand..... |
Obviously it isn't of use to you, so don't use it.
Oh...I forgot to mention....if you take out the test for variables that start "MQ" it will list all the variables...computer name, paths etc. |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Jan 20, 2005 6:44 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
EddieA wrote: |
What's wrong with just typing "set MQ" in a Command Window. |
Well, I just learned something. I didn't know that you could do this to get environment variables. I'd always used set and grep. Thanks for the tip. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|