Windows PE
De Linuxmemo.
(Windows Preinstallation Environment)
Sommaire |
[modifier] Création d'un clef USB Boot Windows PE
- installation de WAIK
- Invite de commandes des outils de déploiement, puis cliquez sur Exécuter en tant qu’administrateur
- Préparation des fichiers
copype.cmd x86 C:\winpe_x86 ou copype.cmd amd64 C:\winpe_amd64
copy C:\winpe_x86\winpe.wim C:\winpe_x86\ISO\sources\boot.wim ou copy C:\winpe_amd64\winpe.wim C:\winpe_amd64\ISO\sources\boot.wim
copy "C:\Program Files\Windows AIK\Tools\x86\ImageX.exe" C:\winpe_x86\ISO\ ou copy "C:\Program Files\Windows AIK\Tools\amd64\ImageX.exe" C:\winpe_amd64\ISO\
- Préparation de la clef
Invite de commandes des outils de déploiement, tapez:
diskpart list disk
identifiez le numéro du disque mémoire flash USB.
select disk number, où number correspond au numéro de disque du disque mémoire flash USB. clean create partition primary select partition 1 format fs=fat32 quick active exit xcopy /s C:\winpe_x86\iso\*.* D:\, où D est la lettre identifiant le disque mémoire flash US xcopy /S C:\winpe_x86 D:\
[modifier] image personnalisée Windows PE
- Monter l’image de base de Windows PE
imagex /mountrw c:\winpe_x86\winpe.wim 1 c:\winpe_x86\mount
- Ajouter des packages supplémentaires
peimg /install=<pkg> c:\winpe_x86\mount\Windows
Pour obtenir la liste des packages disponibles et de leur nom à l’aide de la commande /list
WinPE-FONTSupport-<région>-Packages Prise en charge des polices de caractères supplémentaires ja-jp, ko-kr, zh-cn, zh-hk et zh-tw.
Package WinPE-HTA Prise en charge d’application HTML
Package WinPE-MDAC Prise en charge de Microsoft Data Access Components
Package de script WinPE Prise en charge de Windows Script Host
Package WinPE-SRT Composant Windows Recovery Environment (disponible uniquement sur le kit de pré-installation OEM)
WinPE-WMI-Packages Prise en charge de Windows Management Instrumentation (WMI)
Package WinPE-XML Prise en charge de Microsoft XML Parser (MSXML)
- Vérifiez que les packages ont été installés à l’aide de la commande peimg /list pour afficher tous les packages dans l’image actuelle.
peimg /list c:\winpe_x86\mount\Windows
- Ajouter des personnalisations supplémentaires (facultatif)
copy “c:\program files\<version>\Tools\x86\imagex.exe” c:\winpe_x86\iso\ xcopy "c:\program files\<version>\Tools\<architecture>\Servicing" c:\winpe_x86\iso\Servicing /s
- Préparer l’image
Cette opération supprime tous les packages non installés de l’image finale.
peimg /prep c:\winpe_x86\mount\Windows
L’option /prep ne peut pas être annulée et une fois qu’elle est exécutée, les options /install, /uninstall, /import et /list ne fonctionnent plus, contrairement aux options /lang et /inf qui sont toujours valides.
- Apporter des modifications à l’image
imagex /unmount c:\winpe_x86\mount /commit
- Remplacer le fichier Boot.wim par défaut
copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim
[modifier] Ajouter un pilote à WinPE
[modifier] Vista
- monter l'image en RW
imagex.exe /mountrw E:\WinPE\sources\boot.wim 1 E:\WinPE\mount
- Ajouter le pilote
Donner en paramètre du /inf= le chemin vers le .inf correspondant au pilote à installer, puis le chemin vers le répertoire Windows de l'image montée.
peimg.exe /inf=E:\PRO100VE\e100b325.inf E:\WinPE\mount\Windows
- Dé-monter et appliquer les modifications
imagex.exe /unmount E:\WinPE\mount /commit
[modifier] win7
dism /mount-wim /wimfile:C:\DVDWindows7\install.wim /index:1 /mountdir:C:\TempMountWIM
dism /image: C:\TempMountWIM /add-driver /driver:C:\drivers\amd64\wnetvsc.inf (Si le pilote n’est pas signé, vous pouvez ajouter le commutateur /forceunsigned)
dism /unmount-wim /Mountdir:C:\TempMountWIM /commit
[modifier] Ajouter ImageX a votre Windows PE
dism /mount-wim /wimfile:C:\DVDWindows7\install.wim /index:1 /mountdir:C:\TempMountWIM
Copy X:\WAIK\Tools\x86\imagex.exe C:\TempMountWIM\windows\system32
dism /unmount-wim /Mountdir:C:\TempMountWIM /commit
[modifier] Automatiser certaines tâches
- monter l'image en RW
imagex.exe /mountrw E:\WinPE\sources\boot.wim 1 E:\WinPE\mount
Vous pouvez explorer l'arborescence de l'image de WinPE (E:\WinPE\mount\) et y ajouter des fichiers, par exemple des .BAT/.CMD de manière à automatiser certaines tâches. (capture de lecteur réseau, lancement de scripts diskpart et lancement d'installation unattended XP ou Vista,, par exemple !)
- Dé-monter et appliquer les modifications
imagex.exe /unmount E:\WinPE\mount /commit
[modifier] Commandes et Programmes
Name | WinPE | WinRE | Explanation/Notes |
---|---|---|---|
arp | Yes | YesX | The TCP/IP address resolution protocol maps between MAC and IP addresses |
assoc | Yes | Yes | Manage associations between file extensions and file types/applications |
bcdedit | Yes | Yes | Manipulate Windows Vista Boot Configuration Data store |
bootcfg | Yes | No | Enables users to manage contents of the boot.ini file (Vista uses BCD but maps to boot.ini) |
bootrec | No | Yes | WinRE’s premiere boot recovery tool (along with bootcfg) |
cd | Yes | Yes | Change/list directory command |
chkdsk | Yes | Yes | Checks layout and structure of Windows disks, with some repair capability |
chknfts | Yes | Yes | Checks layout and structure of NTFS volumes at boot time |
cls | Yes | Yes | Clears the command window |
color | Yes | Yes | Lets users set foreground (text) and background color in the command window |
copy | Yes | Yes | File copy command |
date | Yes | Yes | View or set today's date |
del | Yes | Yes | File delete command |
dir | Yes | Yes | List directory contents |
diskpart | Yes | Yes | Create, modify, and manage disk partitions at the command line |
doskey | Yes | Yes | Command line editing, recall, and macro definition tool |
echo | Yes | Yes | Repeats input text verbatim |
endlocal | Yes | Yes | Ends localization of variables in a batch environment |
erase | Yes | Yes | Deletes one or more files |
exit | Yes | Yes | Closes command window environment (reboots WinPE, closes WinRE command window) |
find | Yes | Yes | Search for input text string in one or more target files |
format | Yes | Yes | Format hard disk, UFD, or floppy disk |
ftp | Yes | YesX | Invoke command line File Transfer Protocol client services |
ftype | Yes | Yes | Use to display filetypes or to manipulate files by type |
ipconfig | Yes | YesX | Display or manage Windows TCP/IP configuration |
md | Yes | Yes | Make new directory (same as mkdir which is not listed here but works) |
more | Yes | Yes | Manages screen output in screen-size chunks |
mountvol | Yes | Yes | List, create, or delete a volume mount point |
move | Yes | Yes | Move files, renames files and directories |
net | Yes | YesX | A whole family of network service and function controls |
netsh | Yes | YesX | Another whole family of network service and function controls |
nbtstat | Yes | YesX | Display statistics related to NetBIOS over TCP/IP traffic on the network |
netstat | Yes | YesX | Display general TCP and UDP connections, port assignments, and activities |
path | Yes | Yes | Show or manipulate contents of the Windows path variable |
pathping | Yes | Yes | Send an orderly sequence of PING commands to all nodes on a network path |
ping | Yes | Yes | Send an ICMP echo request to some target address to assess reachability and response time |
popd | Yes | Yes | Changes to directory specified in the pushd command (command extensions must be enabled) |
print | Yes | Yes | Provides access to print services from the command line |
prompt | Yes | Yes | Changes command prompt shown in the command window to solicit input (command extensions must be enabled) |
pushd | Yes | Yes | store desired directory target for popd (command extensions must be enabled) |
recover | Yes | Yes | recover readable data from a damaged or defective disk drive |
reg | Yes | Yes | command line registry editing/inspection tool |
regedit | Yes | Yes | Both WinRE and WinPE will open the built-in Windows Registry Editor |
regsvr32 | Yes | Yes | use to register or unregister OLE and ActiveX controls, important for troubleshooting |
rem | Yes | Yes | inserts a text comment into a batch or script file |
ren | Yes | Yes | same as rename; use to rename files or directories |
replace | Yes | Yes | replace one or more files in a source directory from a target directory |
rmdir | Yes | Yes | delete directory (also rd) |
robocopy | Yes | Yes | robust file copy for Windows offers wide range of copy controls/checks |
route | Yes | YesX | inspect and manage the contents of TCP/IP static routing table |
rundll32 | Yes | Yes | manages relationships between DLLs and devices on a PC; important troubleshooting tool |
set | Yes | Yes | inspect, add, alter, or delete global environment variables |
setlocal | Yes | Yes | inspect, add, alter, or delete local environment variables |
sfc | Yes | No | system file checker; use with /verifyonly to check Windows OS files |
start | Yes | Yes | opens a separate window to run a program or command |
subst | Yes | Yes | use to associate a path with a virtual drive letter |
time | Yes | Yes | view or set current time |
title | Yes | Yes | sets title for command window |
tracert | Yes | YesX | traces all routers between sending and target Internet hosts |
type | Yes | Yes | writes contents of target file to command window display |
ver | Yes | Yes | displays Windows version in use (6.0.6001 for Vista SP1) |
verify | Yes | Yes | verifies accuracy of file copies upon completion |
vol | Yes | Yes | display or alter disk/volume name |
xcopy | Yes | Yes | tool for copying multiple files and entire directory structures |
[modifier] Rapide
- ouvrir une autre fenêtre dos
start
- lister les volumes (lettres de lecteur)
diskpart list volume