Option Explicit Dim answer, answer2, computerName, domainAdminPass, unattendFile, WshShell, fso, unattendFileObject, strContents unattendFile = "C:\Windows\Panther\unattend.xml" Set WshShell = WScript.CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") Do While answer <> vbYes computerName = InputBox("Enter the desired Computer Name:", "Computer Name") answer = MsgBox("Is this correct?" & vbCrLf & "Computer Name: " & computerName, vbYesNo, "Verify Name") Loop Do While answer2 <> vbYes domainAdminPass = InputBox("Enter the Domain Admin Password :", "Domain Admin Password") answer2 = MsgBox("Is this correct?" & vbCrLf & "Domain Admin Password: " & domainAdminPass, vbYesNo, "Verify Password") Loop If fso.FileExists(unattendFile) = False Then wscript.echo "ERROR: Could not find the unattend file" Else 'Read the unattend file in and replace apprpriate variables Set unattendFileObject = fso.OpenTextFile(unattendFile, 1) strContents = unattendFileObject.ReadAll strContents = Replace(strContents, "ReplaceMe1", computerName) strContents = Replace(strContents, "ReplaceMe2", domainAdminPass) unattendFileObject.Close 'Write the updated contents back to the unattend file Set unattendFileObject = fso.OpenTextFile(unattendFile, 2) unattendFileObject.Write(strContents) unattendFileObject.Close End If ' Launch setup (will use the modified unattend.xml) WScript.Sleep 5000 WshShell.Run "%WINDIR%\System32\oobe\windeploy.exe", 0, True