Windows 7 Forums


Windows 7: Windows 7 Sysprep VBS Script Help

28 Jan 2011   #1

XP and Windows 7
 
 
Windows 7 Sysprep VBS Script Help

I am setting up an Image for Windows 7 and using WAIK and everything. I have a script file that prompts PC name, domain name and user name and password to join domain. I want to make it to where the password is NOT shown while typing. Any suggestions?
Thanks in advance.

here is the VBS script file info

Option Explicit
Dim answer, answer2, answer3, answer4, computerName, domainname, domainAdminName, 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
domainName = InputBox("Enter the Domain Name :", "Domain Name")
answer2 = MsgBox("Is this correct?" & vbCrLf & "Domain Name: " & domainName, vbYesNo, "Verify Name")
Loop

Do While answer3 <> vbYes
domainAdminName = InputBox("Enter the Domain Admin Name :", "Domain Admin Name")
answer3 = MsgBox("Is this correct?" & vbCrLf & "Domain Admin Name: " & domainAdminname, vbYesNo, "Verify Name")
Loop

Do While answer4 <> vbYes
domainAdminPass = InputBox("Enter the Domain Admin Password :", "Domain Admin Password")
answer4 = MsgBox("Is this correct?" & vbCrLf & "Domain Admin Password: " & domainAdminPass, vbYesNo, "Verify Password")
Loop
I want to make the text invisible when I type the password in.



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", domainName)
strContents = Replace(strContents, "ReplaceMe3", domainAdminName)
strContents = Replace(strContents, "ReplaceMe4", 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
Attached Files
File Type: vbs EditUnattend - good.vbs (2.1 KB, 78 views)
My System SpecsSystem Spec

01 Feb 2011   #2

XP and Windows 7
 
 

Is this in the wrong forum?
My System SpecsSystem Spec
Reply

 Windows 7 Sysprep VBS Script Help problems?



Thread Tools



Similar help and support threads for: Windows 7 Sysprep VBS Script Help
Thread Forum
Sysprep - Windows 7 - unable to sysprep image that joins domain Virtualization
Sysprep hell: sysprep windows setup could not configure windows to run Installation & Setup
win7 after sysprep reboot always with sysprep box Installation & Setup
I Need Help To Reorder The Context Menu Script In Script Form? Customization
script error when running a vbs script. Network & Sharing


All times are GMT -5. The time now is 02:41 AM.


Seven Forums Android App Seven Forums IOS App Follow us on Facebook

Windows 7 Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows 7" and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32