mikaelsnavy Posted April 19, 2007 Share Posted April 19, 2007 I need a batch script to change the computer name with a input that the user who is running the script types in. My idea is to use regedit to export the key which has the computer name, replace it with the input, and then re-import it. Any ideas??? Thanks, Mikael Link to comment https://www.neowin.net/forum/topic/554846-batch-file-change-computer-name/ Share on other sites More sharing options...
mastermate Posted April 19, 2007 Share Posted April 19, 2007 http://www.tek-tips.com/viewthread.cfm?qid...1953&page=2 This link contains a vbscript to rename a computer but warns that if you are in a domain using AD more needs to be done. Link to comment https://www.neowin.net/forum/topic/554846-batch-file-change-computer-name/#findComment-588491189 Share on other sites More sharing options...
mikaelsnavy Posted April 19, 2007 Author Share Posted April 19, 2007 Thanks a lot! Link to comment https://www.neowin.net/forum/topic/554846-batch-file-change-computer-name/#findComment-588491389 Share on other sites More sharing options...
[deXter] Posted April 20, 2007 Share Posted April 20, 2007 You can do it using a .bat file too, its just two lines! @echo off SET /P PCNAME=Please enter your name: REG ADD HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName /v ComputerName /t REG_SZ /d %PCNAME% /f Link to comment https://www.neowin.net/forum/topic/554846-batch-file-change-computer-name/#findComment-588493185 Share on other sites More sharing options...
Recommended Posts