Dear Support,
I need to write this Key in the Windows Register for all the user available (Administrator and also normal User).
The Key is:
[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\Location0]
"Path"="C:\\GR&A_Trend\\"
"AllowSubfolders"=dword:00000001
How can I make the script to execute with the Administrator profile to write the Key for all the PC User?
Thank's for the support.
Giovanni Roi
Multi Users Write Key Register
Moderators: Dorian (MJT support), JRL
-
- Junior Coder
- Posts: 21
- Joined: Fri Jul 03, 2009 4:36 pm
- Location: Milan,Italy
You should write the values in HKEY_LOCAL_MACHINE instead of HKEY_CURRENT_USER :
Code: Select all
VBSTART
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\Location0"
strValueName1 = "Path"
strValueName2 = "AllowSubfolders"
strValue = "C:\\GR&A_Trend\\"
dwValue = &H00000001
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName1,strValue
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName2,dwValue
VBEND
-
- Junior Coder
- Posts: 21
- Joined: Fri Jul 03, 2009 4:36 pm
- Location: Milan,Italy
Thank's for the solution
Dear Support,
thank's for the solution.
Regards
Giovanni Roi
thank's for the solution.
Regards
Giovanni Roi