Solved

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

Posted on 2009-04-02
6
1,298 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 7

Expert Comment

by:computerfixins
ID: 24052199
0
 
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

One of the most often confused topics in the area DNS is the idea of GLUE records. Specifically, what they are, when they are needed, when they are provided, and how they are created. First, WHAT IS GLUE? To understand GLUE, you must first under…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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