June 1, 200917 yr Hi,I created a basic autounattend.xml for Windows 7 RC that works fine. But when I wanted to install some applications and some registry tweaks and use the FirstLogonCommands. Windows Setup install fine without any errors find in the setup logs. I tried severals times without any success. Nothing gets install. Can someone take a look at it and see what I'm doing wrong?I use this guide from this lHere my autounattend.xml<?xml version="1.0" encoding="utf-8"?><unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="windowsPE"> <component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <UserData> <ProductKey> <WillShowUI>OnError</WillShowUI> <Key>GG4MQ-MGK72-HVXFW-KHCRF-KW6KY</Key> </ProductKey> <AcceptEula>true</AcceptEula> </UserData> <ImageInstall> <OSImage> <InstallToAvailablePartition>false</InstallToAvailablePartition> <WillShowUI>OnError</WillShowUI> </OSImage> </ImageInstall> </component> <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SetupUILanguage> <UILanguage>en-US</UILanguage> </SetupUILanguage> <InputLocale>en-US</InputLocale> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-US</UserLocale> </component> </settings> <settings pass="oobeSystem"> <component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <InputLocale>en-US</InputLocale> <UILanguage>en-US</UILanguage> <SystemLocale>en-US</SystemLocale> <UserLocale>en-US</UserLocale> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <OOBE> <HideEULAPage>true</HideEULAPage> <NetworkLocation>Home</NetworkLocation> <ProtectYourPC>3</ProtectYourPC> </OOBE> <TimeZone>Pacific Standard Time</TimeZone> <AutoLogon> <Password> <Value>UABhAHMAcwB3AG8AcgBkAA==</Value> <PlainText>false</PlainText> </Password> <Enabled>true</Enabled> <LogonCount>1</LogonCount> <Username>Administrator</Username> </AutoLogon> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Order>1</Order> <CommandLine>%InstalDrive%\Install\Install.cmd</CommandLine> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>%InstalDrive%\Install\Cleanup.cmd</CommandLine> <Order>2</Order> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>%InstalDrive%\Install\Registry_Tweaks\Install.cmd</CommandLine> <Order>3</Order> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>%InstalDrive%\Install\Shutdown.cmd</CommandLine> <Order>4</Order> </SynchronousCommand> </FirstLogonCommands> </component> </settings> <settings pass="specialize"> <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SkipAutoActivation>true</SkipAutoActivation> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ComputerName>AngelPC</ComputerName> </component> <component name="Microsoft-Windows-Deployment" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <RunSynchronous> <RunSynchronousCommand wcm:action="add"> <Order>1</Order> <Path>cmd /c "FOR %i IN (C D E F G H I J K L N M O P Q R S T U V W X Y Z) DO IF EXIST %i:\InstallDrive.txt SETX InstallDrive %i:\ -m"</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Order>2</Order> <Path>cmd /c reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f</Path> </RunSynchronousCommand> </RunSynchronous> </component> </settings> <cpi:offlineImage cpi:source="wim:f:/sources/install.wim#Windows 7 ULTIMATE" xmlns:cpi="urn:schemas-microsoft-com:cpi" /></unattend>I added two RunSynchronousCommand in the specialize pass to set the driver letter for the Install folder and turn off the UAC. <RunSynchronous> <RunSynchronousCommand wcm:action="add"> <Order>1</Order> <Path>cmd /c "FOR %i IN (C D E F G H I J K L N M O P Q R S T U V W X Y Z) DO IF EXIST %i:\InstallDrive.txt SETX InstallDrive %i:\ -m"</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Order>2</Order> <Path>cmd /c reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f</Path> </RunSynchronousCommand> </RunSynchronous>Next, I set the autoogin as follows: <AutoLogon> <Password> <Value>UABhAHMAcwB3AG8AcgBkAA==</Value> <PlainText>false</PlainText> </Password> <Enabled>true</Enabled> <LogonCount>1</LogonCount> <Username>Administrator</Username> </AutoLogon>Finally, I add four FirstLogonCommands commands to install applications, import registry, cleanup and shutdown computer. <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Order>1</Order> <CommandLine>%InstalDrive%Install\Install.cmd</CommandLine> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>%InstalDrive%Install\Cleanup.cmd</CommandLine> <Order>2</Order> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>%InstalDrive%Install\Registry_Tweaks\Install.cmd</CommandLine> <Order>3</Order> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>%InstalDrive%Install\Shutdown.cmd</CommandLine> <Order>4</Order> </SynchronousCommand> </FirstLogonCommands>The Install.cmd looks like this:CLS@ECHO OFFTITLE "INSTALLATION"REM --------------------------------------------------------REM APPLICATIONSECHO Installing NOTEPAD2ECHO.START /WAIT %InstallDrive%\Install\Notepad2\Install_Unattend_Win7.cmdECHO VISUAL C++ RUNTIMESECHO.START /WAIT %InstallDrive%\Install\Visual_C_Runtimes\Install_Unattend.cmdEXITAny help would be gratefully appreciated.Kenneth Edited June 1, 200917 yr by magic12kenneth
June 2, 200917 yr '%InstalDrive%' is not recognized as an internal or external command,operable program or batch file.%systemdrive%\Install
June 2, 200917 yr Author '%InstalDrive%' is not recognized as an internal or external command,operable program or batch file.%systemdrive%\InstallAhh... I somehow have missed that. I'll try again and see what happen. Thanks.Kenneth
June 3, 200917 yr Actually it's easier than that You've named the Environment Variable for your source disk to %InstallDrive% but you're calling your FirstLogonCommands from %InstalDrive%. There's an l missing.
June 4, 200917 yr Author Thanks Skauneboy. After correcting that mistakes, everything works now. Now, if I can import the registry tweaks into the default profile.Any suggestions?Kenneth
June 9, 200917 yr For registry tweaks I'm using (in Vista as well) SetupComplete.cmd inside Windows\Setup\Scripts.You will need to create the Scripts folder. In SetupComplete.cmd I call extras.cmd which is placed in the root on the wim image and does the registry tweaks, among other things.Windows will automatically execute it after finishing the setup, just before the last reboot.
May 2, 201115 yr Save starting a new thread, how can I start a command following the last reboot? I presently use setupcomplete.cmd but finds halts the desktop setup until the reboot?
Create an account or sign in to comment