Solved

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

Posted on 2009-04-02
6
1,304 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

911 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