Jump to content

Help: Script to rename a computer and edit the registry.


Recommended Posts

Hi Everyone,

Haven't been to the forums for a while but I'm glad to be back. The forums looks to have change somewhat but I'm sure the people here are still friendly. :thumbup

Situation: After imaging the system with a ghost image... we don't know what the computer will be named until its tied to another bigger machine by the serial port...:lol: However, once that information is found, we have to manually rename the computer and join it to what-ever workgroup.

Problem: Can or does someone have a script that asks what the new computer name will be and also modifies the registry to reflect a change in a program? I will give more details on what needs to be changed in the registry in a little bit... after finding out more information.

For now, I want to learn to create/or have a script that we can use in the initial deployment once its coupled to some other thing.

What should happen is that as we run this script or program.... it ask's

- What do you want the computer name?

We then type in "PC-100"

- What do you want the registry key changed to?

We then type in "100"

- Thanks for the information, please reboot to take effect.

We then press OK.

Shouldn't be too hard... Once I've figured out what needs to be changed in the registry, I'll post back.

Link to comment
Share on other sites


I found what needs to be altered in the registry. HKEY_CURRENT_USER/SOFTWARE/PROGRAM/ID

Type is REG_SZ

Data contains regular characters.....

I can edit the script to reflect the "program" and "id".

Thanks in advance.

Link to comment
Share on other sites

Change Computer name to: "Computer-(4 Random Numbers)" ->

WMIC ComputerSystem where Name="%ComputerName%" CALL RENAME Name="Computer-%RANDOM:~-4%"

Change Computers Domain or Workgroup ->

WMIC ComputerSystem where Name="%ComputerName%" CALL JoinDomainOrWorkgroup Name="WORKGROUP"
Edited by Outbreaker
Link to comment
Share on other sites

Doesn't matter... as-long semi technical people can understand, input 2 or 3 characters, and the script handles the rest.

I completed a little script earlier today so I'm off to test it.

Edited by Samio866
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...