User Tools

Site Tools


computing:windows:rename_pc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
computing:windows:rename_pc [2017/09/01 08:37]
gcooper created
computing:windows:rename_pc [2021/09/14 10:54] (current)
gcooper
Line 9: Line 9:
 <file> <file>
 wmic computersystem where caption='currentname' rename 'newname' wmic computersystem where caption='currentname' rename 'newname'
 +</file>
  
 +Then reboot to activate the new hostname:
 +
 +<file>
 shutdown -r -t 0 shutdown -r -t 0
 +</file>
 +
 +WHS script:
 +
 +<file>
 +Set objWMIService = GetObject("Winmgmts:root\cimv2")
 +
 +For Each objComputer in _
 +    objWMIService.InstancesOf("Win32_ComputerSystem")
 +
 +    objComputer.rename "NewComputerName", NULL, NULL 
 +Next
 </file> </file>
computing/windows/rename_pc.1504276677.txt.gz · Last modified: 2017/09/01 08:37 by gcooper