Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 404659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:19:42+00:00 2026-05-12T17:19:42+00:00

I am trying to migrate microsoft office settings from one system to other system

  • 0

I am trying to migrate microsoft office settings from one system to other system by backing up office registry and restoring it on the destination machine using Python.I am able to do the saving part,but on trying to restore the existing settings in destination machine to overwrite existing office settings,i am getting an error.
This is the code for restoring :-

import os, sys
import _winreg
import win32api
import win32con
import win32security

priv_flags = win32security.TOKEN_ADJUST_PRIVILEGES | win32security.TOKEN_QUERY

hToken = win32security.OpenProcessToken (win32api.GetCurrentProcess (), priv_flags)
backup_privilege_id = win32security.LookupPrivilegeValue (None, "SeBackupPrivilege")

restore_privilege_id = win32security.LookupPrivilegeValue (None, "SeRestorePrivilege")
win32security.AdjustTokenPrivileges (

  hToken, 0, [

    (backup_privilege_id, win32security.SE_PRIVILEGE_ENABLED),
    (restore_privilege_id, win32security.SE_PRIVILEGE_ENABLED)
  ]
)

result = _winreg.LoadKey (_winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Office",ur"Office.registry")

print "Restored Office Settings"

here “office.registry” is the backed up hive HKEY_CURRENT_USER\Software\Microsoft\Office

I am getting WindowsError: [Errno 5] Access is denied.

Please help me to identify my mistake

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:19:43+00:00Added an answer on May 12, 2026 at 5:19 pm

    The registry system has a built-in method for updating registry keys by creating and importing a .reg text file. I suggest that you try to write your changes to a .reg file and import that.

    Also, you don’t mention what Windows version you are using. In the newer versions, the permission system is rather more complex than it used to be.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to migrate a website from Windows 2000 to Win2k3 using the IIS
I'm trying to migrate a site from a joomla system to a drupal. The
I am trying to migrate the setup here at the office from SVN to
I'm trying to migrate from sql server 2000 to mysql by using DTS. That's
I am trying to migrate a dataset from an old spreadsheet based system to
I am trying to migrate some code from using ElementTree to using lxml.etree and
I am trying to migrate from flex code written in flex 4/4.5 using mx
I want to migrate data from one database to another database in Microsoft SQL
I'm trying to migrate some models ImageFields to using the S3BotoStorage storage backend from
I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.