- User ID
- 1
- Joined
- 7 Jan 2019
- Messages
- 1,416
- Reaction score
- 97
- Points
- 48
For any reason, if you need to rename Windows computer name from the command line, here's the command:
Example output:
For the change to take effect, restart the computer using the command:
I tested running the commands above from ScreenConnect v21.4.2455.7731, and it worked as expected.
Code:
WMIC computersystem where name="%computername%" call rename name="NewComputerName"
Example output:
Code:
C:\WINDOWS\system32>WMIC computersystem where name="OldComputerName" call rename name="NewComputerName"
Executing (\\OldComputerName\ROOT\CIMV2:Win32_ComputerSystem.Name="OldComputerName")->rename() Method execution successful. Out Parameters: instance of __PARAMETERS { ReturnValue = 0; };
Code:
C:\WINDOWS\system32>shutdown /r /t 0