Apr 25th 2016, 16:33:48
OPTION EXPLICIT
'On Error Resume Next
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
DIM objShell, objNetwork, objFSO, objADSysInfo, wmiLocator, wmiNameSpace, objRegistry
DIM strUserDN, objUser, strDomain, strSYSDrive, strWinDir, strWinSysDir, strUserName, strvbQuote, strUserProfile, strAppData
DIM strReturn, strACSPath, objFile, strIntranet, strExists, strExists1
DIM strDRK, sPATH, DelRegKey, strProfile, strOutlookPath, strInterwovenProfile, TemplatesFolder
SET objShell = WScript.CreateObject("WScript.Shell")
SET objNetwork = WScript.CreateObject("WScript.Network")
SET objFSO = CreateObject("Scripting.FileSystemObject")
SET objADSysInfo = CreateObject("ADSystemInfo")
SET wmiLocator = CreateObject("WbemScripting.SWbemLocator")
' Registry Provider (StdRegProv) lives in root\default namespace.
Set wmiNameSpace = wmiLocator.ConnectServer(objNetwork.ComputerName, "root\default")
Set objRegistry = wmiNameSpace.Get("StdRegProv")
'Return User Domain information with WSH provider.
strDomain = objNetwork.UserDomain
' Bind to the user and computer objects with the LDAP provider.
strUserDN = objADSysInfo.UserName
SET objUser = GetObject("LDAP://" & strUserDN)
strSYSDrive = objShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%")
strWinDir = objShell.ExpandEnvironmentStrings("%WINDIR%")
strWinSysDir = objShell.ExpandEnvironmentStrings("%WINSYSDIR%")
strUserName = objShell.ExpandEnvironmentStrings("%USERNAME%")
strUserProfile = objShell.ExpandEnvironmentStrings("%USERPROFILE%")
strAppData = objShell.ExpandEnvironmentStrings("%APPDATA%")
strvbQuote = chr(34) 'Which is a " (double quote)