Windows hostname change fails in recent versions of Cygwin (since 1.7.28)

Wedge Jarrad wedge.jarrad@gmail.com
Mon Apr 14 22:28:00 GMT 2014


Hello all,

The following command used to allow me to change the hostname of a Windows
machine:

wmic computersystem where name=\"$COMPUTERNAME\" call rename name=newname

With new installs of Cygwin this seems to have stopped working. Installs from
as recently as mid January of this year seem to work however by early March it
no longer seemed to work. Last known good version (as reported by uname -r) is
1.7.27(0.271/5/3). Known not working by 1.7.28(0.271/5/3). Doesn't work on the
version that I installed last week either (1.7.29(0.272/5/3)). Using 64-bit
versions in all cases. Appears to be a problem on 64-bit versions of Windows 7
and 8. Have not tested on other versions of Windows.

Output from working system:

$ wmic computersystem where name=\"$COMPUTERNAME\" call rename name=newname
Executing (\\OLDNAME\ROOT\CIMV2:Win32_ComputerSystem.Name="OLDNAME")->rename()
Method execution successful.
Out Parameters:
instance of __PARAMETERS
{
        ReturnValue = 0;
};

And indeed the hostname is changed to "newname" after a reboot.

Output received on nonworking system:

$ wmic computersystem where name=\"$COMPUTERNAME\" call rename name=newname
Executing (\\OLDNAME\ROOT\CIMV2:Win32_ComputerSystem.Name="OLDNAME")->rename()
Method execution successful.
Out Parameters:
instance of __PARAMETERS
{
        ReturnValue = 87;
};

Despite the fact that it says that the method execution was successful, the
ReturnValue indicates that it has actually encountered an error. Upon reboot
the hostname remains as it was before running the command.

The same command, when run from the native windows cmd.exe shell works as
expected. Executing the command with cmd /c also results in failure. As far as
I can tell nothing has changed on my end except for the Cygwin version. Same
version of Windows (installed from the same disc).

If anyone can confirm this as a bug in Cygwin (as opposed to user error on my
part), or, better yet, suggest a workaround I'd be most appreciative.

Attached is 'cygcheck -s -v -r' output from a non-working system.

-Jarrad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 20655 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20140414/a5bac912/attachment.obj>
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list