Change Computer Name via Command Prompt

Posted on 2012-09-19
Last Modified: 2012-09-28
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.
Question by:Allanore
    LVL 9

    Expert Comment

    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:

    If you don't have the ability to get NetDom loaded then I think you're out of luck.
    LVL 14

    Expert Comment

    by:Justin Yeung

    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 _

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

    LVL 12

    Accepted Solution


    Featured Post

    Promote certifications in your email signature

    Has your company recently won an award or achieved a certification? They'll no doubt want to show it off. Email signature images used to promote certifications & awards can instantly establish credibility with a recipient and provide you with numerous benefits.

    Join & Write a Comment

    First some basics on Windows 7 Backup.  It has 2 components one is a file based backup which is stored in .zip files each zip is split at around 200 Megabytes and there is the Image Backup which is as the name implies a total image of the partition …
    This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
    The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
    The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now