ElmerBeFuddled Posted December 5, 2012 Posted December 5, 2012 (edited) This is the first time I've played with the $OEM$ folder and I'm getting lost!!I'm trying to run a setupcomplete.cmd to add five updates that never seem to take (for me) and some reg files.I've realised that HKCU needs to go after first logon so I'm trying to get setupcomplete.cmd to add a runonceex key that will launch firstlogon.cmd. But nothing seems to be working!These are my ( crappy?? ) files:setupcomplete.cmd@echo offSET "LOGFILE=%systemdrive%\SetUp Install.log"WUSA Windows6.1-KB2533552-x64.msu /QUIET /NORESTARTWUSA Windows6.1-KB917607-x64.msu /QUIET /NORESTARTWUSA Windows6.1-KB2592687-x64.msu /QUIET /NORESTARTWUSA Windows6.1-KB2603229-x64.msu /QUIET /NORESTARTRegedit /s "ALMERCONS x64.reg"Regedit /s "#1.reg"Regedit /s "#2.reg"Regedit /s "#3.reg"Regedit /s "#4.reg"Regedit /s "RunOnce.reg"RunOnce.regWindows Registry Editor Version 5.00SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "User Reg Entries" "C:\Windows\Setup\Scripts\firstlogon.cmd" /fREG ADD %KEY% /v Flags /t REG_DWORD /d "20" /fI added the updates into firstlogon as they don't appear after running the setupcomplete. Obviously if setupcomplete isn't running correctly then firstlogon won't be running!! All the HKCU entries from the above reg files are in the below reg filesfirstlogon.cmd@echo offWUSA Windows6.1-KB2533552-x64.msu /QUIET /NORESTARTWUSA Windows6.1-KB917607-x64.msu /QUIET /NORESTARTWUSA Windows6.1-KB2592687-x64.msu /QUIET /NORESTARTWUSA Windows6.1-KB2603229-x64.msu /QUIET /NORESTARTdel /q /f /a:h "C:\Users\Public\Desktop\desktop.ini"del /q /f /a:h "C:\Users\Elmer B. Fuddled\Desktop\desktop.ini"Regedit /s "User ALMERCONS x64.reg"Regedit /s "User #1.reg"Regedit /s "User #2.reg"Regedit /s "User #3.reg"Regedit /s "User #4.reg"Now. No laughing too loud, I know where you live!! :w00t: EDIT:I also believe I can run the firstlogon from the autounattend but that'd probably lose me even more Edited December 5, 2012 by ElmerBeFuddled Quote
ElmerBeFuddled Posted December 6, 2012 Author Posted December 6, 2012 (edited) Well I've had a change of heart and decided to try and run from the autounattend.xml. That wouldn't work at all (the xml) to start with, it was only when I was going to add a number to the name end I noticed a space between the 'attend' and '.xml' !!!!So the first logon does what it should when I run it manually, the xml does what it should EXCEPT launching the firstlogon.cmd file.autounattend.xml<?xml version="1.0" encoding="utf-8"?><unattend xmlns="urn:schemas-microsoft-com:unattend"><settings pass="windowsPE"> <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>0809:00000809</InputLocale> <SystemLocale>en-GB</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-GB</UserLocale> </component> <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"> <Diagnostics> <OptIn>false</OptIn> </Diagnostics> <DynamicUpdate> <Enable>false</Enable> <WillShowUI>onerror</WillShowUI> </DynamicUpdate> <EnableFirewall>true</EnableFirewall> <UserData> <AcceptEula>true</AcceptEula> <FullName>Elmer B. Fuddled</FullName> <Organization>FEELGOOD-iNC</Organization> </UserData> </component></settings><settings pass="specialize"><component name="Microsoft-Windows-Security-SPP-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-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"> <ComputerName>FEELGOOD-iNC</ComputerName> <TimeZone>GMT Standard Time</TimeZone> </component> <component name="Microsoft-Windows-IE-InternetExplorer" 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"> <DisableOOBAccelerators>true</DisableOOBAccelerators> <DisableFirstRunWizard>true</DisableFirstRunWizard> <EnableLinksBar>false</EnableLinksBar> <Home_Page>http://www.carrona.org/dvrref.php</Home_Page> <BlockPopups>yes</BlockPopups> <SuggestedSitesEnabled>false</SuggestedSitesEnabled> <PlaySound>false</PlaySound> <ShowInformationBar>true</ShowInformationBar> <ShowMenuBar>true</ShowMenuBar> </component></settings><settings pass="oobeSystem"> <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"> <!--ORIGINAL InputLocale>0809:00000809</InputLocale> <SystemLocale>en-GB</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-GB</UserLocale--> <SystemLocale>en-GB</SystemLocale> <UILanguage>en-GB</UILanguage> <UserLocale>0809:00000809</UserLocale> </component> <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"> <TimeZone>GMT Standard Time</TimeZone> <OOBE> <HideEULAPage>true</HideEULAPage> <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> <NetworkLocation>Home</NetworkLocation> <ProtectYourPC>3</ProtectYourPC> </OOBE> <AutoLogon> <Password> <Value /> </Password> <Enabled>false</Enabled> <Username>Elmer B. Fuddled</Username> </AutoLogon> <UserAccounts> <LocalAccounts> <LocalAccount wcm:action="add"> <Password> <Value /> </Password> <DisplayName>Elmer B. Fuddled</DisplayName> <Name>Elmer B. Fuddled</Name> <Group>Administrators</Group> </LocalAccount> </LocalAccounts> </UserAccounts> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Order>1</Order> <CommandLine>cmd /C %windir%\Setup\Scripts\FirstLogon.cmd</CommandLine> <Description>Run FirstLogon.cmd</Description> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> </FirstLogonCommands> </component></settings></unattend><!--Customized by myselfidem. For Windows 7 AIO all images--><!--OS to install and Disk Configuration dialog boxes will be displayed.-->Any pointers?OFF TOPIC. BTW myselfidem, I'm loving your setproductkey file! By adding a pause before it unmounts gives me a chance to drop all my folders into the image Edited December 6, 2012 by ElmerBeFuddled Quote
ricktendo Posted December 6, 2012 Posted December 6, 2012 Did you look in the %windir%\Setup\Scripts dir and confirm that firstlogon.cmd is copied?If it is you dont need to add it to the xml Quote
ElmerBeFuddled Posted December 6, 2012 Author Posted December 6, 2012 You can ignore both posts now! I managed to get both cmd files to run at last!!Lets just say I need new glasses, I struggle to see the difference between $ and % on the keyboard on these dark nights! Quote
ElmerBeFuddled Posted December 6, 2012 Author Posted December 6, 2012 Did you look in the %windir%\Setup\Scripts dir and confirm that firstlogon.cmd is copied?If it is you dont need to add it to the xmlI'll try that with the Mk2 set up I've been running! Quote
ccl0 Posted December 18, 2012 Posted December 18, 2012 this is slightly off topic but i can't for the life of me locate the 'sources' folder on a pre-installed system. Quote
bphlpt Posted December 18, 2012 Posted December 18, 2012 Why would it be on an installed system, unless you specifically copied it there? It should still be on your install media. Cheers and Regards Quote
ccl0 Posted December 18, 2012 Posted December 18, 2012 (edited) actually i thought the oem folder was copied on all oem installs. i guess not (and explains why i could not find it lol) i was trying to find a copy of my certificate..i figured it would be in an oem folder under sources?i didn't look on the recovery image. maybe its there. Edited December 18, 2012 by ccl0 Quote
AceMagoo Posted January 30, 2013 Posted January 30, 2013 I keep trying to use $OEM$ for Setupcomplete.cmd and files and setup never copies them over. If I put the scripts and files directly into Windows ==> Setup ==> Scripts in the WIM they work fine. In the “sources” folder (the same folder the install wim is in) I have the following folder structure: $OEM$ ==> $$ ==> Setup ==> Scripts (sources\$OEM$\$$\Setup\Scripts\). I am expecting them to be copied to Windows\Setup\Scripts\ but they are not. System is x64, OS is Win 7 SP1 Ultimate or HomePremium (X17-59465). I have tested this with VMPlayer using the install from iso file option and installing to VHD using a USB stick and neither copies the files over. Is there something else I need to do to make this copy over? Everything I have read on the net seems to indicate that this happens automatically. I thought maybe VM was interfering with a $OEM$ that took precedence but then I had the same problem with VHD.What am I missing or what would cause Setup not to copy the contents of $OEM$ to the drive the OS is being installed on? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.