Write Protected files when using SnapShot

Comments, questions, bug reports, etc.
Post Reply
jessomadic
Posts: 1
Joined: Wed Apr 09, 2025 12:56 pm

Write Protected files when using SnapShot

Post 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!
Sergey_Galan
Posts: 5
Joined: Sat Apr 06, 2024 6:50 pm
Location: Ukraine, Odesa

Re: Write Protected files when using SnapShot

Post 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 - *
Attachments
Exclusion_List.ini.zip
(1.06 KiB) Downloaded 2534 times
Naneva
Posts: 1
Joined: Fri Jun 06, 2025 1:37 pm

Re: Write Protected files when using SnapShot

Post 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.
Post Reply