Re: [python-win32] rename computer

2011-12-19 Thread Tim Golden
On 19/12/2011 14:32, Tim Golden wrote: import wmi c = wmi.WMI () for system in c.Win32_ComputerSystem (): system.Rename ("NEW-NAME", "TIM", "PASSWORD") For the record, the OP reported in private email that this solution works for him. TJG ___ pyt

Re: [python-win32] rename computer

2011-12-19 Thread cd
thanks genius it works !! > Message du 19/12/11 15:34 > De : "Tim Golden" > A : python-win32@python.org > Copie à : > Objet : Re: [python-win32] rename computer > > On 19/12/2011 14:20, cd wrote: > > import wmi > > c = wmi.WMI().Win32_C

Re: [python-win32] rename computer

2011-12-19 Thread Tim Golden
On 19/12/2011 14:20, cd wrote: import wmi c = wmi.WMI().Win32_ComputerSystem computer = c()[0] for propertyName in sorted( list( c.properties ) ): if propertyName == 'Name': print setattr( computer, propertyName, 'newname' ) Ah. I'm afraid, good as WMI is, it's not that good. You need to invok

Re: [python-win32] rename computer

2011-12-19 Thread cd
:\Python27\lib\site-packages\wmi.py", line 571, in __setattr__ handle_com_error () File "C:\Python27\lib\site-packages\wmi.py", line 241, in handle_com_error raise klass (com_error=err) wmi.x_wmi: > Message du 19/12/11 14:48 > De : "Tim Golden" > A : pyt

Re: [python-win32] rename computer

2011-12-19 Thread cd
thanks it works but I prefere to use a builtin" system call or somethings like this, in order to avoid invalid hostname. I hope wmi can valid hostname for me > Message du 19/12/11 14:31 > De : "Scott Leerssen" > A : "cd" > Copie à : > Ob

Re: [python-win32] rename computer

2011-12-19 Thread Tim Golden
On 19/12/2011 11:57, cd wrote: hello I didn't find any example of howto rename a windows computer with python ? i've tried with wmi unsuccessfully What did you try with WMI, and what happened? TJG ___ python-win32 mailing list python-win32@pyth

[python-win32] rename computer

2011-12-19 Thread cd
hello I didn't find any example of howto rename a windows computer with python ? i've tried with wmi unsuccessfully thanks for any halps Christophe ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/pyth