Regedit syntax and how to use the /R:user switch

Posted on 2009-02-23
Last Modified: 2012-05-06
I want to export users outlook settings before recreating their roaming profiles, so they can later be re-imported into their new profiles.

If I log into a XP workstation as a particular user and run a script containing the following line, it works fine  it creates outlook.reg, so that after re-creating their roaming profile, and logging back in, I can run outlook.reg, and their outlook settings are restored.

regedit.exe /E z:\outlook.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"

However, I want to do this from my 2000 domain server for multiple users without logging in as each user. Why does the following line not work to create the outlook.reg file (where %1 stands for the username)?

regedit.exe /R:f:\Profile\%1\ntuser.dat /E f:\Home\%1\outlook.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
Question by:hamisherskine
    LVL 6

    Accepted Solution

    You can use reg.exe (it comes with XP but I believe it's available on the Win2k CD) to load the ntuser.dat into a temp hive and export from there. Of course, the paths in the resulting .reg file will reflect the name you give to the temp hive, so when you go to import, make sure you mount the new ntuser.dat to the same place.

    reg load HKLM\TmpHive "f:\Profile\%1\ntuser.dat"
    regedit /e z:\outlook.reg "HKEY_LOCAL_MACHINE\TmpHive\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
    reg unload HKLM\TmpHive

    You could actually do that from an XP box if you map a drive to your profiles share.
    LVL 6

    Expert Comment

    You could alternatively do a find/replace on the resulting .reg file to replace "HKLM\TempHive" with "HKEY_CURRENT_USER", so you can get your users to merge the .reg file themselves and still have the settings land in the right place... It would save you mounting the new ntuser.dat for each user, anyway :)

    Author Comment

    Thanks ACollyer. As you indicate, I now need to find the right command line utility to do the search and replace. Any suggestions?
    LVL 6

    Expert Comment

    I haven't tried this app myself, but have a look at

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
    Step by step guide to Clean and Sort your windows registry! Introduction: Always remember: A Clean registry = Better performance = Save your invaluable time In this article we're going to clear our registry manually! Yes, manually! The e…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now