Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Change computername

Reply
Thread Tools

Re: Change computername

 
 
Anatoli Hristov
Guest
Posts: n/a
 
      10-18-2012
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 <(E-Mail Removed)> wrote:
> Thank you,
>
> I will test this, will keep you posted.
>
> Anatoli
>
> On Wed, Oct 17, 2012 at 7:47 PM, Ian Kelly <(E-Mail Removed)> wrote:
>> On Wed, Oct 17, 2012 at 8:07 AM, Anatoli Hristov <(E-Mail Removed)> 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(ComputerNamePhy sicalDnsHostname,
>> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Change computername Dennis Lee Bieber Python 0 10-18-2012 05:45 PM
Re: Change computername Chris Angelico Python 0 10-18-2012 10:13 AM
Re: Change computername Anatoli Hristov Python 0 10-18-2012 06:41 AM
Re: Change computername Ian Kelly Python 0 10-17-2012 05:47 PM
Change computername Anatoli Hristov Python 0 10-17-2012 02:07 PM



Advertisments