ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » News/Updates » MQ related Windows variables (VB.Net)

Post new topic  Reply to topic
 MQ related Windows variables (VB.Net) « View previous topic :: View next topic » 
Author Message
kevinf2349
PostPosted: Wed Jan 19, 2005 1:52 pm    Post subject: MQ related Windows variables (VB.Net) Reply with quote

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
View user's profile Send private message
EddieA
PostPosted: Wed Jan 19, 2005 2:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Wed Jan 19, 2005 2:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
kevinf2349
PostPosted: Thu Jan 20, 2005 5:25 am    Post subject: Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Thu Jan 20, 2005 6:44 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » News/Updates » MQ related Windows variables (VB.Net)
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.