Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31609

Re: Change computername

References <CAKhY55NpUnZ3PdZczo2kv-DezMsz0TjWAvPST5cRZyAY30MPaA@mail.gmail.com> <CALwzidnMxbp5vOXN7BTdTEb=swd8nLcETugvyr--ZTj7A1=cTQ@mail.gmail.com> <CAKhY55MXu4Jm1aDCUSsMrAe3U2wZ260v8hs9Ek4=iKbM_v9Nyg@mail.gmail.com>
Date 2012-10-18 10:22 +0200
Subject Re: Change computername
From Anatoli Hristov <tolidtm@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2411.1350548578.27098.python-list@python.org> (permalink)

Show all headers | View raw


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 <tolidtm@gmail.com> wrote:
> Thank you,
>
> I will test this, will keep you posted.
>
> Anatoli
>
> On Wed, Oct 17, 2012 at 7:47 PM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
>> On Wed, Oct 17, 2012 at 8:07 AM, Anatoli Hristov <tolidtm@gmail.com> 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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Change computername Anatoli Hristov <tolidtm@gmail.com> - 2012-10-18 10:22 +0200

csiph-web