Friday, December 30, 2016

unattended windows 10 usb installation français Canada

unattended windows 10 usb installation français Canada

2017-07-29
autounattend.xml script generation
http://wildboy85.blogspot.ca/2017/07/autounattend-xml-file-generation-with.html

powershell script to remove unwanted apps (for work computers)
http://wildboy85.blogspot.ca/2017/07/powershell-script-to-clean-unwanted.html

2017-07-27 9:50

Changed for usb key to boot BIOS and UEFI
1. This should generate a windows 10 build 1703, without patches (4 + 1 for defender at this date)
2. Make a usb key with MediaCreationTool.exe from microsoft
   https://www.microsoft.com/en-ca/software-download/windows10
3. Copy the content of the usb key created by MediaCreationTool in c:\win10una1703frapro_work
4. Assume usb  key is Z:
5. Assume C:\win10una1703frapro_work\sources\$oem$\$1 is where you keep the personalized files for your windows installation (the files autounattend.xml use during installation)
6. Copy C:\win10una1703frapro_work\sources\$oem$\$1 to Z:\sources\$oem$\$1
7. Copy C:\win10una1703frapro_work\autounattend.xml to Z:\
8. Use DISM to integrate the latest patches in the install.wim file:
   C:\win10una1703frapro_work\sources\install.wim
9. Split the install.wim with DISM if it is bigger that 4 gig
10. If you use a splitted file for windows image:
   Delete C:\win10una1703frapro_work\sources\install.wim
   Copy your splitted files in C:\win10una1703frapro_work\sources\
11. Copy mirror purge C:\win10una1703frapro_work\ to Z: with robocopy
12. The key will not wipe disk 0 automatically anymore (UEFI prevent that automation)
   So if "willwipedisk" if in your autounattend filoe, remove it
13. The image from microsoft will contain 3 windows versions, use the image index to select pro version (index 1 is pro)
14. The key should work fine (tested in BIOS and UEFI, secureboot off)
15. i Also programmed a autounattend.xml generator (in vbs) for the sequence of synchronous command to be... sequential, and cleaner

2016-12-31 22:19

java runtime update (jre)
google chrome 64 bits update
k-lite codec update
privacy setting added in a .bat
no usb indexing added in policies (by reg key)
control pannel classic display

Hi,

Here is a usb unattended installation of windows 10 pro french Canada

Voici l'installation sans attention (pas besoin de cliquer) de windows 10 professionnel français Canada

1.
This usb key will WIPE disk 0 (connector 0 on the main board)

2.
Not working on EFI bios installation aka secure boot (failed to create partition 0)

3.
It will install avast antivirus and office 2013 and acrobat reader or pro etc.

4.
There is no drivers automated in it, since updating drivers online is working fine with windows 10

5.
Put this unattend file in the root of a usb key that contain windows 10 dvd content

Acrobat did not want to install on first pass, I had to do it after a reboot

All folder from usb key in this folder:
\sources\$oem$\$1\
Are copied on c:\ by windows

The BAT file running after first reboot is:
c:\_updates\phase02_acrobat_pro.bat
The phase02*.bat will then write in registry the next .BAT to run after next reboot

------ c:\_updates\phase02.bat (originally in sources\$oem$\$1\_updates directory on key) -------
rem === acrobat reader after reboot installation
c:
cd c:\_appsall\acrobat_reader_adobe
for /F %%A in ('dir /b *.exe') do start /wait %%A /sPB /rs

reg add HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce /v NewSetupScript /t Reg_SZ /d "c:\_updates\phase03.bat" /f
---------------------- end of file ---------------------

-------------------------- phase03.bat ---------------------------

cmd.exe /c c:\_appsmaison\antivirus\avast_free_antivirus_setup.exe /silent /NORESTART /SP- /"Chrome"="false"

rem clean desktop
del "C:\Users\Public\Desktop\Avast SafeZone Browser.lnk"
del "C:\Users\Public\Desktop\Avast Antivirus Gratuit.lnk"

reg add HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce /v NewSetupScript /t Reg_SZ /d "c:\_updates\phase05_privacy.bat" /f

rem reboot

Shutdown /r /t 30

---------------------- end of file ---------------------

-------------------- autounattend.xml ----------------------------

<?xml version="1.0" encoding="UTF-8"?>

-<unattend xmlns="urn:schemas-microsoft-com:unattend">


-<settings pass="windowsPE">


-<component language="neutral" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" versionScope="nonSxS" publicKeyToken="31bf3856ad364e35" processorArchitecture="amd64" name="Microsoft-Windows-International-Core-WinPE">


-<SetupUILanguage>

<UILanguage>fr-FR</UILanguage>

</SetupUILanguage>

<InputLocale>0c0c:00001009</InputLocale>

<SystemLocale>fr-FR</SystemLocale>

<UILanguage>fr-FR</UILanguage>

<UILanguageFallback>fr-FR</UILanguageFallback>

<UserLocale>fr-CA</UserLocale>

</component>


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


-<ImageInstall>


-<OSImage>


-<InstallFrom>


-<MetaData wcm:action="add">

<Value>1</Value>

<key>/IMAGE/INDEX</key>

</MetaData>

</InstallFrom>

<InstallToAvailablePartition>false</InstallToAvailablePartition>

<WillShowUI>OnError</WillShowUI>

</OSImage>

</ImageInstall>


-<UserData>

<AcceptEula>true</AcceptEula>

<FullName>Maison</FullName>


-<ProductKey>

<Key>W269N-WFGWX-YVC9B-4J6C9-T83GX</Key>

</ProductKey>

</UserData>

<EnableFirewall>true</EnableFirewall>

</component>

</settings>


-<settings pass="offlineServicing">


-<component language="neutral" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" versionScope="nonSxS" publicKeyToken="31bf3856ad364e35" processorArchitecture="amd64" name="Microsoft-Windows-LUA-Settings">

<EnableLUA>false</EnableLUA>

</component>

</settings>


-<settings pass="generalize">


-<component language="neutral" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" versionScope="nonSxS" publicKeyToken="31bf3856ad364e35" processorArchitecture="amd64" name="Microsoft-Windows-Security-SPP">

<SkipRearm>1</SkipRearm>

</component>

</settings>


-<settings pass="specialize">


-<component language="neutral" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" versionScope="nonSxS" publicKeyToken="31bf3856ad364e35" processorArchitecture="amd64" name="Microsoft-Windows-International-Core">

<InputLocale>0c0c:00001009</InputLocale>

<SystemLocale>fr-CA</SystemLocale>

<UILanguage>fr-CA</UILanguage>

<UILanguageFallback>fr-CA</UILanguageFallback>

<UserLocale>fr-CA</UserLocale>

</component>


-<component language="neutral" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" versionScope="nonSxS" publicKeyToken="31bf3856ad364e35" processorArchitecture="amd64" name="Microsoft-Windows-Security-SPP-UX">

<SkipAutoActivation>true</SkipAutoActivation>

</component>


-<component language="neutral" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" versionScope="nonSxS" publicKeyToken="31bf3856ad364e35" processorArchitecture="amd64" name="Microsoft-Windows-SQMApi">

<CEIPEnabled>0</CEIPEnabled>

</component>


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

<ProductKey>W269N-WFGWX-YVC9B-4J6C9-T83GX</ProductKey>

</component>

</settings>


-<settings pass="oobeSystem">


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


-<AutoLogon>


-<Password>

<Value/>

<PlainText>true</PlainText>

</Password>

<Enabled>true</Enabled>

<Username>Maison</Username>

</AutoLogon>


-<OOBE>

<HideEULAPage>true</HideEULAPage>

<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>

<HideOnlineAccountScreens>true</HideOnlineAccountScreens>

<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>

<NetworkLocation>Home</NetworkLocation>

<SkipUserOOBE>true</SkipUserOOBE>

<SkipMachineOOBE>true</SkipMachineOOBE>

<ProtectYourPC>2</ProtectYourPC>

</OOBE>


-<UserAccounts>


-<LocalAccounts>


-<LocalAccount wcm:action="add">


-<Password>

<Value/>

<PlainText>true</PlainText>

</Password>

<Description>Utilisateuradmin</Description>

<DisplayName>Maison</DisplayName>

<Group>Administrators</Group>

<Name>Maison</Name>

</LocalAccount>

</LocalAccounts>

</UserAccounts>

<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>


-<FirstLogonCommands>


-<SynchronousCommand wcm:action="add">

<Description>klite and media classic player any version</Description>

<Order>1</Order>

<CommandLine>cmd /c c:\_appsall\7zip\commandline.bat</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>explorer open in this PC</Description>

<Order>2</Order>

<CommandLine>REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v LaunchTo /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>java</Description>

<Order>3</Order>

<CommandLine>cmd /c c:\_appsall\java_sun\commandline.bat</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>video codec and media player classic</Description>

<Order>4</Order>

<CommandLine>cmd /c c:\_appsall\video_codecs_convert\commandline.bat</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>vcredist</Description>

<Order>5</Order>

<CommandLine>cmd.exe /c "c:\_appsall\vcredist2010sp1\vcredist_x86.exe" /q /norestart</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>vcredist</Description>

<Order>6</Order>

<CommandLine>cmd.exe /c "c:\_appsall\vcredist2010sp1\vcredist_x64.exe" /q /norestart</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>vcredist</Description>

<Order>7</Order>

<CommandLine>cmd.exe /c "c:\_appsall\vcredist2012upd4\vcredist_x86.exe" /q /norestart</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>vcredist</Description>

<Order>8</Order>

<CommandLine>cmd.exe /c "c:\_appsall\vcredist2012upd4\vcredist_x64.exe" /q /norestart</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>vcredist</Description>

<Order>9</Order>

<CommandLine>cmd.exe /c "c:\_appsall\vcredist2013\vcredist_x64.exe" /q /norestart</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>vcredist</Description>

<Order>10</Order>

<CommandLine>cmd.exe /c "c:\_appsall\vcredist2013\vcredist_x86.exe" /q /norestart</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>vcredist</Description>

<Order>11</Order>

<CommandLine>cmd.exe /c "c:\_appsall\vcredist2015\vc_redist.x86.exe" /q /norestart</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>vcredist</Description>

<Order>12</Order>

<CommandLine>cmd.exe /c "c:\_appsall\vcredist2015\vc_redist.x64.exe" /q /norestart</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>vcredist 2017</Description>

<Order>13</Order>

<CommandLine>cmd.exe /c "c:\_appsall\vcredist2017\vc_redist.x64.exe" /q /norestart</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>removable drive index</Description>

<Order>14</Order>

<CommandLine>cmd /c reg add "HKLM\Software\Policies\Microsoft\Windows\Windows Search" /v DisableRemovableDriveIndexing /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>chrome 64</Description>

<Order>15</Order>

<CommandLine>cmd /c c:\_appsall\chrome\chromeStandaloneSetup64.exe /silent /install</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>defender patch</Description>

<Order>16</Order>

<CommandLine>cmd /c c:\_updates\defender\commandline.bat</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>drivers search path c drivers</Description>

<Order>17</Order>

<CommandLine>cmd /c reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion" /v DevicePath /t REG_EXPAND_SZ /d %SystemRoot%\inf;c:\_drivers /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>blue screen crash reboot</Description>

<Order>18</Order>

<CommandLine>cmd /c reg add "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v AutoReboot /t REG_DWORD /d 0 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>blue screen crash</Description>

<Order>19</Order>

<CommandLine>cmd /c reg add "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v AUState /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>windows update</Description>

<Order>20</Order>

<CommandLine>cmd /c reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>notepad2 vbs edit</Description>

<Order>21</Order>

<CommandLine>cmd /c reg add "HKLM\SOFTWARE\Classes\VBSFile\Shell\Edit\command" /v "" /t REG_SZ /d "C:\WINDOWS\System32\Notepad2.exe %1" /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>notepad2 edit</Description>

<Order>22</Order>

<CommandLine>cmd /c reg add "HKLM\SOFTWARE\Classes\txtFile\Shell\Edit\command" /v "" /t REG_SZ /d "C:\WINDOWS\System32\Notepad2.exe %1" /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>notepad2 edit</Description>

<Order>23</Order>

<CommandLine>cmd /c reg add "HKLM\SOFTWARE\Classes\batFile\Shell\Edit\command" /v "" /t REG_SZ /d "C:\WINDOWS\System32\Notepad2.exe %1" /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>notepad2 edit</Description>

<Order>24</Order>

<CommandLine>cmd /c reg add "HKLM\SOFTWARE\Classes\regFile\Shell\Edit\command" /v "" /t REG_SZ /d "C:\WINDOWS\System32\Notepad2.exe %1" /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>notepad2 edit</Description>

<Order>25</Order>

<CommandLine>cmd /c reg add "HKLM\SOFTWARE\Classes\cmdFile\Shell\Edit\command" /v "" /t REG_SZ /d "C:\WINDOWS\System32\Notepad2.exe %1" /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>notepad2 edit</Description>

<Order>26</Order>

<CommandLine>cmd /c reg add "HKLM\SOFTWARE\Classes\xmlFile\Shell\Edit\command" /v "" /t REG_SZ /d "C:\WINDOWS\System32\Notepad2.exe %1" /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>notepad2 edit</Description>

<Order>27</Order>

<CommandLine>cmd /c reg add "HKLM\SOFTWARE\Classes\logfile\Shell\Edit\command" /v "" /t REG_SZ /d "C:\WINDOWS\System32\Notepad2.exe %1" /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>notification off</Description>

<Order>28</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v DisableNotificationCenter /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>iexplore dont ask for info retention</Description>

<Order>29</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\Internet Explorer\IntelliForms" /v AskUser /t REG_DWORD /d 0 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>classic panel</Description>

<Order>30</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v ForceClassicControlPanel /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>explorer classi view</Description>

<Order>31</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ClassicViewState /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>explorer webview off</Description>

<Order>32</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v WebView /t REG_DWORD /d 0 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>hide icons</Description>

<Order>33</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideIcons /t REG_DWORD /d 0 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>show hidden files</Description>

<Order>34</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>show all icon taskbar</Description>

<Order>35</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarGlomming /t REG_DWORD /d 0 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>taskbar change size</Description>

<Order>36</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarSizeMove /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>task bar dont group icons</Description>

<Order>37</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarGlomLevel /t REG_DWORD /d 2 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>explorer shell state</Description>

<Order>38</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /v ShellState /t REG_BINARY /d 2400000033080000000000000000000000000000010000000d0000000000000000000000 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>no icone on shortcut maybe</Description>

<Order>39</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /v IconUnderline /t REG_BINARY /d 030000 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>dont hide right side icons</Description>

<Order>40</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /v EnableAutoTray /t REG_DWORD /d 0 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>Control Panel View</Description>

<Order>41</Order>

<CommandLine>reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>Control Panel Icon Size type</Description>

<Order>42</Order>

<CommandLine>reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>explorer dont hide file extensions</Description>

<Order>43</Order>

<CommandLine>cmd /c reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>explorer classic view state</Description>

<Order>44</Order>

<CommandLine>cmd /c reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ClassicViewState /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>media player privacy statement</Description>

<Order>45</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v AcceptedPrivacyStatement /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>media player</Description>

<Order>46</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v FirstRun /t REG_DWORD /d 0 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>iexplore runonce done</Description>

<Order>47</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\Internet Explorer\Main" /v RunOnceHasShown /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>iexplore runonce done</Description>

<Order>48</Order>

<CommandLine>cmd /c reg add "HKCU\Software\Microsoft\Internet Explorer\Main" /v RunOnceComplete /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>screenhunter</Description>

<Order>49</Order>

<CommandLine>msiexec /i c:\_appsall\screenhunterfree_prt_scr\setupscreenhunterfree.msi /quiet</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>klite and media classic player any version</Description>

<Order>50</Order>

<CommandLine>cmd /c c:\_appsall\video_codecs_convert\commandline.bat</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>java 23 and 64 any version</Description>

<Order>51</Order>

<CommandLine>cmd /c c:\_appsall\java_sun\commandline.bat</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>skype</Description>

<Order>52</Order>

<CommandLine>cmd /c c:\_appsall\skype\Skype_silent.exe</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>office 2013</Description>

<Order>53</Order>

<CommandLine>c:\_appsmaison\microsoft_office_2013_64_fra_files\setup.exe /adminfile office2013unattend.MSP</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>flash player</Description>

<Order>54</Order>

<CommandLine>msiexec.exe /i "C:\_appsall\flashplayer\install_flash_player_20_active_x.msi" /qn</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>flash player plugin</Description>

<Order>55</Order>

<CommandLine>msiexec.exe /i "C:\_appsall\flashplayer\install_flash_player_20_plugin.msi" /qn</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>administrateur account not expire after 3 months</Description>

<Order>56</Order>

<CommandLine>cmd.exe /c wmic useraccount where "name='administrateur'" set PasswordExpires=FALSE</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>utilisateur account not expire after 3 months</Description>

<Order>57</Order>

<CommandLine>cmd.exe /c wmic useraccount where "name='utilisateur'" set PasswordExpires=FALSE</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>install firefox</Description>

<Order>58</Order>

<CommandLine>cmd.exe /c "c:\_appsall\firefox\Firefox Setup 43.0.2.exe" -ms</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>mysql odbc connector 32</Description>

<Order>59</Order>

<CommandLine>msiexec /i c:\_appsall\MysqlOdbcConnector\mysql-connector-odbc-5.3.4-win32.msi /quiet</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>mysql odbc connector 64</Description>

<Order>60</Order>

<CommandLine>msiexec /i c:\_appsall\MysqlOdbcConnector\mysql-connector-odbc-5.3.4-winx64.msi /quiet</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>acrobat reader eula accepted</Description>

<Order>61</Order>

<CommandLine>cmd /c reg add "HKCU\SOFTWARE\Adobe\Acrobat Reader\11.0\AdobeViewer" /v EULA /t REG_DWORD /d 1 /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>todo folder on desktop</Description>

<Order>62</Order>

<CommandLine>cmd /c mkdir "%USERPROFILE%\desktop\A Faire - ToDo\"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>activation office 2013 et win10</Description>

<Order>63</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\activate windows 10 and office 2013.lnk" /a:c /t:"C:\_appsmaison\microsoft_office_2013_64_fra_files\_activation_off2013_fra\KMSAuto Net 2014 v1.3.4 Portable\KMSAuto Net.exe"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>avast registration</Description>

<Order>64</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\register avast antivirus free.lnk" /a:c /t:"C:\Program Files\AVAST Software\Avast\avastui.exe"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>tweaks windows</Description>

<Order>65</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\Tweaks (setup profile).lnk" /a:c /t:"c:\_appsall\_01_tweaks.reg"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>malwarebyte setup</Description>

<Order>66</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\Malwarebyte Setup.lnk" /a:c /t:"c:\_appsall\malwarebyte\mbam-setup-2.2.1.1043.exe"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>spyware blaster setup</Description>

<Order>67</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\spywareblaster54 setup.lnk" /a:c /t:"c:\_appsall\spywareblaster\spywareblastersetup54.exe"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>virtual drive setup</Description>

<Order>68</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\virtualclonedrive setup.lnk" /a:c /t:"c:\_appsall\virtualclonedrive\SetupVirtualCloneDrive5470.exe"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>imgburn graveur program setup</Description>

<Order>69</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\imageburn graveur dvd setup.lnk" /a:c /t:"c:\_appsall\imageburn\SetupImgBurn_2.5.7.0.exe"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>verification montage poste maison</Description>

<Order>70</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\verification_montage_poste_maison.lnk" /a:c /t:"c:\_util\installation\verification_montage_poste_maison.vbs"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>steam setup</Description>

<Order>71</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\Steam for games.lnk" /a:c /t:"c:\_appsmaison\steam_installer\SteamSetup.exe"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>torrent setup</Description>

<Order>72</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\Qbitorrent for torrents.lnk" /a:c /t:"c:\_appsmaison\torrent_client\qbittorrent_3.3.10_setup.exe"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>opera web browser setup</Description>

<Order>73</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\Opera internet browser for 3d flash games.lnk" /a:c /t:"c:\_appsall\opera\Opera_42.0.2393.94_Setup.exe"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>powerdvd setup</Description>

<Order>74</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\powerDVD for bluerays movies.lnk" /a:c /t:"c:\_appsmaison\powerdvd\Setup.exe"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>teamviewer setup</Description>

<Order>75</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\Teamviewer pour controle a distance.lnk" /a:c /t:"c:\_util\teamviewer\TeamViewer_Setup_fr-aiiz.exe"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>power always on</Description>

<Order>76</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\Power management jamaisoff run as admin.lnk" /a:c /t:"c:\_appsall\power.bat"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>vision viewer</Description>

<Order>77</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\Visio viewer.lnk" /a:c /t:"c:\_appsall\visio_viewer\vsdviewer.exe"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>video drivers intel</Description>

<Order>78</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\Video driver intel.lnk" /a:c /t:"c:\_drivers_manual\video\win64_154510.4542.exe</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>video drivers nvidia</Description>

<Order>79</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\Video driver Nvidia.lnk" /a:c /t:"c:\_drivers_manual\video\"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>amd radeon drivers</Description>

<Order>80</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\Video driver AMD.lnk" /a:c /t:"c:\_drivers_manual\video\non-whql-win10-64bit-radeon-software-crimson-relive-16.12.2-dec19.exe"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>power 2 hours</Description>

<Order>81</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\Power management 2 hours run as admin.lnk" /a:c /t:"c:\_appsall\power_2hours.bat"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>vlc video player</Description>

<Order>82</Order>

<CommandLine>cmd /c c:\_util\shortcut\Shortcut.exe /f:"%USERPROFILE%\Desktop\A Faire - ToDo\VLC video player 2016-12-31.lnk" /a:c /t:"c:\_appsall\video_vlc_player\vlc-2.2.4-win32.exe"</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>execute command after first reboot</Description>

<Order>83</Order>

<CommandLine>reg add HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce /v NewSetupScript /t Reg_SZ /d "c:\_updates\phase103.bat" /f</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>


-<SynchronousCommand wcm:action="add">

<Description>restart computer</Description>

<Order>84</Order>

<CommandLine>C:\Windows\System32\shutdown.exe /r /t 120</CommandLine>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>

</FirstLogonCommands>

<TimeZone>Eastern Standard Time</TimeZone>

</component>

</settings>

</unattend>

Wednesday, December 7, 2016

ribbon generation in excel



Hello,

I wanted to generate a nice ribbon in excel with just VBA.

I like jagged / nested arrays.

Si here is my code to generate a ribbon in excel in vba:

It generate only one tab of a personalized ribbon called "Tables et dessins"
This tab contain id, name and groups (array)
These groups contains id, name and buttons (array)
These buttons contain id, label, on action (sub to execute when pressed), color (or image)

After executing the sub LoadCustRibbon2, you must restart excel for the ribbon to appear cause excel need to load the file.


--------------------- code excel 2010 or 2013 VBA 64 bits ----------------------

'=== ajout boutons
Sub LoadCustRibbon2()
    'http://stackoverflow.com/questions/8850836/how-to-add-a-custom-ribbon-tab-using-vba
 
    Dim hFile As Long
    Dim path As String, fileName As String, ribbonXML As String, user As String
 
    '=== location of the custom ribbon file in the user profile
    hFile = FreeFile
    user = Environ("Username")
    path = "C:\Users\" & user & "\AppData\Local\Microsoft\Office\"
    fileName = "Excel.officeUI"
 
    '=== id, label, on action, color
    buttons0000 = Array("rearrangetable", "Ajuster la table sur cette feuille", "autofit_table_data", "AppointmentColor2")
 
    '=== id, label
    groups00 = Array("Tables", "Tables", buttons0000)
 
    '=== id, label, on action, color
    buttons0100 = Array("addthistodrawing", "Ajouter la selection a la feuille Donnees_Dessin", "add_line_in_drawings", "AppointmentColor3")
    buttons0101 = Array("drawgeomaticgrid", "Dessiner sur la feuille Dessin les donnees dans Donnees_Dessin", "geo_grid_generation", "AppointmentColor4")
     
    '=== id, label
    groups01 = Array("Dessin", "Dessin", buttons0100, buttons0101)
 
    '=== id, label, on action, color
    buttons0200 = Array("generatesheets", "Genere feuille pour chaque ligne avec hyperlien", "sheet_generation", "AppointmentColor5")
 
    groups02 = Array("Feuilles", "Feuilles", buttons0200)
 
    '=== id, label
    tabs01 = Array("TablesandDrawing", "Tables et Dessins", groups00, groups01, groups02)
 
    '=== data
 
    ribbonXML = "" & vbNewLine
    ribbonXML = ribbonXML + "  " & vbNewLine
    ribbonXML = ribbonXML + "    " & vbNewLine
    ribbonXML = ribbonXML + "    " & vbNewLine

    ribbonXML = ribbonXML + "      " & vbNewLine
 
    For grocnt01 = 2 To UBound(tabs01) '=== elements 2 and more are arrays
        group01 = tabs01(grocnt01)
        ribbonXML = ribbonXML + "                ribbonXML = ribbonXML + "label='" & group01(1) & "' autoScale='true'>" & vbNewLine
     
        For butcnt01 = 2 To UBound(group01) '=== elements 2 and more are arrays
            button01 = group01(butcnt01)
            ribbonXML = ribbonXML + "                      ribbonXML = ribbonXML + "label='" & button01(1) & "' " & vbNewLine
            ribbonXML = ribbonXML + "imageMso='" & button01(3) & "'      onAction='" & button01(2) & "'/>" & vbNewLine
        Next 'butcnt01
        ribbonXML = ribbonXML + "        
" & vbNewLine
     
    Next 'grocnt01
    ribbonXML = ribbonXML + "    
" & vbNewLine 
    ribbonXML = ribbonXML + "  
" & vbNewLine    ribbonXML = ribbonXML + "
" & vbNewLine    ribbonXML = ribbonXML + "

    ribbonXML = Replace(ribbonXML, """", "")
 
    test = 0
    If test = 0 Then
        Open path & fileName For Output Access Write As hFile
        Print #hFile, ribbonXML
        Close hFile
    Else
        MsgBox (ribbonXML)
    End If
 
End Sub