Link to home
Start Free TrialLog in
Avatar of SpencerKarnovski
SpencerKarnovski

asked on

How to create a registry key using supplied data.

Hello, I need to create a registry key using the following data;


CLASS USER

CATEGORY "Custom Office settings"
  POLICY "Import PRF-file"
    KEYNAME "SOFTWARE\Microsoft\Office\14.0\Outlook\Setup"
    PART "\\hermes\PRF\TestPRF.PRF"
      VALUENAME "ImportPRF"
    END PART
  END POLICY
END CATEGORY

Could you either a)  do it for me, or b) show me an easy to understand tutorial.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SpencerKarnovski
SpencerKarnovski

ASKER

Hello - I added the above code to a text file, saved as a .reg - but got an error.  Obviously not the correct syntax.

I need to create a registry file, which injects the above value into the registry, so I can export it and add it a vb login script to be injected when user logs in.

Something like;

[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Setup]
"ImportPRF"="\\hermes\PRF\TestPRF.PRF"

Or

reg add HKCU\SOFTWARE\Microsoft\Office\12.0\Outlook\Setup /v ImportPRF /t REG_SZ /d "\\hermes\PRF\TestPRF.PRF"

Thanks.
You posted this question (only) in the "VB Script" TA, so above is a VB script.
You can directly paste that into your VB login script.
Ok, by passing the need for the reg file.

Thanks, I shall give it a try.
Note that if you already have created a "Wscript.Shell" object in your script, you can of course reuse that for the ".RegWrite".
Worked perfectly