Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 



maxXPsoft

Ask your Seven xml ? here

Recommended Posts

Octopuss    9

I unclearly remember I didn't use exit at all and it did work at some point in past... It's really weird.

When I use only start or start /wait, the batch files aren't even executed at all. I really don't understand the differences.

Share this post


Link to post
Share on other sites

maxXPsoft    27

Also, aren't they supposed to run one after another by design of synchronouscommand in the first place anyway?

yes but I figured you knew that by your <Order>

It takes experimenting to figure out exactly what you need for your particular files. Some things run or start a process and it switches causing the original cmd script to drop out.

I add Exit to all my cmd files.

I've never got the start to work consistently alone so I use the cmd /c start /wait

Share this post


Link to post
Share on other sites
Octopuss    9

That's what I've always used as well, and it always worked. I am not sure whether I tried launching batch files before, though. Must be that.

Maybe going only cmd /c would be sufficient? I am still trying to figure out the difference from start (/wait). Sometimes it's a huge mystery.

Share this post


Link to post
Share on other sites
Tripredacus    286

I always use exit, but I think if you use CMD /C with /WAIT but without the EXIT, the command prompt will stay on the screen with either a flashing cursor, or a C prompt after executing the script. This can also cause anything after it (in the chain of events) not work until the CMD is manually closed.

Share this post


Link to post
Share on other sites
maxXPsoft    27

cmd /c opens a new command prompt and executes the command given. Theres no waiting or nothing and it will leave a window open as Tripredacus said

/c Carries out the command specified by String and then stops. Reason to use the Exit in cmd files

/k Carries out the command specified by String and continues. If you want to wait till command finishes this won't work because it will start the command line and then move on to next

Start is actually a command by itself but doesn't work as intended so we use the cmd /c Start /wait together. Even this is not perfect for all things, I have had trouble with some Autoit scripts

Windows Command Reference still in use even on Windows 8 http://www.microsoft.com/en-us/download/details.aspx?id=2632

Edited by maxXPsoft

Share this post


Link to post
Share on other sites
Tripredacus    286

Max, I used your example to create an unattend to install a program in Audit Mode. I set the logon count to 1, and added a WillReboot to Always. The problem I have is that when you use that AuditSystem pass to create the user, it isn't temporary. I would really prefer that after the Audit Mode work is done, that it reboot back into the built-in Administrator account automatically, then I would need to delete that "Admin" account. Any ideas on how to accomplish this?

Edited by Tripredacus

Share this post


Link to post
Share on other sites
maxXPsoft    27

Why not go into Audit as the Administrator?

    <settings pass="specialize">
<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>
<Description>Enable Admin Account</Description>
<Path>net user administrator /active:yes</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>

Both Microsoft-Windows-Shell-Setup | Autologon and Microsoft-Windows-Shell-Setup | UserAccounts | AdministratorPassword sections are needed to auto logon to a computer in audit mode. Both of these settings should be added to the auditSystem configuration pass.

Share this post


Link to post
Share on other sites
Tripredacus    286

I had considered that... is there a way to disable that again and audit mode still work properly? :unsure:

I might even abandon this AuditSystem thing altogether...

Share this post


Link to post
Share on other sites
maxXPsoft    27

Audit is to set things up for all users I guess like an OEM would do with drivers and their Oem programs and such

I hadn't tried removing a user but then the things you done with them would Prob be a mess.

Share this post


Link to post
Share on other sites
Tomorrow    3

2 questions:

1. If my xml file does not touch the partitions (meaning i select the disk and format manually during install) then is there any other difference in the xml between installing in normal (MBR) or UEFI (GPT) mode?

2. About after inserting the DVD/USB and after the "Loading windows files" bar has completed part: i know i have a working xml but for some reason im still asked for language,currency and timezone at the beginning of the install. Is automating this part somehow more complicated?

Share this post


Link to post
Share on other sites
Tripredacus    286

2 questions:

1. If my xml file does not touch the partitions (meaning i select the disk and format manually during install) then is there any other difference in the xml between installing in normal (MBR) or UEFI (GPT) mode?

2. About after inserting the DVD/USB and after the "Loading windows files" bar has completed part: i know i have a working xml but for some reason im still asked for language,currency and timezone at the beginning of the install. Is automating this part somehow more complicated?

1. MBR and UEFI mode is determined by the boot method of the installation media.

2. Attach your XML file, but redact product key and any sensitive information such as login credentials or domain info, etc.

Share this post


Link to post
Share on other sites
Tomorrow    3

2 questions:

1. If my xml file does not touch the partitions (meaning i select the disk and format manually during install) then is there any other difference in the xml between installing in normal (MBR) or UEFI (GPT) mode?

2. About after inserting the DVD/USB and after the "Loading windows files" bar has completed part: i know i have a working xml but for some reason im still asked for language,currency and timezone at the beginning of the install. Is automating this part somehow more complicated?

1. MBR and UEFI mode is determined by the boot method of the installation media.

2. Attach your XML file, but redact product key and any sensitive information such as login credentials or domain info, etc.

<?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">
<InputLocale>0425:00000425;0409:00000409</InputLocale>
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<SystemLocale>et-EE</SystemLocale>
<UserLocale>et-EE</UserLocale>
<UILanguage>en-US</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
</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">
<ImageInstall>
<OSImage>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/IMAGE/NAME</Key>
<value>Windows 7 ULTIMATE</value>
</MetaData>
</InstallFrom>
<InstallToAvailablePartition>false</InstallToAvailablePartition>
<WillShowUI>OnError</WillShowUI>
</OSImage>
</ImageInstall>
<UpgradeData>
<Upgrade>false</Upgrade>
<WillShowUI>Never</WillShowUI>
</UpgradeData>
<ComplianceCheck>
<DisplayReport>OnError</DisplayReport>
</ComplianceCheck>
<DynamicUpdate>
<Enable>true</Enable>
<WillShowUI>Never</WillShowUI>
</DynamicUpdate>
<Diagnostics>
<OptIn>false</OptIn>
</Diagnostics>
<DiskConfiguration>
<WillShowUI>Always</WillShowUI>
</DiskConfiguration>
<UserData>
<AcceptEula>true</AcceptEula>
<FullName>ME</FullName>
</UserData>
</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">
<ComputerName>PHOENIX</ComputerName>
<ProductKey>removed</ProductKey>
<DoNotCleanTaskBar>false</DoNotCleanTaskBar>
<TimeZone>FLE Standard Time</TimeZone>
<CopyProfile>true</CopyProfile>
<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
<RegisteredOwner>ME</RegisteredOwner>
<VisualEffects>
<FontSmoothing>ClearType</FontSmoothing>
</VisualEffects>
</component>
<component name="Microsoft-Windows-powercpl" 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">
<PreferredPlan>8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c</PreferredPlan>
</component>
<component name="Microsoft-Windows-Printing-Spooler-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">
<RemoveMXDW>1</RemoveMXDW>
</component>
<component name="Microsoft-Windows-RemoteAssistance-Exe" 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">
<fAllowFullControl>false</fAllowFullControl>
<fAllowToGetHelp>false</fAllowToGetHelp>
</component>
<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-SystemRestore-Main" 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">
<DisableSR>1</DisableSR>
</component>
<component name="Microsoft-Windows-ErrorReportingCore" 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">
<DisableWER>1</DisableWER>
</component>
<component name="Microsoft-Windows-SQMApi" 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">
<CEIPEnabled>0</CEIPEnabled>
</component>
<component name="Security-Malware-Windows-Defender" 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">
<DisableAntiSpyware>true</DisableAntiSpyware>
</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>
<Description>Disable Automatic Pagefile Management</Description>
<Path>cmd /c wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Set pagefile to 200MB fixed size</Description>
<Path>cmd /c wmic pagefileset where name="c:\\pagefile.sys" set InitialSize=200,MaximumSize=200</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<Description>Disable DEP</Description>
<Path>bcdedit.exe /set {current} nx AlwaysOff</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>4</Order>
<Description>Hibernation Off</Description>
<Path>powercfg.exe -h off</Path>
</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">
<Themes>
<ThemeName>Aero Theme</ThemeName>
<DefaultThemesOff>false</DefaultThemesOff>
<WindowColor>Twilight</WindowColor>
</Themes>
<OEMInformation>
<HelpCustomized>false</HelpCustomized>
<SupportHours>24/7</SupportHours>
<SupportPhone></SupportPhone>
<Manufacturer>Custom</Manufacturer>
</OEMInformation>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<NetworkLocation>Home</NetworkLocation>
<ProtectYourPC>3</ProtectYourPC>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
</OOBE>
<UserAccounts>
<AdministratorPassword>
<Value>Administrator</Value>
<PlainText>true</PlainText>
</AdministratorPassword>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Name>ME</Name>
<Group>Administrators</Group>
<Password>
<Value>UABhAHMAcwB3AG8AcgBkAA==</Value>
<PlainText>false</PlainText>
</Password>
<DisplayName>ME</DisplayName>
<Description>ME</Description>
</LocalAccount>
<LocalAccount wcm:action="add">
<Name>ME2</Name>
<Group>Administrators</Group>
<Password>
<Value>UABhAHMAcwB3AG8AcgBkAA==</Value>
<PlainText>false</PlainText>
</Password>
<DisplayName>ME2</DisplayName>
<Description>ME2</Description>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<AutoLogon>
<Password>
<Value>password2</Value>
<PlainText>false</PlainText>
</Password>
<Enabled>true</Enabled>
<LogonCount>99999</LogonCount>
<Username>ME</Username>
</AutoLogon>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Disable Automatic Pagefile Management</Description>
<CommandLine>cmd /c wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False</CommandLine>
<RequiresUserInput>false</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Set pagefile to 200MB fixed size</Description>
<CommandLine>cmd /c wmic pagefileset where name="c:\\pagefile.sys" set InitialSize=200,MaximumSize=200</CommandLine>
<RequiresUserInput>false</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>3</Order>
<Description>Disable DEP</Description>
<CommandLine>bcdedit.exe /set {current} nx AlwaysOff</CommandLine>
<RequiresUserInput>false</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>4</Order>
<Description>Hibernation Off</Description>
<CommandLine>powercfg.exe -h off</CommandLine>
<RequiresUserInput>false</RequiresUserInput>
</SynchronousCommand>
</FirstLogonCommands>
</component>
</settings>
<settings pass="offlineServicing">
<component name="Microsoft-Windows-LUA-Settings" 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">
<EnableLUA>false</EnableLUA>
</component>
</settings>
</unattend>

Share this post


Link to post
Share on other sites
Tomorrow    3

when PC is booting make sure it loads the uefi part of bios

made corrections in WinPE pass try this xml

Sorry for the delayed answer. No luck im afraid. Still got the prompt. But it's not a big problem. It would be a problem if my install was fully automated, but since i always configure disk to install to manually then these few extra clicks arent killing me. Besides im ok with my current xml anyway and it's not every time that the dialog box is displayed. Sometimes it goes directly to disk config like it should.

EDIT 10.01.2013: Ok so i could not let it go so easily. Atleast not without finding the cause. Apparently no matter the settings in the xml: if i boot in EFI mode the dialog always pops up. However if i boot in normal MBR mode everything works as it should and the xml settings are respected. So for some reason in EFI setup mode the xml settings are not respected.

The next thing i did was looking at how i achieve the EFI install. Unfortunately when using USB stick i have to use a hack to get the EFI setup to even boot (detailed here: http://forums.bit-tech.net/showthread.php?t=209045 ). Apparently when booting from DVD the hack is unnesesary (cannot confirm this as i dont have a DVD anymore for over a year now). Also does not seem to matter if i use my sysprepped ISO or unmodified MSDN ISO. With both the problem above stands. So it's not ISO/Customization specific issue tho it is entirely possible that the dialog pops up because i use a hack to get into EFI setup. If someone could test and try to launch EFI setup from DVD without the hack and see if the xml setting are respected it would put my mind at ease.

Btw also rearranged the passes as per first post. Apparently the offlineservicing pass was at the wrong place (too late).

Edited by Tomorrow

Share this post


Link to post
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.

×