change computer name using bat file?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • venuvasavi
    New Member
    • Jan 2012
    • 13

    change computer name using bat file?

    Hi,

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


    Thanks in Advance,
    VASAVIVENU
  • venuvasavi
    New Member
    • Jan 2012
    • 13

    #2
    I find the solution,

    crate batfile like sysname.bat and then place this code,
    Code:
    SET /P PCNAME=Please enter your name: 
    REG ADD HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName /v ComputerName /t REG_SZ /d %PCNAME% /f
    REG ADD HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName\ /v ComputerName /t REG_SZ /d %PCNAME% /f
    REG ADD HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ /v Hostname /t REG_SZ /d %PCNAME% /f
    REG ADD HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ /v "NV Hostname" /t REG_SZ /d %PCNAME% /f
    @echo off
    echo Please Restart your computer Manually. The Program will exit now.
    echo. 
    echo.
    Thanks,

    Comment

    • Marcussk
      New Member
      • Jul 2012
      • 4

      #3
      Originally posted by venuvasavi
      I find the solution,

      crate batfile like sysname.bat and then place this code,
      Code:
      SET /P PCNAME=Please enter your name: 
      REG ADD HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName /v ComputerName /t REG_SZ /d %PCNAME% /f
      REG ADD HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName\ /v ComputerName /t REG_SZ /d %PCNAME% /f
      REG ADD HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ /v Hostname /t REG_SZ /d %PCNAME% /f
      REG ADD HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ /v "NV Hostname" /t REG_SZ /d %PCNAME% /f
      @echo off
      echo Please Restart your computer Manually. The Program will exit now.
      echo. 
      echo.
      Thanks,
      U could also add following code to the end:
      shutdown -s -f -t 15
      that way u wont need to "echo please restart manually"

      Comment

      Working...