fragbert Posted February 28, 2009 Share Posted February 28, 2009 (edited) This is driving me nuts as to why my simple run.cmd set to execute during FirstLogonCommands is not running like it should. I moulded my autounattend.xml after bobtheknob's hereAfter Vista SP1 installs and fails to run the run.cmd, I manually set the runsync command for appsroot and then run the run.cmd and it works flawlessly on the desktop!Getting these xml's done right is all about syntax and obviously I'm missing something simple. Help please! <?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">- <UserData>- <ProductKey> <Key>*******************************</Key> <WillShowUI>OnError</WillShowUI> </ProductKey> <AcceptEula>true</AcceptEula> <FullName>Fragbert</FullName> </UserData>- <DiskConfiguration>- <Disk wcm:action="add">- <CreatePartitions>- <CreatePartition wcm:action="add"> <Type>Primary</Type> <Order>1</Order> <Extend>true</Extend> </CreatePartition> </CreatePartitions> <DiskID>0</DiskID> <WillWipeDisk>true</WillWipeDisk> </Disk> </DiskConfiguration>- <ImageInstall>- <OSImage>- <InstallTo> <DiskID>0</DiskID> <PartitionID>1</PartitionID> </InstallTo> <InstallToAvailablePartition>false</InstallToAvailablePartition> <WillShowUI>OnError</WillShowUI> </OSImage> </ImageInstall> </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> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-US</UserLocale> </component> </settings>- <settings pass="specialize">- <component name="Microsoft-Windows-Security-Licensing-SLC-UX" 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"> <SkipAutoActivation>true</SkipAutoActivation> </component>- <component name="Microsoft-Windows-Deployment" 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 /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:\AppsRoot.txt SETX AppsRoot %i: -m"</Path> <Description>Detection CDROM</Description> </RunSynchronousCommand> </RunSynchronous> </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">- <AutoLogon>- <Password> <Value>*************************</Value> <PlainText>false</PlainText> </Password> <Enabled>true</Enabled> <LogonCount>2</LogonCount> <Username>Administrator</Username> </AutoLogon>- <OOBE> <HideEULAPage>true</HideEULAPage> <NetworkLocation>Home</NetworkLocation> <ProtectYourPC>1</ProtectYourPC> <SkipMachineOOBE>true</SkipMachineOOBE> <SkipUserOOBE>true</SkipUserOOBE> </OOBE> <TimeZone>Eastern Standard Time</TimeZone> - <FirstLogonCommands>- <SynchronousCommand wcm:action="add"> <CommandLine>%AppsRoot%install\run.cmd</CommandLine> <Description>Install Programs</Description> <Order>1</Order> </SynchronousCommand> </FirstLogonCommands> <RegisteredOrganization>Owner</RegisteredOrganization> <RegisteredOwner>Owner</RegisteredOwner> </component>- <component name="Microsoft-Windows-International-Core" 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"> <InputLocale>0409:00000409</InputLocale> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-US</UserLocale> </component> </settings> <cpi:offlineImage cpi:source="wim:d:/vista/iso/sources/install.wim#Windows Vista ULTIMATE" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> </unattend>My simple test run.cmd running a 7zip 64bit install, and two switchless installers I made for the citrix client and office2007Echo..........Install 7-zipstart /wait %AppsRoot%install\7-zip\7z465-x64.msi /passiveEcho..........Install Citrixstart /wait %AppsRoot%install\Citrix\ICA.exeEcho..........Install Officestart /wait %AppsRoot%install\Office\O2K7.EXEEcho..........Finishedshutdown -r -c "Rebooting To Finish Setup." Edited February 28, 2009 by fragbert Link to comment Share on other sites More sharing options...
maxXPsoft Posted February 28, 2009 Share Posted February 28, 2009 move the AppsRoot cmd <Order>1</Order> to oobeSystem before the run.cmd <Order>2</Order> should cure that. Link to comment Share on other sites More sharing options...
fragbert Posted February 28, 2009 Author Share Posted February 28, 2009 (edited) move the AppsRoot cmd <Order>1</Order> to oobeSystem before the run.cmd <Order>2</Order> should cure that.Nope, nothing changed. End result is a desktop logged in as administrator with nothing else happening.Here's my current xml with the change you suggested: <?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">- <UserData>- <ProductKey> <Key>********************</Key> <WillShowUI>OnError</WillShowUI> </ProductKey> <AcceptEula>true</AcceptEula> <FullName>Fragbert</FullName> </UserData>- <DiskConfiguration>- <Disk wcm:action="add">- <CreatePartitions>- <CreatePartition wcm:action="add"> <Type>Primary</Type> <Order>1</Order> <Extend>true</Extend> </CreatePartition> </CreatePartitions> <DiskID>0</DiskID> <WillWipeDisk>true</WillWipeDisk> </Disk> </DiskConfiguration>- <ImageInstall>- <OSImage>- <InstallTo> <DiskID>0</DiskID> <PartitionID>1</PartitionID> </InstallTo> <InstallToAvailablePartition>false</InstallToAvailablePartition> <WillShowUI>OnError</WillShowUI> </OSImage> </ImageInstall> </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> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-US</UserLocale> </component> </settings>- <settings pass="specialize">- <component name="Microsoft-Windows-Security-Licensing-SLC-UX" 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"> <SkipAutoActivation>true</SkipAutoActivation> </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">- <AutoLogon> <Enabled>true</Enabled> <LogonCount>2</LogonCount> <Username>Administrator</Username> </AutoLogon>- <Display> <ColorDepth>32</ColorDepth> <HorizontalResolution>1024</HorizontalResolution> <VerticalResolution>768</VerticalResolution> </Display>- <OOBE> <HideEULAPage>true</HideEULAPage> <NetworkLocation>Home</NetworkLocation> <ProtectYourPC>1</ProtectYourPC> <SkipMachineOOBE>true</SkipMachineOOBE> <SkipUserOOBE>true</SkipUserOOBE> </OOBE> <TimeZone>Eastern Standard Time</TimeZone> - <FirstLogonCommands>- <SynchronousCommand wcm:action="add"> <CommandLine>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:\AppsRoot.txt SETX AppsRoot %i: -m"</CommandLine> <Description>Detection CDROM</Description> <Order>1</Order> </SynchronousCommand>- <SynchronousCommand wcm:action="add"> <CommandLine>%AppsRoot%install\run.cmd</CommandLine> <Description>Install Programs</Description> <Order>2</Order> </SynchronousCommand> </FirstLogonCommands> <RegisteredOrganization>Owner</RegisteredOrganization> <RegisteredOwner>Owner</RegisteredOwner> </component>- <component name="Microsoft-Windows-International-Core" 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"> <InputLocale>0409:00000409</InputLocale> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-US</UserLocale> </component> </settings> <cpi:offlineImage cpi:source="wim:d:/vista/iso/sources/install.wim#Windows Vista ULTIMATE" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> </unattend> Edited February 28, 2009 by fragbert Link to comment Share on other sites More sharing options...
maxXPsoft Posted March 1, 2009 Share Posted March 1, 2009 (edited) %AppsRoot%install\run.cmdno backslash%AppsRoot%\install\run.cmdI also don't use that setx, would have to be installed to system32Try this in a .cmd file with your dvd inserted with the AppsRoot.txt. I actually look for a Folder on the Dvd that is not present on any other.FOR %%d IN (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) DO IF EXIST %%d\Install SET AppsRoot=%%dSETThats 2 lines there, SET is 2nd linefrom the Set cmd AppsRoot=e:Now you can remove the SET cmd Edited March 1, 2009 by maxXPsoft Link to comment Share on other sites More sharing options...
Arrow22 Posted March 1, 2009 Share Posted March 1, 2009 You have to be careful of the complexity of the first logon commandsalso, if the UAC is still on, you will have even more problems Link to comment Share on other sites More sharing options...
fragbert Posted March 1, 2009 Author Share Posted March 1, 2009 You have to be careful of the complexity of the first logon commandsalso, if the UAC is still on, you will have even more problemsEcho..........Install 7-zipstart /wait %AppsRoot%install\7-zip\7z465-x64.msi /passiveEcho..........Install Citrixstart /wait %AppsRoot%install\Citrix\ICA.exeEcho..........Install Officestart /wait %AppsRoot%install\Office\O2K7.EXEEcho..........Finishedshutdown -r -c "Rebooting To Finish Setup."This is complex? You kidding me?Also if you'll notice the Administrator account is autologging in, so UAC does not come into play here. Link to comment Share on other sites More sharing options...
fragbert Posted March 1, 2009 Author Share Posted March 1, 2009 %AppsRoot%install\run.cmdno backslash%AppsRoot%\install\run.cmdAre you saying that I SHOULD add a backslash? Link to comment Share on other sites More sharing options...
Arrow22 Posted March 1, 2009 Share Posted March 1, 2009 You have to be careful of the complexity of the first logon commandsalso, if the UAC is still on, you will have even more problemsEcho..........Install 7-zipstart /wait %AppsRoot%install\7-zip\7z465-x64.msi /passiveEcho..........Install Citrixstart /wait %AppsRoot%install\Citrix\ICA.exeEcho..........Install Officestart /wait %AppsRoot%install\Office\O2K7.EXEEcho..........Finishedshutdown -r -c "Rebooting To Finish Setup."This is complex? You kidding me?Also if you'll notice the Administrator account is autologging in, so UAC does not come into play here.I personally(probably not doing it right) cannot get First logon commands to work in OOBEThe command line parameters kept getting screwed up. So I used a batch file.Single command, no spaces to get confusing... Link to comment Share on other sites More sharing options...
fragbert Posted March 1, 2009 Author Share Posted March 1, 2009 You have to be careful of the complexity of the first logon commandsalso, if the UAC is still on, you will have even more problemsEcho..........Install 7-zipstart /wait %AppsRoot%install\7-zip\7z465-x64.msi /passiveEcho..........Install Citrixstart /wait %AppsRoot%install\Citrix\ICA.exeEcho..........Install Officestart /wait %AppsRoot%install\Office\O2K7.EXEEcho..........Finishedshutdown -r -c "Rebooting To Finish Setup."This is complex? You kidding me?Also if you'll notice the Administrator account is autologging in, so UAC does not come into play here.I personally(probably not doing it right) cannot get First logon commands to work in OOBEThe command line parameters kept getting screwed up. So I used a batch file.Single command, no spaces to get confusing...If you were paying attention to this thread, I am doing the same thing (a single script command). Link to comment Share on other sites More sharing options...
maxXPsoft Posted March 1, 2009 Share Posted March 1, 2009 (edited) You have to be careful of the complexity of the first logon commandsalso, if the UAC is still on, you will have even more problemsIn my Sig FirstLogonCommandsRuns without the UACEDIT:BTW, I mount my image and move Install folder to root of Image so when Image is laid down the Install becomes C:\Install, D:\Install or whatever drive is selected. Thats easiest for me cause I don't have to do the For loop, just call %systemdrive%\Install\any.cmd, reg, vbs Edited March 1, 2009 by maxXPsoft Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now