WORKGROUP

Discussion in 'Java' started by Ilya Lakhmitski, Dec 13, 2011.

  1. Is there a way to get the name of WORKGROUP in java?
     
    Ilya Lakhmitski, Dec 13, 2011
    #1
    1. Advertising

  2. WORKGROUP - it is the network workgroup in which the computer is set.
     
    Ilya Lakhmitski, Dec 13, 2011
    #2
    1. Advertising

  3. Ilya Lakhmitski

    Nigel Wade Guest

    On 13/12/11 10:12, Ilya Lakhmitski wrote:
    > WORKGROUP - it is the network workgroup in which the computer is set.


    and if the computer is not in a WORKGROUP, what would you expect to happen?

    To give you some kind of clue, Java is cross-platform.

    --
    Nigel Wade
     
    Nigel Wade, Dec 13, 2011
    #3
  4. If the computer is not in a WORKGROUP, the value can be NULL. it is
    ok.

    The question is not what happens if something will occur, but how to
    get the name of WORKGROUP using java for different operation systems.
     
    Ilya Lakhmitski, Dec 13, 2011
    #4
  5. Ilya Lakhmitski

    Nigel Wade Guest

    On 13/12/11 12:33, Ilya Lakhmitski wrote:
    > If the computer is not in a WORKGROUP, the value can be NULL. it is
    > ok.
    >
    > The question is not what happens if something will occur, but how to
    > get the name of WORKGROUP using java for different operation systems.


    There is no concept of "WORKGROUP" in different operating systems. It is
    entirely a Microsoft Windows concept only. Not even all Windows machines
    belong to a WORKGROUP.

    If you are developing cross-platform software it can't be required. If
    it is required then the software will only work on Windows, and you need
    to ask yourself whether a language which has direct access to
    Windows-only features might be more appropriate. That is what my clue
    was alluding to.

    --
    Nigel Wade
     
    Nigel Wade, Dec 13, 2011
    #5
  6. Ilya Lakhmitski

    Roedy Green Guest

    On Tue, 13 Dec 2011 01:31:40 -0800 (PST), Ilya Lakhmitski
    <> wrote, quoted or indirectly quoted someone
    who said :

    >Is there a way to get the name of WORKGROUP in java?


    Java is WORA. Workgroup is specific to Windows so you won't find
    anything in the official Java to find it out. You would have to use
    JNI or exec something to find it out.

    See http://mindprod.com/jgloss/jni.html
    http://mindprod.com/jgloss/exec.html
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    For me, the appeal of computer programming is that
    even though I am quite a klutz,
    I can still produce something, in a sense
    perfect, because the computer gives me as many
    chances as I please to get it right.
     
    Roedy Green, Dec 13, 2011
    #6
  7. Ilya Lakhmitski

    Lew Guest

    On Tuesday, December 13, 2011 4:33:07 AM UTC-8, Ilya Lakhmitski wrote:
    > If the computer is not in a WORKGROUP, the value can be NULL. it is
    > ok.


    In Java that's spelled "null".

    > The question is not what happens if something will occur, but how to
    > get the name of WORKGROUP using java [sic] for different operation systems.


    Of course the question is what happens when something occurs. That's what programming is - the creation of instructions to the computer to tell it what happens (well, what to make happen) when something occurs.

    You should go back over the answers people have given you and assimilate them.

    That said, there is possibly a way to obtain a system descriptor from the OS that tells the program whatever the OS happens to know about its network,but as everyone keeps telling you, what you want is highly system specific(as in, unique to a system). You would have to make a cross-platform system call, determine from the answer that you do or do not have Windows, thencrack down to the level of Windows-specific information.

    Unfortunately for you, I do not know what such a system call would be, nor do I care to Google it for you if you aren't doing so.

    GIYF.
    \0\0
    I recommend that you consider carefully not, "How do I determine what WORKGROUP [sic] this node is in?" but, "What am I really trying to accomplish?" Sometimes we get tunnel vision on a particular idiom when a different approach actually would suit better.

    So what does having the workgroup buy you, and couldn't just knowing the IPaddress (which tells you what sub-LAN you're in) give you what you need (and in a cross-platform way!)?

    --
    Lew
     
    Lew, Dec 13, 2011
    #7
  8. Ilya Lakhmitski

    Rajiv Gupta Guest

    On 2011-12-13 20:31:40 +1100, Ilya Lakhmitski said:

    > Is there a way to get the name of WORKGROUP in java?


    Hello there good Sir! I don't know why the people in this webstation
    Google group page are showing strange attitude towards you. Perhaps
    they think their situation and knowledge is superior and they want to
    make sure that you know it.

    Well, don't worry. Contrary to what these clowns are saying, there is
    a portable way to do it. Java's java.util.prefs.Preferences package
    provides full support for reading values from the Windows registry.

    You will have to consult the Microsoft documentation to get the
    registry key path to play with.
     
    Rajiv Gupta, Dec 14, 2011
    #8
  9. Ilya Lakhmitski

    Lew Guest

    Rajiv Gupta wrote:
    > Hello there good Sir! I don't know why the people in this webstation
    > Google group page are showing strange attitude towards you. Perhaps


    I beg your pardon, but comp.lang.java.programmer is not a Google group. It is a Usenet forum.

    --
    Lew
     
    Lew, Dec 14, 2011
    #9
  10. Ilya Lakhmitski

    Paul Cager Guest

    On Dec 14, 6:15 am, Rajiv Gupta <> wrote:
    > On 2011-12-13 20:31:40 +1100, Ilya Lakhmitski said:
    >
    > > Is there a way to get the name of WORKGROUP in java?

    >
    > Java's java.util.prefs.Preferences package
    > provides full support for reading values from the Windows registry.
    >
    > You will have to consult the Microsoft documentation to get the
    > registry key path to play with.


    If there is an environment variable set to the workgroup name you
    might find it easier to read that. See

    http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/System.html#getenv()

    I don't have access to a Windows machine with a workgroup to check if
    there is such an environment variable, but my bet is that there will
    be.

    As other people have pointed out this is very much system-dependent -
    but that might not be a problem for you.
     
    Paul Cager, Dec 14, 2011
    #10
  11. Ilya Lakhmitski

    Roedy Green Guest

    On Tue, 13 Dec 2011 07:40:04 -0800, Roedy Green
    <> wrote, quoted or indirectly quoted
    someone who said :

    >Java is WORA. Workgroup is specific to Windows so you won't find
    >anything in the official Java to find it out. You would have to use
    >JNI or exec something to find it out.


    See if there is anything in the C++ windows API to change the
    workgroup. It might be considered something too dangerous to trust to
    non-OS code.


    Scan the Google to see if anyone has a solution, then encapsulate it
    with an exec or JNI.
    see http://mindprod.com/jgloss/jni.html
    http://mindprod.com/jgloss/exec.html


    If you were willing to endure great expense and pain, you would get
    some sort of disassembler or trace debugger and watch
    C:\Windows\System32\control.exe
    to see what it does when you manually change the workgroup.
    I used to do this all the time with 16-bit code. Then the guy who
    wrote my disassembler died and the tracer Periscope went out of
    business.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    If you can't remember the name of some method,
    consider changing it to something you can remember.
     
    Roedy Green, Jan 5, 2012
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Uk9TMzg=?=

    Workgroup Information File Error

    =?Utf-8?B?Uk9TMzg=?=, Aug 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,145
    Mary Chipman
    Aug 20, 2004
  2. ruca

    Authentication with WorkGroup

    ruca, Feb 21, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    355
    Chaves
    Mar 6, 2007
  3. Walter Zydhek

    Determining machine workgroup or domain

    Walter Zydhek, Oct 31, 2003, in forum: ASP .Net Security
    Replies:
    1
    Views:
    162
    Teemu Keiski
    Nov 3, 2003
  4. Robert E. Flaherty

    Single Sign On Within a Workgroup

    Robert E. Flaherty, Apr 5, 2006, in forum: ASP .Net Security
    Replies:
    0
    Views:
    174
    Robert E. Flaherty
    Apr 5, 2006
  5. Dominick Baier [DevelopMentor]

    Impersonate via a remote workgroup

    Dominick Baier [DevelopMentor], Jul 5, 2006, in forum: ASP .Net Security
    Replies:
    5
    Views:
    412
    Dominick Baier
    Aug 4, 2006
Loading...

Share This Page