×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Automatic Option Setup

Automatic Option Setup

Automatic Option Setup

(OP)
Hi All,

We need a way to automatically set up the MSAccess options for each workstation, so they are consistent. Options like trusted locations and Enable all macros are very important for the applications to run properly and IT finds it taxing to manually perform this per workstation.

Office 16 or 19 on Windows 10 for 50 users coming soon.

If you have a solution to this, please bring it forth.

Thank you,
Lori

RE: Automatic Option Setup

Most of these settings are in the registry. I believe the following needs to be run from the folder you want to make trusted. I expect you could change Wscript.ScriptFullName to another folder. The script will affect only the current user since changing this for all users would typically require elevated rights. The Office version might need updating. I think this script handles two versions. Apparently this is an old script since we are now on 16.0.

You can open regedt32.exe to review other settings.

CODE --> Script

Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
Const HKEY_CURRENT_CONFIG = &H80000005

'--------------------------------------------------------------------------------------------
'----------------------------Do not modify above this line! ---------------------------------

'Enter Program name here: (Excel, Access, PowerPoint or Word)
strProgram = "Access"

'Get Path to current folder
strPath = Wscript.ScriptFullName

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.GetFile(strPath)
strFolder = objFSO.GetParentFolderName(objFile) 

'Enter Description of Trusted Location here:
strDescription = "[Enter value here]"

'Enter one word description of Trusted Location here:
strName = "[Enter value here]"

'If subfolders are also trusted enter "True" here:
blnAllowSubFolders = True

'----------------------------Do not modify below this line! ---------------------------------
'--------------------------------------------------------------------------------------------
 
strParentKey = "Software\Microsoft\Office\12.0\" & strProgram & "\Security\Trusted Locations"
strNewKey = strParentKey & "\" & strName
 
Set objRegistry = GetObject("winmgmts:\\.\root\default:StdRegProv")
 
objRegistry.CreateKey HKEY_CURRENT_USER, strNewKey
objRegistry.SetStringValue HKEY_CURRENT_USER, strNewKey, "Path", strFolder
objRegistry.SetStringValue HKEY_CURRENT_USER, strNewKey, "Description", strDescription
objRegistry.SetStringValue HKEY_CURRENT_USER, strNewKey, "Date", cstr(Now())
 
If blnAllowSubFolders Then
    objRegistry.SetDWORDValue HKEY_CURRENT_USER, strNewKey, "AllowSubFolders", 1
End If

strParentKey = "Software\Microsoft\Office\14.0\" & strProgram & "\Security\Trusted Locations"
strNewKey = strParentKey & "\" & strName
 
Set objRegistry = GetObject("winmgmts:\\.\root\default:StdRegProv")
 
objRegistry.CreateKey HKEY_CURRENT_USER, strNewKey
objRegistry.SetStringValue HKEY_CURRENT_USER, strNewKey, "Path", strFolder
objRegistry.SetStringValue HKEY_CURRENT_USER, strNewKey, "Description", strDescription
objRegistry.SetStringValue HKEY_CURRENT_USER, strNewKey, "Date", cstr(Now())
 
If blnAllowSubFolders Then
    objRegistry.SetDWORDValue HKEY_CURRENT_USER, strNewKey, "AllowSubFolders", 1
End If 

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: Automatic Option Setup

> IT finds it taxing to manually perform this per workstation.

Er … why don't they use Group Policies?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close