Jump to content

Recommended Posts

Posted (edited)

I am new to using the autounattend file so be patient with me :)

After being successful with the autounattend on Win7 I recently wanted to run a batch file at the first logon to automate some things so I added the FirstLogonCommands section.

I added it to the:

<settings pass="oobeSystem">    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="AMD64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="NonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

section and the:

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

section right below it.

I thought this would only run once for x86 and once for x64 but tries to run twice. As a test I removed one and it only ran once. What was interesting is if I removed the AMD64 one and left the X86 one and installed a x64 Win7 it still ran.

Is the FirstLogonCommands only supposed to be in there once?

 

I have it just set for x86 and eveything seems to be working ok, x86 and x64. Is that ok to leave like that?

 

Here is the whole file if that helps (I removed the passwords, so if it looks weird that is why):


<?xml version="1.0" encoding="utf-8"?><unattend xmlns="urn:schemas-microsoft-com:unattend"><settings pass="windowsPE"> <component name="Microsoft-Windows-Setup" processorArchitecture="AMD64" 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 /q /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:\FIRADISK\LOADISO.CMD  cmd /k %i:\FIRADISK\LOADISO.cmd"</Path>    <Description>Detecting usb drive</Description>   </RunSynchronousCommand> </RunSynchronous> <DiskConfiguration>                <WillShowUI>OnError</WillShowUI>                <Disk>                    <CreatePartitions>                        <CreatePartition>                            <Order>1</Order>                            <Size>100</Size>                            <Type>Primary</Type>                        </CreatePartition>                        <CreatePartition>                            <Order>2</Order>                            <Type>Primary</Type>                            <Extend>true</Extend>                        </CreatePartition>                    </CreatePartitions>                    <ModifyPartitions>                        <ModifyPartition>                            <Order>1</Order>                            <PartitionID>1</PartitionID>                            <Format>NTFS</Format>                            <Active>true</Active>                        </ModifyPartition>                        <ModifyPartition>                            <Order>2</Order>                            <PartitionID>2</PartitionID>                            <Format>NTFS</Format>                        </ModifyPartition>                    </ModifyPartitions>                    <DiskID>0</DiskID>                    <WillWipeDisk>true</WillWipeDisk>                </Disk> </DiskConfiguration>           <ImageInstall><OSImage><InstallTo><DiskID>0</DiskID><PartitionID>2</PartitionID></InstallTo><WillShowUI>OnError</WillShowUI></OSImage></ImageInstall>      <UserData>        <ProductKey>          <Key />          <WillShowUI>OnError</WillShowUI>        </ProductKey>        <AcceptEula>true</AcceptEula>      </UserData></component><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"> <RunSynchronous>  <RunSynchronousCommand wcm:action="add">   <Order>1</Order>    <Path>cmd /q /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:\FIRADISK\LOADISO.CMD  cmd /k %i:\FIRADISK\LOADISO.cmd"</Path>    <Description>Detecting usb drive</Description>   </RunSynchronousCommand> </RunSynchronous> <DiskConfiguration>                <WillShowUI>OnError</WillShowUI>                <Disk>                    <CreatePartitions>                        <CreatePartition>                            <Order>1</Order>                            <Size>100</Size>                            <Type>Primary</Type>                        </CreatePartition>                        <CreatePartition>                            <Order>2</Order>                            <Type>Primary</Type>                            <Extend>true</Extend>                        </CreatePartition>                    </CreatePartitions>                    <ModifyPartitions>                        <ModifyPartition>                            <Order>1</Order>                            <PartitionID>1</PartitionID>                            <Format>NTFS</Format>                            <Active>true</Active>                        </ModifyPartition>                        <ModifyPartition>                            <Order>2</Order>                            <PartitionID>2</PartitionID>                            <Format>NTFS</Format>                        </ModifyPartition>                    </ModifyPartitions>                    <DiskID>0</DiskID>                    <WillWipeDisk>true</WillWipeDisk>                </Disk> </DiskConfiguration>           <ImageInstall><OSImage><InstallTo><DiskID>0</DiskID><PartitionID>2</PartitionID></InstallTo><WillShowUI>OnError</WillShowUI></OSImage></ImageInstall>      <UserData>        <ProductKey>          <Key />          <WillShowUI>OnError</WillShowUI>        </ProductKey>        <AcceptEula>true</AcceptEula>      </UserData></component><component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="AMD64" 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>0409:00000409</InputLocale>      <UserLocale>en-US</UserLocale>      <UILanguage>en-US</UILanguage>      <SystemLocale>en-US</SystemLocale>    </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>0409:00000409</InputLocale>      <UserLocale>en-US</UserLocale>      <UILanguage>en-US</UILanguage>      <SystemLocale>en-US</SystemLocale>    </component>  </settings>  <settings pass="oobeSystem">    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="AMD64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="NonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">      <UserAccounts>        <LocalAccounts>          <LocalAccount wcm:action="add">            <Name>PsychIS</Name>            <Group>Administrators</Group>            <Password>              <PlainText>true</PlainText>            </Password>          </LocalAccount>        </LocalAccounts>        <AdministratorPassword>        </AdministratorPassword>      </UserAccounts>      <AutoLogon>        <Password>        </Password>        <Enabled>true</Enabled>        <LogonCount>1</LogonCount>        <Username>Administrator</Username>      </AutoLogon>      <OOBE>        <NetworkLocation>Work</NetworkLocation>        <HideEULAPage>true</HideEULAPage>        <ProtectYourPC>1</ProtectYourPC>        <HideWirelessSetupInOOBE>false</HideWirelessSetupInOOBE>      </OOBE>      <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>      <TimeZone>Eastern Standard Time</TimeZone>  <FirstLogonCommands>                <SynchronousCommand wcm:action="add">                    <CommandLine>cmd /q /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:\copyzen.bat  cmd /k %i:\copyzen.bat"</CommandLine>                    <Description>CopyZenBatch</Description>                    <Order>1</Order>                    <RequiresUserInput>false</RequiresUserInput>                </SynchronousCommand>   </FirstLogonCommands>    </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">      <UserAccounts>        <LocalAccounts>          <LocalAccount wcm:action="add">            <Name>PsychIS</Name>            <Group>Administrators</Group>            <Password>              <PlainText>true</PlainText>            </Password>          </LocalAccount>        </LocalAccounts>        <AdministratorPassword>        </AdministratorPassword>      </UserAccounts>      <AutoLogon>        <Password>        </Password>        <Enabled>true</Enabled>        <LogonCount>1</LogonCount>        <Username>Administrator</Username>      </AutoLogon>      <OOBE>        <NetworkLocation>Work</NetworkLocation>        <HideEULAPage>true</HideEULAPage>        <ProtectYourPC>1</ProtectYourPC>        <HideWirelessSetupInOOBE>false</HideWirelessSetupInOOBE>      </OOBE>      <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>      <TimeZone>Eastern Standard Time</TimeZone>  <FirstLogonCommands>                <SynchronousCommand wcm:action="add">                    <CommandLine>cmd /q /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:\copyzen.bat  cmd /k %i:\copyzen.bat"</CommandLine>                    <Description>CopyZenBatch</Description>                    <Order>1</Order>                    <RequiresUserInput>false</RequiresUserInput>                </SynchronousCommand>   </FirstLogonCommands>    </component>  </settings>  <settings pass="specialize">    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="AMD64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="NonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">            <RegisteredOwner>Default</RegisteredOwner>            <RegisteredOrganization>Default</RegisteredOrganization>            <ComputerName>*</ComputerName>    </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">            <RegisteredOwner>Default</RegisteredOwner>            <RegisteredOrganization>Default</RegisteredOrganization>            <ComputerName>*</ComputerName>    </component>  </settings></unattend>

Thanks,

Scott

Edited by swindmiller

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...