Re: Change computername

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

  1. 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:
    103
    Anatoli Hristov
    Oct 17, 2012
  2. Ian Kelly

    Re: Change computername

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

    Re: Change computername

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

    Re: Change computername

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

    Re: Change computername

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

Share This Page