Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; '"win32"': 0.09; 'effect.': 0.09; 'success:': 0.09; 'cc:addr:python-list': 0.10; '"0"': 0.16; 'oct': 0.16; 'posted.': 0.16; 'rights,': 0.16; 'subject:Change': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'admin': 0.18; '>>>': 0.18; 'windows': 0.19; 'module': 0.19; 'import': 0.21; 'received:209.85.214.174': 0.21; 'ctypes': 0.22; 'cc:2**0': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'url:mailman': 0.29; 'url:python': 0.32; 'url:listinfo': 0.32; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'url:org': 0.36; 'test': 0.36; 'thank': 0.36; 'does': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'received:209.85.214': 0.39; 'hello,': 0.39; 'header:Received:5': 0.40; 'help': 0.40; 'url:mail': 0.40; 'success': 0.63; 'skip:w 60': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sDZDC2+V24GKt05K9PdmJKilTEJRpWjwiywiaV3YMNI=; b=dZVsu7oKpySgpHOiZ2ew6oSZApAKVfanmPpsYI5IlWzbWVtgluUibcZfeiLbdmIRH1 VM+KqxZKLclHaesKj8AO5KV6hmqYqwCNCccR/CHNkCK+kWp+KHW35PQbjQIt3TzCwVda nWFtMawhYnEmkxBt/t9mM22macH/oJcUvnlrjSS2FAfBABUqKnApPLFz7VgDd/3Q96fK LoPvx5u2G28Oo20D/ngNWR5m7DddtYQoAVl4ltS6FsXc/c4olrXjf9GBPhik8Gt/CB1H kFISrzJXEE4IwvZXxqbWvR4sAuGHLfPpvRe07/Z2ZCiQTeE9cvp7tCwtYmnJ5nFrpb8t srWQ== MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 18 Oct 2012 10:22:55 +0200 Subject: Re: Change computername From: Anatoli Hristov To: Ian Kelly Content-Type: text/plain; charset=UTF-8 Cc: Python X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1350548578 news.xs4all.nl 6904 [2001:888:2000:d::a6]:39563 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31609 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 wrote: > 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