Page 1 of 1

Write Protected files when using SnapShot

Posted: Wed Apr 09, 2025 12:59 pm
by jessomadic
I am working on an Imaging Program for us to use at work and while working on the backup system I am encountering an error whenever WimLib hits a cloudbased Onedrive file. It throws an error 50 that the files are write protected and then after a few attempts kills the entire imaging process. Is there a way to prevent this? We don't need to capture cloud based onedrive files as when the image is restored they will be restored as well. Thank you in advance!

Re: Write Protected files when using SnapShot

Posted: Sun May 04, 2025 8:02 am
by Sergey_Galan
You can add any file to the exclusion list that you do not want to be backed up.

Code: Select all

sudo ./Tools/bin/wimlib-imagex capture --compress=fast --check --config=./Exclusion_List.ini /dev/disk"$x"s"$y" "$DestinationFolder/WindowsBackup.wim" "Backup $(date +"%Y-%m-%d-%H:%M")"

Code: Select all

[ExclusionList]
\$ntfs.log
\$RECYCLE.BIN
\$Recycle.Bin
\$Windows.~BT
\$Windows.~WS
\$Windows.~LS
\RECYCLER
\Recycler
\Recycled
\PerfLogs
\System Volume Information
\swapfile.sys
\hiberfil.sys
\pagefile.sys
\winpepge.sys
\Windows\Temp\*
\Windows\Logs\*
\Windows\Prefetch\*
\Windows\CSC\*
\Windows\CbsTemp\*
\Windows\WinSxS\Temp\*
\Windows\WinSxS\ManifestCache\*
\Windows\SoftwareDistribution\*
\Program Files\WindowsApps\Deleted\*
\Program Files\WindowsApps\DeletedAllUserPackages\*
\ProgramData\Microsoft\Windows\WER\*
\ProgramData\Microsoft\Windows\Caches\*
\Users\*\AppData\Local\Temp\*
\Users\*\AppData\LocalLow\Temp\*
\Users\*\AppData\Local\Microsoft\Windows\Explorer\*
\Users\*\AppData\Local\Microsoft\Windows\INetCache\*
\Users\*\AppData\Local\lxss\*
\Users\*\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\*
\Users\*\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\*
\Users\*\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu16.04onWindows_79rhkp1fndgsc\LocalState\rootfs\*
\Users\*\OneDrive
\Users\*\OneDrive - *

Re: Write Protected files when using SnapShot

Posted: Wed Jun 25, 2025 2:46 pm
by Naneva
Exclude OneDrive folders from your WimLib imaging job. This stops it from hitting those write-protected cloud files and prevents error 50. Just add a path exclusion like %UserProfile%\OneDrive. That way, your imaging won’t fail, and you avoid backing up files that sync anyway.