Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: Change computername (http://www.velocityreviews.com/forums/t953533-re-change-computername.html)

Anatoli Hristov 10-18-2012 06:41 AM

Re: Change computername
 
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(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



All times are GMT. The time now is 07:24 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.