Praktikum 2: Difference between revisions

From TÜ Narva Kolledži Wiki
Jump to navigation Jump to search
Content deleted Content added
No edit summary
No edit summary
 
(35 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Создание загрузочной флешки с Windows PE'''
'''Create bootable Windows PE media'''


Install into the shared folder with your name (shared), created in the previous practical ([[Praktikum_1]]) two programs, ADK.zip and ADKWINPE.zip, which can be found in the public folder of the class or downloaded on your own "[https://go.microsoft.com/fwlink/?linkid=2196127 Windows Assessment and Deployment Kit (ADK) deployment tools]" and "[https://go.microsoft.com/fwlink/?linkid=2196224 ADK Windows PE Add-ons]". Only the Deployment Tools need to be installed in the ADK.


Скачайте в shared папку с вашим именем, созданную в предыдущем практикуме ([[Praktikum_1]]) две программы ADK.zip и ADKWINPE.zip из общедоступной папки по предмету или скачайте их самостоятельно "[Windows Assessment and Deployment Kit (ADK) deployment tools https://go.microsoft.com/fwlink/?linkid=2196127]" и "[ADK Windows PE Add-ons https://go.microsoft.com/fwlink/?linkid=2196224]"


Install programs
Установите приложения


Make sure your PC has the ADK and ADK Windows PE add-on installed.
В панели поиска напишите Deployment Kit и когда появится название "Deployment and Imaging Tools Enviroment" запустите приложение от имени администратора


Start the Deployment and Imaging Tools Environment as an administrator.
[[File:Praktikum 2 pilt 1.JPG|200px|thumb|left]]


[[File:Praktikum 2 pilt 1.JPG|400px]]




Run ''copype'' to create a working copy of the Windows PE files.


<pre>copype amd64 C:\WinPE_amd64 </pre>
Запустите команду от имени администратора, которая создает рабочую копию файлов Windows PE: <pre>copype amd64 C:\WinPE_amd64</pre>


Установите среду предустановки Windows на, созданный ранее виртуальный диск (виртуальную флешку), указав правильную букву диска


Create a virtual hard drive (.vhd)
<pre>MakeWinPEMedia /UFD C:\WinPE_amd64 <буква диска>: </pre>


<pre>
Подтвердите решение о перезаписи диска и убедитель, что диск содержит каталоги и файлы
diskpart
create vdisk file="C:\shared\WinPE.vhd" maximum=1000
attach vdisk
create partition primary
assign letter=F
format fs=ntfs quick


</pre>
Корректно отключите диск из ОС (правой кнопкой мыши по иконке диска > eject) и переместите файл (не копируйте) на '''реальный''' ПК в папку с вашей фамилией


Удалите все файлы и папки (ADK) из общедоступной папки на виртуальной машине


Prepare the drive by using MakeWinPEMedia:
Завершите работу с Windows Start > Shut Down


<pre>
Подсоедините виртуальный диск в программе VirtualBox через меню Settings > Storage > Add New Storage Attachment (иконка с плюсом) > Add New Hard Disk > Choose existing Disk
MakeWinPEMedia /UFD C:\WinPE_amd64 F:
</pre>


[[File:Praktikum2_1.JPG]]


Detach the drive with diskpart or use Computer Management:
Запустите снова виртуальную машину с Windows и как только появится меню выбора загрузки, нажмите клавишу F12 для выбора дисков


<pre>
Выберите диск 2 (Slave)
diskpart
select vdisk file="C:\shared\WinPE.vhd"
detach vdisk
exit
</pre>


Move the resulting WinPE.vhd file (do not copy) to a '''real PC''' in a folder with your lastname
Запуститесь с виртуального диска (флешки) с WinPE


Delete all files and folders (ADK) from the public folder on the virtual machine
Настройте сеть (если у сетевого интерфейса отсутствует IP адрес), используя команды.


Shut down with Windows Start > Shut Down
<pre>
netsh interface ip show config
netsh int ip set address "<Interface>" static <IP adress> <Subnet Mask>
</pre>


Attach the virtual disk in VirtualBox via Settings > Storage > Add New Storage Attachment (icon with a plus) > Add New Hard Disk > Choose existing Disk
Проверьте доступность компьютера-хоста с помощью команды ping


[[File:Praktikum2_1.JPG|400px]]
Наберите команду exit и перезагрузитесь снова в ОС


Start the Windows virtual machine again and when prompted for a password, press and hold the Shift key, then select the Restart button
Запустите Windows и настройте локальную групповую политику т.о. чтобы была возможность запускать только программу mspaint.exe
(1. Open 'gpedit', 2. In 'User configuration' select 'Administrative templates', 3. Double click on the 'System', 4. In the window on the right double click 'Run only specified Windows applications', 5. Choose Enable and write "mspaint.exe" in the list of button 'Show')


In the window that appears select "Use a device" and then the last UEFI disk
Убедитесь, что теперь вы не можете запускать большинство программ (например, cmd). Покажите результат преподавателю!


[[File:Praktikum2_pilt_2.JPG|400px]]
Перезагрузитесь снова в среду WinPE и запустите редактор реестра regedit


Выделите ветку реестра HKEY_USERS, выберите из меню File > Load Hive...


Start from the WinPE virtual disk
Найдите из списка тот виртуальный диск на котором установлена Windows и укажите путь к папке администратора (например, E:\Users\user-PC)

When the command prompt appears, type ''exit'' and reboot back into the OS

Start Windows and configure the local group policy so that you are only able to run the program mspaint.exe

1. Open 'gpedit'

2. In 'User configuration' select 'Administrative templates'

3. Double click on the 'System'

4. In the window on the right double click 'Run only specified Windows applications'

5. Choose Enable and write "mspaint.exe" in the list of button 'Show')


[[File:Prakikum_2_pilt_3.JPG|400px]]

Make sure you can't run most programs now (like cmd). Show the result to your teacher!

Reboot again to the WinPE environment (Shift + restart)

Run ''diskpart'' and run the commands to assign a letter to the volume with Windows installed

<pre>
list disk
select Disk 0
list volume
select Volume 1
assign letter=E
exit
</pre>


[[File:Praktikum2_pilt_4.JPG|400px]]
В поле ввода имени файла напишите ntuser.dat


Launch the registry editor ''regedit''.
Дайте название подключаемой ветке, например user-PC_ntuser.dat


Highlight the HKEY_USERS registry branch, from the menu select File > Load Hive....
Разверните HKEY_USERS и найдите подключаемую ветку с указанным вами названием из предыдущего пункта


From the list find the virtual disk on which Windows is installed and specify the path to the administrator folder (for example, E:\Users\user)
Найдите ключ "RestrictRun" в ветке .\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\ и поменяйте значение с 1 на 0 (или удалите ключ полностью)


In the file name input field, write ntuser.dat
Выделите снова подключаемую вами ветку (user-PC_ntuser.dat) и в меню файл выберите Unload Hive... > yes


[[File:Praktikum_2_pilt_5.JPG|400px]]
Закройте regedit и запустите команду exit для перезагрузки


Give a name to the connected branch, for example user_ntuser.dat
Удостовертесь, что снова можете запускать программы


Expand HKEY_USERS and find the pluggable branch with the name you specified previously
Покажите результат преподавателю


Find the "RestrictRun" key in the .\user_ntuser\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\ branch and change the value from 1 to 0


Select the branch you are connecting again (user_ntuser.dat) and from the File menu choose Unload Hive... > yes
----


Close regedit and run ''exit'' command to reboot


Make sure you can run programs again
'''Мне_скучно_сделал_бы_чего_еще'''


Show the result to the teacher
Добавьте поддержку в среду WinPE:


* Русского и эстонского языка [https://technet.microsoft.com/ru-ru/library/cc749248(v=ws.10).aspx]


* PowerShell [https://msdn.microsoft.com/ru-ru/library/windows/hardware/dn938380(v=vs.85).aspx]
[https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-create-usb-bootable-drive?source=recommendations&view=windows-11 Source]

Latest revision as of 12:19, 9 September 2025

Create bootable Windows PE media

Install into the shared folder with your name (shared), created in the previous practical (Praktikum_1) two programs, ADK.zip and ADKWINPE.zip, which can be found in the public folder of the class or downloaded on your own "Windows Assessment and Deployment Kit (ADK) deployment tools" and "ADK Windows PE Add-ons". Only the Deployment Tools need to be installed in the ADK.


Install programs

Make sure your PC has the ADK and ADK Windows PE add-on installed.

Start the Deployment and Imaging Tools Environment as an administrator.


Run copype to create a working copy of the Windows PE files.

copype amd64 C:\WinPE_amd64 


Create a virtual hard drive (.vhd)

diskpart
create vdisk file="C:\shared\WinPE.vhd" maximum=1000
attach vdisk
create partition primary
assign letter=F
format fs=ntfs quick


Prepare the drive by using MakeWinPEMedia:

MakeWinPEMedia /UFD C:\WinPE_amd64 F:


Detach the drive with diskpart or use Computer Management:

diskpart
select vdisk file="C:\shared\WinPE.vhd"
detach vdisk
exit

Move the resulting WinPE.vhd file (do not copy) to a real PC in a folder with your lastname

Delete all files and folders (ADK) from the public folder on the virtual machine

Shut down with Windows Start > Shut Down

Attach the virtual disk in VirtualBox via Settings > Storage > Add New Storage Attachment (icon with a plus) > Add New Hard Disk > Choose existing Disk

Start the Windows virtual machine again and when prompted for a password, press and hold the Shift key, then select the Restart button

In the window that appears select "Use a device" and then the last UEFI disk


Start from the WinPE virtual disk

When the command prompt appears, type exit and reboot back into the OS

Start Windows and configure the local group policy so that you are only able to run the program mspaint.exe

1. Open 'gpedit'

2. In 'User configuration' select 'Administrative templates'

3. Double click on the 'System'

4. In the window on the right double click 'Run only specified Windows applications'

5. Choose Enable and write "mspaint.exe" in the list of button 'Show')


Make sure you can't run most programs now (like cmd). Show the result to your teacher!

Reboot again to the WinPE environment (Shift + restart)

Run diskpart and run the commands to assign a letter to the volume with Windows installed

list disk
select Disk 0
list volume
select Volume 1
assign letter=E
exit

Launch the registry editor regedit.

Highlight the HKEY_USERS registry branch, from the menu select File > Load Hive....

From the list find the virtual disk on which Windows is installed and specify the path to the administrator folder (for example, E:\Users\user)

In the file name input field, write ntuser.dat

Give a name to the connected branch, for example user_ntuser.dat

Expand HKEY_USERS and find the pluggable branch with the name you specified previously

Find the "RestrictRun" key in the .\user_ntuser\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\ branch and change the value from 1 to 0

Select the branch you are connecting again (user_ntuser.dat) and from the File menu choose Unload Hive... > yes

Close regedit and run exit command to reboot

Make sure you can run programs again

Show the result to the teacher


Source