I think the bigger issue is being passed over...why write a program to do
what RDP should already be able to do? RDP should work by machine name. If
it does not, then DNS probably is not set up correctly.

Are you, by any chance, using OpenDNS as your DNS servers?

Does your router support DHCP assignment by MAC address (for static-like IPs
with DHCP)? If so, you can always use the same IP instead of looking it up.

Other than that, I second the "socket.gethostbyname" suggestion.

SJ


On Thu, Aug 27, 2009 at 9:35 AM, Gerdus van Zyl <gerdusvan...@gmail.com>wrote:

> I would say try socket.gethostbyname;
> http://docs.python.org/library/socket.html#socket.gethostbyname
>
>
> On Thu, Aug 27, 2009 at 2:59 PM, Dahlstrom,
> Roger<rdahlst...@directedge.com> wrote:
> > Ping it and get the address.
> >
> > -----Original Message-----
> > From: python-win32-bounces+rdahlstrom=directedge....@python.org [mailto:
> python-win32-bounces+rdahlstrom <python-win32-bounces%2Brdahlstrom>=
> directedge....@python.org] On Behalf Of Dave Angel
> > Sent: Thursday, August 27, 2009 4:52 AM
> > To: Python-Win32 List
> > Subject: [python-win32] Find IP address for a UNC path
> >
> > I'd like to be able to figure out the IP address for a Windows XP file
> > server (on a local subnet, not across the Internet), based on a
> > successfully connected share.
> >
> > So I know the UNC name of the share, for example
> >    \\server\sharename\...
> >
> > (which was enabled by a NET USE to some other share on the same server)
> >
> > I know the IP address will be of the form  192.168.1.nnn   and it's on
> > the same router as my user's machine.  The local machines are running XP
> > and Vista (and OS-X), on a workgroup, not a domain.  And the server uses
> > DHCP (I think it's called), so the IP address is not fixed over time.
> >
> > The user of this utility will be then doing a Remote Desktop to the
> > server, if that helps.  We know he has permission, since he was able to
> > successfully  NET USE to the server.  But Remote Desktop doesn't seem to
> > permit him to use the server name, only the IP address.
> >
> > I've successfully written such a utility, using subprocess to launch
> > IPCONFIG.EXE on the server, but I need to be able to do it from the
> > user's machine, when the server is physically inaccessible.
> >
> > Suggestions anyone?
> >
> > Thanks, DaveA
> >
> >
> > _______________________________________________
> > python-win32 mailing list
> > python-win32@python.org
> > http://mail.python.org/mailman/listinfo/python-win32
> >
> >
> > DISCLAIMER:
> > This e-mail, and any attachments thereto, is intended only for use by the
> addressee(s) named herein and
> > may contain legally privileged and/or confidential information. If you
> are not the intended recipient
> > of this e-mail, you are hereby notified that any dissemination,
> distribution or copying of this e-mail, and
> > any attachments thereto, is strictly prohibited. If you have received
> this in error, please immediately notify
> > me and permanently delete the original and any copy of any e-mail and any
> printout thereof.
> > E-mail transmission cannot be guaranteed to be secure or error-free. The
> sender therefore does not accept
> > liability for any errors or omissions in the contents of this message
> which arise as a result of e-mail transmission.
> >
> > NOTICE REGARDING PRIVACY AND CONFIDENTIALITY
> > Direct Edge ECN LLC may, at its discretion, monitor and review the
> content of all e-mail communications.
> >
> > www.directedge.com
> > _______________________________________________
> > python-win32 mailing list
> > python-win32@python.org
> > http://mail.python.org/mailman/listinfo/python-win32
> >
> _______________________________________________
> python-win32 mailing list
> python-win32@python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to