Skip to content

Filesystem

Resolve path is too long (delete files)

mkdir empty_dir
robocopy empty_dir the_dir_to_delete /e /purge
rmdir empty_dir
rmdir the_dir_to_delete

CMD search for the file

dir /s /b file.log

Display content of file

type c:\file.txt

CMD change directory to the drive root

cd\

CMD change dick

c:

Take ownership of folder (file/directory own)

takeown /f "G:\System Volume information" /a /r /d y

Grant file access to admins group (file/directory permission rights)

icacls "G:\System Volume information" /t /c /grant administrators:F System:F

Remove directory

rd /s /q "G:\System Volume information"

Create boot USB flash stick (UEFI)

diskpart
list disk
select disk 1
clean
convert gpt
create partition primary
format fs=FAT32 quick
active
assign letter=M
xcopy e:\* m:\ /H /F /E

https://www.terabyteunlimited.com/kb/article.php?id=587 https://www.tenforums.com/tutorials/81502-convert-windows-10-legacy-bios-uefi-without-data-loss-2.html

Convert disk from MBR to GPT (Windows 10)

mbr2gpt.exe /disk:0 /validate /Logs:%userprofile% /allowFullOS - to check it's possible
mbr2gpt.exe /convert /disk:0 /allowfullOS - actual conversion.

Choose BIOS to UEFI boot

dism /get-wiminfo /wimfile:"F:\sources\install.wim"
dism /Mount-Wim /WimFile:"F:\sources\install.wim" /index:1 /MountDir:"D:\re" /readonly
dism /unmount-wim /mountdir:"D:\re" /discard 

reagentc /setreimage /path C:\Windows\System32\Recovery

Convert the logical to primary

MiniTool Partition Wizard Free

Enable Bitlocker (Windows 10)

  • Boot up in BIOS, and enable Secure Boot.
  • Rename C:\Windows\System32\Recovery\REAgent.xml to REAgent.old
  • Go to control panel
  • Choose bitlocker
  • Enable BitLocker on System Drive – save the recovery key under \server[username]$
  • Setup PIN
  • Then agree the next steps and restarted computer so bitlocker can start encrypting.

Map folder to drive

reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices" /f /v D: /t REG_SZ /d \??\Volume{af7ab9d7-39ff-11e9-93b9-c85b76ca3588}\FolderName\D 
use mountvol.exe to find GUID