Jump to content

Set computer name at startup


Recommended Posts

Now that I have my customized Windows CD using nLite, RyanVM updates, and Bashrats driverpaks I would like to take things a step further. I use the same disk on several machines and therefore set * as the computer name in winnt.sif. It would be nice if there was some way to enter the computer name as soon as it boots from CD.

Any ideas???

Slacker

Link to comment
Share on other sites


the only method I can think of (and the only one I've seen working) is to create a ram drive, copy the winnt.sif to the ram drive, write a batch script which prompts the user for the machine name and writes it back to the winnt.sif

I'll be looking at doing this myself once the rest of the CD has been created (don't hold your breath!)

Link to comment
Share on other sites

I use a program called "WISCON.exe". ;) I run this file at the very last stage of setup, right before cleanup.cmd is run and the comp reboots. WISCON is just a program that allows you to set the comp name, user name, set up user account, etc. Very simple program, but effective. Check it out!!! :thumbup

Get it here B)

Link to comment
Share on other sites

Here is the script that i use:

usage: chown.vbs [computer name (optional)]

if a name is passed it sets it and continues on, reboot still required.

if a aname is not passed it displays the current name in a text box and asks to set a new one, it will not go away until OK is pressed or someone kills the vbscript process from the task manager.

There is more here than is really needed but whats less than 1k when you're dealing with 700mb or 4.7gb.

'ChgOwn.vbs - Change Winxp Registered Owner/Organization.

Option Explicit

set args = WScript.Arguments


Set ws = WScript.CreateObject("WScript.Shell")
Dim args, ws, t,  p2, p3, p4, p5, n, j, h, f, k, cj
Dim itemtype,num

num=args.count
if num<>0 then cj=args.Item(0)

p2 = "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ComputerName\"
p3 = "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\"
p4 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\"
p5 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\"


j = ws.RegRead(p2 & "ComputerName")
h = ws.RegRead(p3 & "NV Hostname")
f = ws.RegRead(p4 & "ComputerName")
k = ws.RegRead(p5 & "NV Hostname")


t = "Compuer Name Change Utility"
if num=0 then
  do
     cj = InputBox("Type new Computer name and click OK", t, j)
  loop while cj=""
end if

If cj <> "" Then
ws.RegWrite p2 & "ComputerName", cj
ws.RegWrite p3 & "NV Hostname", cj
ws.RegWrite p4 & "ComputerName", cj
ws.RegWrite p5 & "NV Hostname", cj
End If

Link to comment
Share on other sites

  • 4 weeks later...

Rob325's idea sounds like what I would like to do. The other options, don't offer much advantage to me over what I already have.

My logic is...

1: Put the CD in and boot from it

2: Wait a minute or so, then put in the Computer Name

3: Go surfing (in the ocean) and forget all about what I was working on

4: Come home to a 100% configured PC

Rob- Since you have seen it working, could you give me some more ideas on what to do next?

Lets assume that I can somehow boot from CD and run a batch file that asks the computer name.

Next thing to do is copy winnt.sif to the ramdrive and modify it by changing the computer name.

What do I do now?

Assuming my hard drive is not formatted, how do initiate Windows setup and point it to the modified winnt.sif file?

Any ideas would be greatly appreciated,

Slacker

Link to comment
Share on other sites

in the process of doing it myself. Basically my autoexec.bat calls env_config.bat which has 2 main purposes:

1) ask what size hdd so it can configure the corporate specified partition sizes then pass this to gdisk (symantec's CLI fdisk equivalent)

2) asks for the computername to pass back to setup

Item 1 is fairly straightforward and wasn't asked for so I'll not go into that here.

Item 2 runs pretty much like this:

Sets up RAMDrive as eg: drive R:

Copy winnt.sif to r: drive

Display explanatory text asking for asset number in required format ie "Please enter the 6-character tag ie. PC12345"

Take inputted characters and enter into r:\winnt.sif

Exit back to autoexec.bat to launch setup using r:\winnt.sif as the answer file

This is obviously a high level overview which you have probably already figured out (apologies if this is the case).

Once I've got a working script I'll post it up.

This feature has so many possibilities eg:

adding computer to domain after specifying name

having various 'template' winnt.sif files and copy whichever one fits to the r: drive before adding the computer name

I've yet to attempt to use template runonceex files in a simliar manner as i'm not sure if it would be possible to modify them then call them.

Thinking about it, you could do that by:

using the pre-setup script AFTER creating the various partitions specify which runonceex file you want and copy it to the c: drive and have cmdlines.txt look at the c: drive rather than copy it over during oempreinstall. This would allow for some hardware variances in your runonceex (ie applying mobile office software for laptops but not for desktops) or you could do this by setting flag files and using runonceex to call a cmd which does an 'if exist' query..

hmmmmm......

sorry for going off on a unrelated ramble by the way - it happens all the time when i start thinking of things.........

Link to comment
Share on other sites

sorry - looking at your post again you can launch setup with various switches and define a path to the sif

unfortunately I can't get a budget code assigned to this work yet where i work so I'm doing it (slowly) in my spare time which is taking forver. If you can hang on I'll post up a working script. I'll also dig for any usefull syntaxes you'll need.

Link to comment
Share on other sites

Rob,

Thanks for the update. Scripts or syntaxes needed would be much appreciated as my knowledge is limited it this area. This may be the future of unattended Windows CD's.

What good is an unattended setup CD that requires you to enter settings one hour after you start it? Maybe I'm just lazy, but I think we are on to something here.

Thanks,

Slacker

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