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.


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