Dear Support,
I have two different code to update the registry, I ask You what is the better way to modify the registry:
1) First code
----------------
RegistryWriteKey>HKEY_CURRENT_USER,Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\Location0,Path,C:\GR&A_Trend\
REG_INTASSTR = 1
RegistryWriteKey>HKEY_CURRENT_USER,Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\Location0,AllowSubfolders,1
2) Second code
-----------------
VBSTART
const HKEY_CURRENT_USER = &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
----------
Can You help me to use the correct code?
Thank's for the support
Giovanni Roi
Registry update - the correct code
Moderators: Dorian (MJT support), JRL
-
- Junior Coder
- Posts: 21
- Joined: Fri Jul 03, 2009 4:36 pm
- Location: Milan,Italy
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Neither is "better" than the other. The first uses native Macro Scheduler functions, the second uses VBScript. However they are not working on the same key. The first acts against HKEY_CURRENT_USER while the second is updating HKEY_LOCAL_MACHINE.
Use whichever you feel more comfortable with. There is no right or wrong.
Use whichever you feel more comfortable with. There is no right or wrong.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?