Jump to content

Recommended Posts

Posted

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 = 1

Const ForWriting = 2

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.OpenTextFile("C:\Scripts\Text.txt", ForReading)

strText = objFile.ReadAll

objFile.Close

strNewText = Replace(strText, "Jim ", "James ")

Set objFile = objFSO.OpenTextFile("C:\Scripts\Text.txt", ForWriting)

objFile.WriteLine strNewText

objFile.Close

----------------------------------------------------------------------------------

then I use the Winnt32.exe to install the Windows XP and with the /unattend:c:\temp\input.txt

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


Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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