Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Windows 7 Sysprep VBS Script Help

28 Jan 2011   #1
jokerZwild

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, 81 views)
My System SpecsSystem Spec
.

01 Feb 2011   #2
jokerZwild

XP and Windows 7
 
 

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

 Windows 7 Sysprep VBS Script Help




Thread Tools





Similar help and support threads
Thread Forum
Sysprep.exe+script=fatal error
I ran the script in this tutorial (the .pdf) and I keep getting a fatal error. Anyone have any ideas? This is th efirst time I have used the Audit Mode and System Preparation Tool. I'm going to walk away for the evening and see what the morning brings. Yes I have checked and rechecked the...
Installation & Setup
Sysprep - Windows 7 - unable to sysprep image that joins domain
Good morning all: Below is my unattend.xml. I am using the sysprep + win7 for creating virtual machines in Red Hat Enterprise Virtualization 3.0 but having difficulty getting them to auto-join the domain. My sysprep progression proceeds normally and completes. The initial boot of the image...
Virtualization
win7 after sysprep reboot always with sysprep box
hello, 1st sorry for my english (i'm french guy). I made a sysprep and all parameters are corrects. but after the reboot I have always the sysprep preparation tools box. for me the sysprep is correct but I don't know what's happended. in attachment my unattend.xml
Installation & Setup
Do you really need to sysprep a Windows 7 machine?
Hi, I work in a community college and I we image tons of PCs for classrooms and labs etc. I had been imaging all those labs with sysprep when we were using Windows XP. Now that we are using Windows 7, we decided not to use sysprep as my seniors said its not required if we are using Windows 7....
Installation & Setup
Sysprep help for Windows 7
Hi, We have created a Syspreped image of windows 7 with all the drivers that we need, I have some questions:- 1) When we install the image on a new PC, it doesn't keep the Video driver, I have got around that by putting the install files in C:\temp and then running, is there a way to keep the...
Installation & Setup
Windows 7, Ghost and Sysprep.
I could use some advice on using preparing a Windows 7 Pro image using Ghost GSS 2.5. I have downloaded a demo of GSS 2.5 to test. I have used BartPE and Ghost 8.3 to image hundreds of machines running XP Pro for years without fail, but this Windows 7 process has my head spinning. Am I...
Installation & Setup

Our Sites

Site Links

About Us

Find Us

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

All times are GMT -5. The time now is 20:56.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App