From LedHed's Wiki
Revision as of 03:25, 22 July 2013 by Ledhed (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Wmic ComputerSystem WHERE Name=%ComputerName% call Rename Name="New-Hostname"

Use double quotes if the hostname has a dash ( - ) in it. This method also also accepts environment variables.