By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,148 Members | 779 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,148 IT Pros & Developers. It's quick & easy.

change computer name using bat file?

P: 13
Hi,

using bat file how can i change computer name?
for windows xp systems.


Thanks in Advance,
VASAVIVENU
Apr 19 '12 #1
Share this Question
Share on Google+
2 Replies


P: 13
I find the solution,

crate batfile like sysname.bat and then place this code,
Expand|Select|Wrap|Line Numbers
  1. SET /P PCNAME=Please enter your name: 
  2. REG ADD HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName /v ComputerName /t REG_SZ /d %PCNAME% /f
  3. REG ADD HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName\ /v ComputerName /t REG_SZ /d %PCNAME% /f
  4. REG ADD HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ /v Hostname /t REG_SZ /d %PCNAME% /f
  5. REG ADD HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ /v "NV Hostname" /t REG_SZ /d %PCNAME% /f
  6. @echo off
  7. echo Please Restart your computer Manually. The Program will exit now.
  8. echo. 
  9. echo.
Thanks,
Apr 21 '12 #2

P: 4
@venuvasavi
U could also add following code to the end:
shutdown -s -f -t 15
that way u wont need to "echo please restart manually"
Jul 24 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.