Bangers Posted May 27, 2004 Share Posted May 27, 2004 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 goComputerName=%COMP%?Thanks Link to comment Share on other sites More sharing options...
gosh Posted May 27, 2004 Share Posted May 27, 2004 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 More sharing options...
Bangers Posted May 27, 2004 Author Share Posted May 27, 2004 Sorry, I don't quite understand.I swear I have seen %VARS% inside answer files before... Link to comment Share on other sites More sharing options...
gosh Posted May 27, 2004 Share Posted May 27, 2004 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 More sharing options...
[BM]Crusher Posted May 27, 2004 Share Posted May 27, 2004 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 offset /p comp=Enter a computer name: type winnt_1.sif > winnt.sifecho ComputerName=%comp% >>winnt.siftype winnt_2.sif >>winnt.sifwhere 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now