Solved

How can i change the computer's name and workgroup in a batch file?

Posted on 2009-04-02
6
1,338 Views
Last Modified: 2012-05-06
I am writing a batch file to automate some simple task on install and I can't find anything to change the computer name or workgroup on the local system just ones to change them in a domain which we are not using. Any help would be great Oh and setting the DNS suffixes would be a great help too.
0
Comment
Question by:glenwdri
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 21

Expert Comment

by:AmazingTech
ID: 24053286
Not too sure how to change the workgroup name at the moment.

You'll need to reboot for this to take effect.
:ChangeComputerName
 
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName" /v "ComputerName" /t REG_SZ /f /d "NewName"
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters" /v "NV Hostname" /t REG_SZ /f /d "NewName"
 
 
:DNS SerachList
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters" /v "SearchList" /t REG_SZ /f /d "Domain.com,Domain2.com"

Open in new window

0
 

Author Comment

by:glenwdri
ID: 24053295
I need to does this without the windows domain controller or anything involving the windows domain.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Author Comment

by:glenwdri
ID: 24053329
AmaizingTech
Can I use 127.0.0.1 for the old computer name or is this something I leave and only set the "new name" part to what I want the name to be?
0
 
LVL 21

Accepted Solution

by:
AmazingTech earned 250 total points
ID: 24054269
Just change the 2 occurances of NewName

Or we can set a variable so you only need to so it once.

Not sure what you're going to use 127.0.0.1 for this needs to be run on the workstation.
Set NewName=Computer1
 
:ChangeComputerName
 
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName" /v "ComputerName" /t REG_SZ /f /d "%NewName%"
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters" /v "NV Hostname" /t REG_SZ /f /d "%NewName%"

Open in new window

0
 

Author Comment

by:glenwdri
ID: 24054738
I figured that out. Thanks
Now all i need to the workgroup setting
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
I wrote this article to explain some important DNS concepts that should be known to avoid some typical configuration errors I often see in forums. I assume that what is described here is the typical behavior of Microsoft DNS client. I don't know …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

615 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