Vbscript and Trusted Locations - Listing/checking exising ones before adding
Posted on 2013-10-24
I've found several good examples of adding a registry entry for trusted locations and have most of a script cobbled together. However, I'd like the script to check and make sure that the Trusted Location I'm trying to add isn't already in the user's list of Trusted Locs before I add it. This routine is ideally going to be added to a startup script we are already running to get users' drives mapped in a split/untrusted network situation, and I don't want to keep adding duplicates of the trusted locations. These machines may have their profiles or images wiped by the Other Entity which manages most of our desktops, so it would be good to have these refreshed automatically.
I want to have the body of the script iterate through the existing mapped drives and add those and their MyDocuments folder (with subfolders) using a function that passes the app and the path *if* they haven't already been added. The only part I haven't figured out is how to check to see if a supplied path is already in the TLs for the supplied application.
This script will be run on Windows 7 Enterprise with Office 2007.
Help appreciated... thanks.