• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1565
  • Last Modified:

Change Computer Name via Command Prompt

Is there a command that i can use to change my computer name via the command prompt? I have command prompt remote access to a computer and was wondering if its possible to change the computer name with just command prompt.
0
Allanore
Asked:
Allanore
1 Solution
 
tomcahillCommented:
You can do it using NetDom.

Here is how you get it on a Windows 7 machine:
1.Install the Remote Server Administration Tools (RSAT).
2.Go to Control Panel -> Programs and Features -> Turn Windows features on or off
3.In the treeview, go to Remote Server Administration Tools -> Role Administration Tools -> AD DS and AD LDS Tools and select AD DS Tools. Click OK.

Then use this article for renaming from a command line:
http://support.microsoft.com/kb/298593

If you don't have the ability to get NetDom loaded then I think you're out of luck.
0
 
Justin YeungSenior Systems EngineerCommented:
http://mystuff.clarke.co.nz/MyStuff/wsname.asp

you can use wsname to change machine name via command prompt.

or use vbs to change

'
Set objWMIService = GetObject("Winmgmts:root\cimv2")
For Each objComputer in _
    objWMIService.InstancesOf("Win32_ComputerSystem")

        Return = objComputer.rename(Name,Password,Username)
        If Return <> 0 Then
        Else
           WScript.Echo "Rename succeeded." & _
               " Reboot for new name to go into effect"
        End If

Next
'
0
 
Seaton007Commented:
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now