Fix choco-package-list-backup not saving to network
On my (barely used) Windows box, I wanted to set a backup of the installed Chocolatey packages. The
choco-package-list-backup tool seems to be the way to go. So I installed it and set the backup path to a mapped network drive.
It didn’t work. Picking different folders under
C:\ went fine, but the backup never could be saved to the network location.
So what was going on?
It turns out that
choco-package-list-backup schedules itself to run as administrator. Plus, as Chocolatey needs to be run on an elevated terminal, I also run this tool interactively with such privileges. However, on Windows, by default network drives are inaccessible to privileged applications.
So how to solve this? I did some quick tests and the backup tool run fine as a normal user. So you have two choices:
- change the scheduled task to run without privileges, and always run
- or allow privileged programs to access your mapped drives.
For the later, this short guide does the trick. It instructs you to create a
DWORD key called
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System and set it to
- choco-package-list-backup 2022.02.06
- Chocolatey 0.12.1
- Windows 11 21H2