Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-04-02
6
Medium Priority
?
1,363 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
  • 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
WatchGuard Case Study: Museum of Flight

“With limited money and limited staffing, we didn’t have a lot of choices in terms of what we could do to bring efficiency. WatchGuard played a central part in changing that.” To provide strong, secure Wi-Fi access within the museum, Hunter chose to deploy WatchGuard’s AP120 APs.

 

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 1000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

There have been a lot of times when we have seen the need to enter a large number of DNS entries in a forward lookup zone. The standard procedure would be to launch the DNS Manager console, create the Zone and start adding new hosts using the New…
AutoHotkey is an excellent, free, open source programming/scripting language for Windows. It started out as a keyboard/mouse macros product, but has expanded into a robust language. This article provides an introduction to it, with links to addition…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month12 days, 5 hours left to enroll

916 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