Jump to content

hostname in unattend.txt


Recommended Posts

I have an environement variable (%COMP%) which by means of scripting/couple programs I've written obtains the current machines hostname.

Is it possible to pass this into Windows 2000 and XP unattended installations to make them use this environement variable as it's Computer Name?

Can I just inside unattend.txt go

ComputerName=%COMP%

?

Thanks

Link to comment
Share on other sites


An answer file only takes pre-existing values, you just can't make up answer file settings. In general you probably can only use preexisting values, although i guess it's possible you could make up variables, never tried it.

If you want to make an environment variable permanent use the setx command, which is documented and is also documented on my site (winpesetup.bat).

-gosh

Link to comment
Share on other sites

You can use preset variables like %windir% but you're talking about custom variables like %comp%. It all depends on when you set the variable, and if you can use that variable in the answer file. Some answer file settings, such as setting the theme file, don't allow certain variables like %windir%. Ref.chm could give you examples of that. You will need to use trial and error.

-gosh

Link to comment
Share on other sites

where would it get the variable from anyway? are you using a dos section before you start installing windows?

if you are, why not make a batch file that will generate the winnt.sif for you?

example:

@echo off
set /p comp=Enter a computer name:  
type winnt_1.sif > winnt.sif
echo ComputerName=%comp% >>winnt.sif
type winnt_2.sif >>winnt.sif

where winnt_1.sif and winnt_2.sif are chunks of the original winnt.sif file, before and after the line we are adding... you can do this for any of the variables in winnt.sif if you want... it will work just the same...

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