WMI

Changing Windows computer name from CLI

1. Using WMI

WMIC computersystem where caption='currentname' rename newname

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\administrator>wmic computersystem where caption='OLDNAME' rename NEWNAME
Executing (\\F204\ROOT\CIMV2:Win32_ComputerSystem.Name="F204")->rename()
Method execution successful.
Out Parameters:
instance of __PARAMETERS
{
        ReturnValue = 0;
};

C:\Users\administrator>

Subscribe to WMI