This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Attachment: cygcheck.out
Description: Binary data

--
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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]