Error code -20 after upgrading to Windows 7/Windows 10

This forum contains a series of Technical Newsletters designed to share with our customers valuable information about implementing or using our products.
Post Reply
Devteam
Posts: 115
Joined: Fri Oct 14 2005
Location: Montreal
Contact:

Error code -20 after upgrading to Windows 7/Windows 10

Post by Devteam » Mon Oct 26 2009

[Edited]
This issue initially appeared in 2009 with the release of Windows 7. The same issue occurs when upgrading from Windows 10 to Windows 10 Anniversary Edition released in July 2016. The symptoms, the cause and the resolution are the same.

When upgrading from Windows XP or Windows Vista to Windows 7, or from Windows 10 to Windows 10 Anniversary Edition, you might receive error code -20 when trying to save a document to PDF for archiving or emailing. This issue happens with the developer version of Amyuni PDF Converter and only after an operating system update, it does not occur during a fresh installation of Windows.

Cause of this issue:
Windows 7 and Windows 10 Anniversary Edition do not update the HKEY_CURRENT_CONFIG\Software registry key. Amyuni PDF Converter uses this key to store its internal settings and fails after an operating system update.

Resolution:
Note: All options described below require Administrator access to the system)
Option 1) Reinstall the Amyuni PDF Converter Printer Driver, this will restore the security settings under this key and allow PDF Converter to continue using it.

Option 2) Follow the steps below to change the registry settings:
- Click on the Start button and enter "regedit" in the Search area, but do NOT hit Enter.
- You should see Regedit.exe at the top of the search results, right-click on it and select "Run As Administrator":
Error code 20.png
Error code 20.png (40.39 KiB) Viewed 38592 times
- Go to the end of the registry, open the HKEY_CURRENT_CONFIG key, right-click on Software and select Permissions:
Permissions.png
Permissions.png (30.5 KiB) Viewed 37886 times
- Make sure the "Full control" permission for the "Users" user is checked as in the screenshot:
Permissions.png
Permissions.png (34.45 KiB) Viewed 37797 times
Click OK, close the registry editor, and try saving your documents to PDF from your favorite application.

Option 3) Courtesy of Shawn K. Hall from SaferPC: Use a PowerShell script that will automate the process of adding the Users group with Full Control to the appropriate registry key

$key =[Microsoft.Win32.Registry]::CurrentConfig.OpenSubKey("Software",[Microsoft.Win32.RegistryKeyPermissionCheck]::ReadWriteSubTree,[System.Security.AccessControl.RegistryRights]::ChangePermissions)
$acl = $key.GetAccessControl()
$rule = New-Object System.Security.AccessControl.RegistryAccessRule("Users","FullControl","ObjectInherit,ContainerInherit","None","Allow")
$acl.SetAccessRule($rule)
$key.SetAccessControl($acl)

The PowerShell script can also be executed inline:

PowerShell.exe -NoProfile -NoLogo -NonInteractive -Command "$key = [Microsoft.Win32.Registry]::CurrentConfig.OpenSubKey('Software',[Microsoft.Win32.RegistryKeyPermissionCheck]::ReadWriteSubTree,[System.Security.AccessControl.RegistryRights]::ChangePermissions); $acl =$key.GetAccessControl(); $rule = New-Object System.Security.AccessControl.RegistryAccessRule ('Users','FullControl','ObjectInherit,ContainerInherit','None','Allow'); $acl.SetAccessRule($rule); $key.SetAccessControl($acl);"

Note: In order to run PowerShell, the logged in user will need elevated privileges.
Amyuni Development Team

Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - http://www.amyuni.com

Post Reply