Jump to content

Need help debugging my Sysprep.xml file please


Recommended Posts

I have it all working, even activation except the program install on first login.

There seems to be an error in the vb script which I cannot locate

here is my post in the scripting section of the forum.

Hello

You can take a look here:

Link to comment
Share on other sites


That's my thread from a few weeks back that is how I created the script. It comes up with an error in Line 1 position 1 as I put in my thread in the scripting forum

Hello :rolleyes:

For your file "ClaraLaptop.vbs" you need to use cscript.exe!

I've tested with no error and works fine.


<RunSynchronousCommand wcm:action="add">
<Path>cscript.exe c:\windows\ClaraLaptop.vbs</Path>
<Order>4</Order>
</RunSynchronousCommand>

Like cluberti gives you:


' Get the SMBIOS asset tag from the Win32_SystemEnclosure class
Option Explicit
Dim strComputer, strChassis
Dim objWMIService, objInstance, objResults, objItem
Dim bIsLaptop, bIsDesktop, bIsServer, bIsVirtual, sAssetTag, objShellApp, isRunning
bIsLaptop = False
bIsDesktop = False
bIsServer = False
bIsVirtual = False

RunMeWithCScript()

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set objResults = objWMIService.ExecQuery( _
"SELECT * FROM Win32_SystemEnclosure",,48)

For Each objInstance in objResults
If objInstance.ChassisTypes(0) = 12 or objInstance.ChassisTypes(0) = 21 Then
' Ignore docking stations
Else
If Not IsNull(objInstance.SMBIOSAssetTag) Then
sAssetTag = Trim(objInstance.SMBIOSAssetTag)
End If
Select Case objInstance.ChassisTypes(0)
Case "2"
bIsVirtual = True
Case "8", "9", "10", "11", "12", "14", "18", "21"
bIsLaptop = True
Case "3", "4", "5", "6", "7", "15", "16"
bIsDesktop = True
Case "23"
bIsServer = True
Case Else
' Do nothing
End Select
End If
Next

If bIsVirtual = False Then
Set objShellApp = CreateObject("WScript.Shell")
Set isRunning = objShellApp.Exec("msiexec /i C:\WINDOWS\Clara.msi /passive /norestart")
End If


Sub RunMeWithCScript()
Dim ScriptEngine, engineFolder, Args, arg, scriptName, argString, scriptCommand

ScriptEngine = UCase(Mid(WScript.FullName, InstrRev(WScript.FullName, "\") + 1))
engineFolder = Left(WScript.FullName, InstrRev(WScript.FullName, "\"))
argString = ""
'WScript.Echo ScriptEngine

If ScriptEngine = "WSCRIPT.EXE" Then
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Set Args = WScript.Arguments

For Each arg in Args 'loop though argument array as a collection to rebuild argument string
If InStr(arg, " ") > 0 Then arg = """" & arg & """" 'If the argument contains a space wrap it in double quotes
argString = argString & " " & Arg
Next

'Create a persistent command prompt for the cscript output window and call the script with its original arguments
scriptCommand = "cmd.exe /k " & engineFolder & "cscript.exe """ & WScript.ScriptFullName & """" & argString

Shell.Run scriptCommand, , False
WScript.Quit
Else
Exit Sub 'Already Running with Cscript Exit this Subroutine
End If
End Sub

Thanks to cluberti for his nice work! :thumbup

Edited by myselfidem
Link to comment
Share on other sites

Got everything working.

Now How do I modify the sysprep32.xml

To make it work for my 64 bit builds?

Nice :P

You can make the same process explained here with a Windows 7 x64 Professional!

See also, example here:

http://blog.brianleejackson.com/sysprep-a-windows-7-machine-start-to-finish

http://www.brianleejackson.com/download/7_sysprep/7_enterprise_x64_sysprep.xml

Check your file "sysprep64.xml" with WSIM and validate it!

Enjoy!

Link to comment
Share on other sites

I created the sysprep64.xml file but it gives a parse error in the windows-shell-setup section, and goes into the continual loop and never finishes the process.

Can you take a look to see where the error might be

Hello :P


<AutoLogon>
<Enabled>true</Enabled>
<LogonCount>5</LogonCount>
<Username>Administrator</Username>
<Password>
<Value>xxxxxx</Value>
<PlainText>false</PlainText>
</Password>
</AutoLogon>


<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<PlainText>false</PlainText>
<Value>xxxxxx</Value>
</Password>
<Group>Administrators</Group>
<DisplayName>myselfidem</DisplayName>
<Name>myselfidem</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>

Link to comment
Share on other sites

I created the sysprep64.xml file but it gives a parse error in the windows-shell-setup section, and goes into the continual loop and never finishes the process.

Can you take a look to see where the error might be

Hello :P


<AutoLogon>
<Enabled>true</Enabled>
<LogonCount>5</LogonCount>
<Username>Administrator</Username>
<Password>
<Value>xxxxxx</Value>
<PlainText>false</PlainText>
</Password>
</AutoLogon>


<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<PlainText>false</PlainText>
<Value>xxxxxx</Value>
</Password>
<Group>Administrators</Group>
<DisplayName>myselfidem</DisplayName>
<Name>myselfidem</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>

I still seem to be have problem with my sysprep.xml file for my 64 bit builds. It gives a parsing error on the specialize pass of the Windows shell setup section. I went through it with a fine tooth comb and don't see the problem can an expert here take a look and tell me where I went wrong?

sysprep64NOKEYS.xml

Edited by clivebuckwheat
Link to comment
Share on other sites

I am not an expert, but I try to give some help

Maybe you can try this:

<InputLocale>0409:00000409</InputLocale>

And this:no space inside %ProgramFiles(x86)%


<SynchronousCommand wcm:action="add">
<CommandLine>cscript //b "%ProgramFiles(x86)%\Microsoft Office\Office14\ospp.vbs" /inpkey:PRODUCT KEY</CommandLine>
<Order>4</Order>
<RequiresUserInput>false</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cscript //b "%ProgramFiles(x86)%\Microsoft Office\Office14\ospp.vbs" /act</CommandLine>
<Order>5</Order>

More help here:

http://blog.brianleejackson.com/sysprep-a-windows-7-machine-%E2%80%93-start-to-finish-v2 (Step #11 and #12)

I hope that will help you!

Edited by myselfidem
Link to comment
Share on other sites

Well that solved that it was the space the office activation I seem to have no parsing error anymore. On the system I am running the sysprep process on I have 3 languages installed

1. English(us) Default

2. English (Canada)

3. French (Canada)

After Syprep is done I seem to only have English(US), I need to keep all 3 what am I doing wrong?

sysprep64NOPK.txt

Link to comment
Share on other sites

The language packs are only available for Windows 7 Ultimate and Enterprise!

http://support.micro...kb/972813/en-us

How to add Language Interface Packs.

To install a LIP in an unattended Windows installation:

http://technet.microsoft.com/en-us/library/dd799270(WS.10).aspx

I hope that will help you!

Edited by myselfidem
Link to comment
Share on other sites

Sincerely, I think the best way is to upgrade your Windows version 7 Professional to Windows 7 Ultimate if you want absolutly add those language packs!

I've made some search on the Web and I see there is some methods, but it's at your own risk!

For the sysprep method I havn't tested and I don't use this method for me.

Some help for To add a language pack using DISM

Edited by myselfidem
Link to comment
Share on other sites

Clive, after considering all of your posts about Win7 builds since this one, it seems likely that your assistance is due to needing to finish and deploy these images for an employer. If I'm correct, I would very strongly suggest you not put your employer's installations of Windows 7 in an unsupported state by doing this. It would be better to use either the Enterprise or Ultimate SKUs - yes, Professional can be hacked (as can any version) to install LIPs fairly easily, but it's not supported by Microsoft officially - and if/when this employer may ever try to get support from Microsoft on one of these builds, and they see you're using a LIP on a Professional SKU, they're going to refuse to help you until you remove it. I'm not sure it's worth the hassle to do this to ~450 machines when there are easier (supported) ways to do it with a different SKU of the OS. If your employer can afford Win7 across 450+ PCs, they can afford to purchase the correct version they need if they need multiple languages on a single install.

If I'm wrong and this is just for your own personal machine(s), feel free to hack away to your heart's content and ignore everything prior to this line ;).

Link to comment
Share on other sites

@clivebuckwheat

Of course, I suggest you to upgrade the "Windows 7 professionnel" because I've seen that your are working inside an enterprise!

If you want add some language packs for your personnal use, as cluberti said, you can.

You can download the language packs here:

Language Packs x86 and x64

If you want convert .exe files to .cab files, you can use a program made by Blue4603 and download it at the layout:

exe2cab.exe

Method:

How to

Add local packs:

Add and remove local packs

More help here:

Tutorial

http://technet.microsoft.com/en-us/library/dd755995(WS.10).aspx

I hope that will help you!

Edited by myselfidem
Link to comment
Share on other sites

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