Write Key Registration

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
giovanniroi
Junior Coder
Posts: 21
Joined: Fri Jul 03, 2009 4:36 pm
Location: Milan,Italy

Write Key Registration

Post by giovanniroi » Fri Jul 08, 2011 8:04 am

Dear support,
I need to write four key in the Registry, how can I register this Key:

This is the Key Path :

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\Location0]

the key are:

"Path"="C:\\GR&A_Trend\\"
"AllowSubfolders"=dword:00000001
"Description"=""
"Date"="12/05/2009 20.00"

Thank's for the support

Giovanni Roi

Okapi
Junior Coder
Posts: 28
Joined: Wed Dec 29, 2010 1:22 am

Post by Okapi » Mon Aug 01, 2011 5:43 pm

Code: Select all

VBSTART
const HKEY_CURRENT_USER = &H80000001
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"
strValueName3 = "Description"
strValueName4 = "Date"
strValue1 = "C:\\GR&A_Trend\\"
strValue2 = ""
strValue3 = "12/05/2009 20.00"
dwValue = &H00000001

oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName1,strValue1
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName3,strValue2
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName4,strValue3
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName2,dwValue
VBEND

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts