Re: Change computername

Discussion in 'Python' started by Anatoli Hristov, Oct 18, 2012.

  1. It does not work the result is "0"

    And I don't find any documentation about it :(


    On Thu, Oct 18, 2012 at 8:41 AM, Anatoli Hristov <> wrote:
    > Thank you,
    >
    > I will test this, will keep you posted.
    >
    > Anatoli
    >
    > On Wed, Oct 17, 2012 at 7:47 PM, Ian Kelly <> wrote:
    >> On Wed, Oct 17, 2012 at 8:07 AM, Anatoli Hristov <> wrote:
    >>> Hello,
    >>>
    >>> Can you please help me out how can I change the computername of
    >>> windows XP with or without the "WIN32" module ?

    >>
    >> Untested:
    >>
    >> from ctypes import *
    >>
    >> ComputerNamePhysicalDnsHostname = 5
    >>
    >> computer_name = u'COMPUTER'
    >>
    >> success = windll.kernel32.SetComputerNameExW(ComputerNamePhysicalDnsHostname,
    >> computer_name)
    >> if success:
    >> print("Name changed")
    >> else:
    >> print("Failed")
    >>
    >> The process will need admin rights, and the computer will need to be
    >> rebooted before the change will take effect.
    >> --
    >> http://mail.python.org/mailman/listinfo/python-list
     
    Anatoli Hristov, Oct 18, 2012
    #1
    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. Anatoli Hristov

    Change computername

    Anatoli Hristov, Oct 17, 2012, in forum: Python
    Replies:
    0
    Views:
    109
    Anatoli Hristov
    Oct 17, 2012
  2. Ian Kelly

    Re: Change computername

    Ian Kelly, Oct 17, 2012, in forum: Python
    Replies:
    0
    Views:
    119
    Ian Kelly
    Oct 17, 2012
  3. Anatoli Hristov

    Re: Change computername

    Anatoli Hristov, Oct 18, 2012, in forum: Python
    Replies:
    0
    Views:
    135
    Anatoli Hristov
    Oct 18, 2012
  4. Chris Angelico

    Re: Change computername

    Chris Angelico, Oct 18, 2012, in forum: Python
    Replies:
    0
    Views:
    133
    Chris Angelico
    Oct 18, 2012
  5. Dennis Lee Bieber

    Re: Change computername

    Dennis Lee Bieber, Oct 18, 2012, in forum: Python
    Replies:
    0
    Views:
    123
    Dennis Lee Bieber
    Oct 18, 2012
Loading...

Share This Page