berci Posted November 14, 2006 Posted November 14, 2006 I use the setupmgr.exe to create a answer file, it's name is input.txt.but , I modify the "ComputerName=test" to "ComputerName=XXXNAMEXXX". then I use the HTA script to modify the "XXXNAMEXXX" to the name that I need.the script is :----------------------------------------------------------------------------------Const ForReading = 1Const ForWriting = 2Set objFSO = CreateObject("Scripting.FileSystemObject")Set objFile = objFSO.OpenTextFile("C:\Scripts\Text.txt", ForReading)strText = objFile.ReadAllobjFile.ClosestrNewText = Replace(strText, "Jim ", "James ")Set objFile = objFSO.OpenTextFile("C:\Scripts\Text.txt", ForWriting)objFile.WriteLine strNewTextobjFile.Close----------------------------------------------------------------------------------then I use the Winnt32.exe to install the Windows XP and with the /unattend:c:\temp\input.txtAt last, I found that the PC's name is not the name that I wrote to the input.txt, the windows create a new name by itself.I don't know why.
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