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


Groups > comp.lang.python > #31598 > unrolled thread

Re: Change computername

Started byAnatoli Hristov <tolidtm@gmail.com>
First post2012-10-18 08:41 +0200
Last post2012-10-18 08:41 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#31598 — Re: Change computername

FromAnatoli Hristov <tolidtm@gmail.com>
Date2012-10-18 08:41 +0200
SubjectRe: Change computername
Message-ID<mailman.2406.1350542463.27098.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web