This VBScript must be run as a logon script of windows GPO that will create the Microsoft Outlook Signature according to the template must be named OutlookSignature
Tested on the following Outlook versions:
- Microsoft Outlook 2010 (32bit)
- Microsoft Outlook 2013 (32bit)
Tested on the following Microsoft OS versions:
- Microsoft Windows XP (32bit)
- Microsoft Windows 7 (32bit)
- Microsoft Windows 8.1
- Microsoft Windows 2003 (32bit)
- Microsoft Windows 2008 R2
Tested on the following Application Virtualizer:
- VMware XenApp 6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
' ############################################################################## ' # Lupi Gabriel # ' # www.lupigabriel.it # ' # info@lupigabriel.it # ' ############################################################################## ' # Copyright (c) 2014 Lupi Gabriel All rights reserved. # ' ############################################################################## ' # VERSION : 1.0 # ' # FILE : OutlookSignature.vbs # ' # CLASS : Script # ' # LANGUAGE : VB Script # ' # OUPUT : "%AppData%\Microsoft\Signatures" # ' ############################################################################## On Error Resume Next ' SETTINGS OutlookSignatureVersion = "000" ' set to 000 to refresh signature on every logon OutlookSignatureBinName = Array(79,0,117,0,116,0,108,0,111,0,111,0,107,0,83,0,105,0,103,0,110,0,97,0,116,0,117,0,114,0,101,0,0,0) OutlookSignatureFirsNew = 1 ' automatic activation of the signature for new messages OutlookSignatureFirsRep = 1 ' automatic activation of the signature for replies and forwards OutlookSignatureRefrNew = 1 ' force re-activation of the signature for new messages on every logon OutlookSignatureRefrRep = 1 ' force re-activation of the signature for replies and forwards messages on every logon ' START OutlookSignatureRemPath = Replace(Wscript.ScriptFullName, Wscript.ScriptName, "") Set objFSO = CreateObject("Scripting.FileSystemObject") Set oShell = CreateObject("WScript.Shell") SignatureFlag = oShell.ExpandEnvironmentStrings("%APPDATA%") & "\Microsoft\Signatures\OutlookSignature_files\OutlookSignature." & OutlookSignatureVersion SignatureFrst = oShell.ExpandEnvironmentStrings("%APPDATA%") & "\Microsoft\Signatures\OutlookSignature_files\OutlookSignature.first" SignaturePath = oShell.ExpandEnvironmentStrings("%APPDATA%") & "\Microsoft\Signatures\" UserDeskTempl = oShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Desktop\OutlookSignature\" Set objRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") SetRegCounter = 0 ' TEMPLATE If objFSO.FileExists(OutlookSignatureRemPath & "OutlookSignature.txt") = False Or objFSO.FileExists(OutlookSignatureRemPath & "OutlookSignature.htm") = False Or objFSO.FolderExists(OutlookSignatureRemPath & "OutlookSignature_files") = False Then TextMsgBox = "Create from Outlook the New Signature Template named ""OutlookSignature"" with the following Tags..." & vbCrLf & vbCrLf & _ "###FIRSTNAME###" & vbCrLf & _ "###INITIALS###" & vbCrLf & _ "###LASTNAME###" & vbCrLf & _ "###DISPLAYNAME###" & vbCrLf & _ "###DESCRIPTION###" & vbCrLf & _ "###OFFICENAME###" & vbCrLf & _ "###TELEPHONE###" & vbCrLf & _ "###OTHERTELEPHONE###" & vbCrLf & _ "###EMAIL###" & vbCrLf & _ "###WEBPAGE###" & vbCrLf & _ "###OTHERWEBPAGE###" & vbCrLf & _ "###STREETADDRESS###" & vbCrLf & _ "###POSTOFFICEBOX###" & vbCrLf & _ "###CITY###" & vbCrLf & _ "###STATE###" & vbCrLf & _ "###POSTALCODE###" & vbCrLf & _ "###COUNTRYCODE###" & vbCrLf & _ "###HOMEPHONE###" & vbCrLf & _ "###OTHERHOMEPHONE###" & vbCrLf & _ "###PAGER###" & vbCrLf & _ "###OTHERPAGER###" & vbCrLf & _ "###MOBILEPHONE###" & vbCrLf & _ "###OTHERMOBILEPHONE###" & vbCrLf & _ "###FAX###" & vbCrLf & _ "###OTHERFAX###" & vbCrLf & _ "###IPPHONE###" & vbCrLf & _ "###OTHERIPPHONE###" & vbCrLf & _ "###NOTES###" & vbCrLf & _ "###JOBTITLE###" & vbCrLf & _ "###DEPARTMENT###" & vbCrLf & _ "###COMPANY###" & vbCrLf & _ "###MANAGER###" & vbCrLf & _ vbCrLf & "Save Template from Outlook and click ""OK"" to create OutlookSignature Source Files..." UserMsg = MsgBox(TextMsgBox, 0, "OutlookSignature") If objFSO.FileExists(SignaturePath & "OutlookSignature.txt") = False Or objFSO.FileExists(SignaturePath & "OutlookSignature.htm") = False Or objFSO.FolderExists(SignaturePath & "OutlookSignature_files") = False Then UserMsg = MsgBox("Warning! OutlookSignature Template is not present in Outlook..." & vbCrLf & vbCrLf & "You Must Create Template and Re-launch the Script...", 0, "OutlookSignature") Wscript.Quit End If If objFSO.FolderExists(OutlookSignatureRemPath & "OutlookSignature_files\") = True Then objFSO.DeleteFolder OutlookSignatureRemPath & "OutlookSignature_files\" End If If objFSO.FileExists(OutlookSignatureRemPath & "OutlookSignature.htm") = True Then objFSO.DeleteFile OutlookSignatureRemPath & "OutlookSignature.htm" End If If objFSO.FileExists(OutlookSignatureRemPath & "OutlookSignature.txt") = True Then objFSO.DeleteFile OutlookSignatureRemPath & "OutlookSignature.txt" End If objFSO.CreateFolder OutlookSignatureRemPath & "OutlookSignature_files\" objFSO.CopyFile SignaturePath & "OutlookSignature.txt", OutlookSignatureRemPath objFSO.CopyFile SignaturePath & "OutlookSignature.htm", OutlookSignatureRemPath objFSO.CopyFile SignaturePath & "OutlookSignature_files\*", OutlookSignatureRemPath & "OutlookSignature_files\" If objFSO.FileExists(OutlookSignatureRemPath & "OutlookSignature.txt") = False Or objFSO.FileExists(OutlookSignatureRemPath & "OutlookSignature.htm") = False Or objFSO.FolderExists(OutlookSignatureRemPath & "OutlookSignature_files") = False Then UserMsg = MsgBox("Warning! OutlookSignature Template files are not copied in source path..." & vbCrLf & vbCrLf & "Please check write permission in source path and Re-launch the Script...", 0, "OutlookSignature") Wscript.Quit End If UserMsg = MsgBox("OutlookSignature Template is now created and copied in source path..." & vbCrLf & vbCrLf & OutlookSignatureRemPath, 0, "OutlookSignature") Wscript.Quit End If ' DEPLOY If objFSO.FileExists(SignatureFlag) = False Or OutlookSignatureVersion = "000" Then If objFSO.FolderExists(SignaturePath & "OutlookSignature_files") = True Then objFSO.DeleteFolder SignaturePath & "OutlookSignature_files" End If If objFSO.FileExists(SignaturePath & "OutlookSignature.htm") = True Then objFSO.DeleteFile SignaturePath & "OutlookSignature.htm" End If If objFSO.FileExists(SignaturePath & "OutlookSignature.txt") = True Then objFSO.DeleteFile SignaturePath & "OutlookSignature.txt" End If If objFSO.FileExists(SignaturePath & "OutlookSignature.rtf") = True Then objFSO.DeleteFile SignaturePath & "OutlookSignature.rtf" End If If objFSO.FolderExists(SignaturePath) = False Then objFSO.CreateFolder SignaturePath End If If objFSO.FolderExists(SignaturePath & "OutlookSignature_files") = False Then objFSO.CreateFolder SignaturePath & "OutlookSignature_files" objFSO.CopyFile OutlookSignatureRemPath & "OutlookSignature.txt", SignaturePath & "OutlookSignature.txt.template" objFSO.CopyFile OutlookSignatureRemPath & "OutlookSignature.htm", SignaturePath & "OutlookSignature.htm.template" objFSO.CopyFile OutlookSignatureRemPath & "OutlookSignature_files\*", SignaturePath & "OutlookSignature_files\" End If ' AD USER INFO Set objSysInfo = CreateObject("ADSystemInfo") Set objUser = GetObject("LDAP://" & objSysInfo.UserName) Set objUserMan = GetObject("LDAP://" & objUser.manager) If objUser.givenName = "" Or IsNull(objUser.givenName) = True Then Sign_givenName = "" Else Sign_givenName = objUser.givenName End If If objUser.initials = "" Or IsNull(objUser.initials) = True Then Sign_initials = "" Else Sign_initials = objUser.initials End If If objUser.sn = "" Or IsNull(objUser.sn) = True Then Sign_sn = "" Else Sign_sn = objUser.sn End If If objUser.displayName = "" Or IsNull(objUser.displayName) = True Then Sign_displayName = "" Else Sign_displayName = objUser.displayName End If If objUser.description = "" Or IsNull(objUser.description) = True Then Sign_description = "" Else Sign_description = objUser.description End If If objUser.physicalDeliveryOfficeName = "" Or IsNull(objUser.physicalDeliveryOfficeName) = True Then Sign_physicalDeliveryOfficeName = "" Else Sign_physicalDeliveryOfficeName = objUser.physicalDeliveryOfficeName End If If objUser.telephoneNumber = "" Or IsNull(objUser.telephoneNumber) = True Then Sign_telephoneNumber = "" Else Sign_telephoneNumber = objUser.telephoneNumber End If If objUser.otherTelephone = "" Or IsNull(objUser.otherTelephone) = True Then Sign_otherTelephone = "" Else Sign_otherTelephone = objUser.otherTelephone End If If objUser.mail = "" Or IsNull(objUser.mail) = True Then Sign_mail = "" Else Sign_mail = objUser.mail End If If objUser.wWWHomePage = "" Or IsNull(objUser.wWWHomePage) = True Then Sign_wWWHomePage = "" Else Sign_wWWHomePage = objUser.wWWHomePage End If If objUser.url = "" Or IsNull(objUser.url) = True Then Sign_url = "" Else Sign_url = objUser.url End If If objUser.streetAddress = "" Or IsNull(objUser.streetAddress) = True Then Sign_streetAddress = "" Else Sign_streetAddress = objUser.streetAddress End If If objUser.postOfficeBox = "" Or IsNull(objUser.postOfficeBox) = True Then Sign_postOfficeBox = "" Else Sign_postOfficeBox = objUser.postOfficeBox End If If objUser.l = "" Or IsNull(objUser.l) = True Then Sign_l = "" Else Sign_l = objUser.l End If If objUser.st = "" Or IsNull(objUser.st) = True Then Sign_st = "" Else Sign_st = objUser.st End If If objUser.postalCode = "" Or IsNull(objUser.postalCode) = True Then Sign_postalCode = "" Else Sign_postalCode = objUser.postalCode End If If objUser.countryCode = "" Or IsNull(objUser.countryCode) = True Then Sign_countryCode = "" Else Sign_countryCode = objUser.countryCode End If If objUser.homePhone = "" Or IsNull(objUser.homePhone) = True Then Sign_homePhone = "" Else Sign_homePhone = objUser.homePhone End If If objUser.otherHomePhone = "" Or IsNull(objUser.otherHomePhone) = True Then Sign_otherHomePhone = "" Else Sign_otherHomePhone = objUser.otherHomePhone End If If objUser.pager = "" Or IsNull(objUser.pager) = True Then Sign_pager = "" Else Sign_pager = objUser.pager End If If objUser.otherPager = "" Or IsNull(objUser.otherPager) = True Then Sign_otherPager = "" Else Sign_otherPager = objUser.otherPager End If If objUser.mobile = "" Or IsNull(objUser.mobile) = True Then Sign_mobile = "" Else Sign_mobile = objUser.mobile End If If objUser.otherMobile = "" Or IsNull(objUser.otherMobile) = True Then Sign_otherMobile = "" Else Sign_otherMobile = objUser.otherMobile End If If objUser.facsimileTelephoneNumber = "" Or IsNull(objUser.facsimileTelephoneNumber) = True Then Sign_facsimileTelephoneNumber = "" Else Sign_facsimileTelephoneNumber = objUser.facsimileTelephoneNumber End If If objUser.otherFacsimileTelephoneNumber = "" Or IsNull(objUser.otherFacsimileTelephoneNumber) = True Then Sign_otherFacsimileTelephoneNumber = "" Else Sign_otherFacsimileTelephoneNumber = objUser.otherFacsimileTelephoneNumber End If If objUser.ipPhone = "" Or IsNull(objUser.ipPhone) = True Then Sign_ipPhone = "" Else Sign_ipPhone = objUser.ipPhone End If If objUser.otherIpPhone = "" Or IsNull(objUser.otherIpPhone) = True Then Sign_otherIpPhone = "" Else Sign_otherIpPhone = objUser.otherIpPhone End If If objUser.info = "" Or IsNull(objUser.info) = True Then Sign_info = "" Else Sign_info = objUser.info End If If objUser.title = "" Or IsNull(objUser.title) = True Then Sign_title = "" Else Sign_title = objUser.title End If If objUser.department = "" Or IsNull(objUser.department) = True Then Sign_department = "" Else Sign_department = objUser.department End If If objUser.company = "" Or IsNull(objUser.company) = True Then Sign_company = "" Else Sign_company = objUser.company End If If objUser.manager = "" Or IsNull(objUser.manager) = True Then Sign_manager = "" Else Sign_manager = objUserMan.givenName & " " & objUserMan.sn End If ' TXT SIGNATURE Set objTextFile = objFSO.OpenTextFile(SignaturePath & "OutlookSignature.txt.template", 1, False, -2) Set objFile = objFSO.CreateTextFile(SignaturePath & "OutlookSignature.txt", True) objFile.Close Set objFile = objFSO.OpenTextFile(SignaturePath & "OutlookSignature.txt", 2) Do while NOT objTextFile.AtEndOfStream Inputline000 = objTextFile.ReadLine Outputline01 = Replace(Inputline000,"###FIRSTNAME###",Sign_givenName) Outputline02 = Replace(Outputline01,"###INITIALS###",Sign_initials) Outputline03 = Replace(Outputline02,"###LASTNAME###",Sign_sn) Outputline04 = Replace(Outputline03,"###DISPLAYNAME###",Sign_displayName) Outputline05 = Replace(Outputline04,"###DESCRIPTION###",Sign_description) Outputline06 = Replace(Outputline05,"###OFFICENAME###",Sign_physicalDeliveryOfficeName) Outputline07 = Replace(Outputline06,"###TELEPHONE###",Sign_telephoneNumber) Outputline08 = Replace(Outputline07,"###OTHERTELEPHONE###",Sign_otherTelephone) Outputline09 = Replace(Outputline08,"###EMAIL###",Sign_mail) Outputline10 = Replace(Outputline09,"###WEBPAGE###",Sign_wWWHomePage) Outputline11 = Replace(Outputline10,"###OTHERWEBPAGE###",Sign_url) Outputline12 = Replace(Outputline11,"###STREETADDRESS###",Sign_streetAddress) Outputline13 = Replace(Outputline12,"###POSTOFFICEBOX###",Sign_postOfficeBox) Outputline14 = Replace(Outputline13,"###CITY###",Sign_l) Outputline15 = Replace(Outputline14,"###STATE###",Sign_st) Outputline16 = Replace(Outputline15,"###POSTALCODE###",Sign_postalCode) Outputline17 = Replace(Outputline16,"###COUNTRYCODE###",Sign_countryCode) Outputline18 = Replace(Outputline17,"###HOMEPHONE###",Sign_homePhone) Outputline19 = Replace(Outputline18,"###OTHERHOMEPHONE###",Sign_otherHomePhone) Outputline20 = Replace(Outputline19,"###PAGER###",Sign_pager) Outputline21 = Replace(Outputline20,"###OTHERPAGER###",Sign_otherPager) Outputline22 = Replace(Outputline21,"###MOBILEPHONE###",Sign_mobile) Outputline23 = Replace(Outputline22,"###OTHERMOBILEPHONE###",Sign_otherMobile) Outputline24 = Replace(Outputline23,"###FAX###",Sign_facsimileTelephoneNumber) Outputline25 = Replace(Outputline24,"###OTHERFAX###",Sign_otherFacsimileTelephoneNumber) Outputline26 = Replace(Outputline25,"###IPPHONE###",Sign_ipPhone) Outputline27 = Replace(Outputline26,"###OTHERIPPHONE###",Sign_otherIpPhone) Outputline28 = Replace(Outputline27,"###NOTES###",Sign_info) Outputline29 = Replace(Outputline28,"###JOBTITLE###",Sign_title) Outputline30 = Replace(Outputline29,"###DEPARTMENT###",Sign_department) Outputline31 = Replace(Outputline30,"###COMPANY###",Sign_company) Outputline32 = Replace(Outputline31,"###MANAGER###",Sign_manager) objFile.Write Trim(Outputline32) & vbCrLf Loop objFile.Close objTextFile.Close Set objTextFile = Nothing ' HTM SIGNATURE Set objTextFile = objFSO.OpenTextFile(SignaturePath & "OutlookSignature.htm.template", 1, False, -2) Set objFile = objFSO.CreateTextFile(SignaturePath & "OutlookSignature.htm", True) objFile.Close Set objFile = objFSO.OpenTextFile(SignaturePath & "OutlookSignature.htm", 2) Do while NOT objTextFile.AtEndOfStream Inputline000 = objTextFile.ReadLine Outputline01 = Replace(Inputline000,"###FIRSTNAME###",Sign_givenName) Outputline02 = Replace(Outputline01,"###INITIALS###",Sign_initials) Outputline03 = Replace(Outputline02,"###LASTNAME###",Sign_sn) Outputline04 = Replace(Outputline03,"###DISPLAYNAME###",Sign_displayName) Outputline05 = Replace(Outputline04,"###DESCRIPTION###",Sign_description) Outputline06 = Replace(Outputline05,"###OFFICENAME###",Sign_physicalDeliveryOfficeName) Outputline07 = Replace(Outputline06,"###TELEPHONE###",Sign_telephoneNumber) Outputline08 = Replace(Outputline07,"###OTHERTELEPHONE###",Sign_otherTelephone) Outputline09 = Replace(Outputline08,"###EMAIL###",Sign_mail) Outputline10 = Replace(Outputline09,"###WEBPAGE###",Sign_wWWHomePage) Outputline11 = Replace(Outputline10,"###OTHERWEBPAGE###",Sign_url) Outputline12 = Replace(Outputline11,"###STREETADDRESS###",Sign_streetAddress) Outputline13 = Replace(Outputline12,"###POSTOFFICEBOX###",Sign_postOfficeBox) Outputline14 = Replace(Outputline13,"###CITY###",Sign_l) Outputline15 = Replace(Outputline14,"###STATE###",Sign_st) Outputline16 = Replace(Outputline15,"###POSTALCODE###",Sign_postalCode) Outputline17 = Replace(Outputline16,"###COUNTRYCODE###",Sign_countryCode) Outputline18 = Replace(Outputline17,"###HOMEPHONE###",Sign_homePhone) Outputline19 = Replace(Outputline18,"###OTHERHOMEPHONE###",Sign_otherHomePhone) Outputline20 = Replace(Outputline19,"###PAGER###",Sign_pager) Outputline21 = Replace(Outputline20,"###OTHERPAGER###",Sign_otherPager) Outputline22 = Replace(Outputline21,"###MOBILEPHONE###",Sign_mobile) Outputline23 = Replace(Outputline22,"###OTHERMOBILEPHONE###",Sign_otherMobile) Outputline24 = Replace(Outputline23,"###FAX###",Sign_facsimileTelephoneNumber) Outputline25 = Replace(Outputline24,"###OTHERFAX###",Sign_otherFacsimileTelephoneNumber) Outputline26 = Replace(Outputline25,"###IPPHONE###",Sign_ipPhone) Outputline27 = Replace(Outputline26,"###OTHERIPPHONE###",Sign_otherIpPhone) Outputline28 = Replace(Outputline27,"###NOTES###",Sign_info) Outputline29 = Replace(Outputline28,"###JOBTITLE###",Sign_title) Outputline30 = Replace(Outputline29,"###DEPARTMENT###",Sign_department) Outputline31 = Replace(Outputline30,"###COMPANY###",Sign_company) Outputline32 = Replace(Outputline31,"###MANAGER###",Sign_manager) objFile.Write Trim(Outputline32) & vbCrLf Loop objFile.Close objTextFile.Close Set objTextFile = Nothing ' REMOVE TEMPORARY FILES If objFSO.FileExists(SignaturePath & "OutlookSignature.htm.template") = True Then objFSO.DeleteFile SignaturePath & "OutlookSignature.htm.template" End If If objFSO.FileExists(SignaturePath & "OutlookSignature.txt.template") = True Then objFSO.DeleteFile SignaturePath & "OutlookSignature.txt.template" End If ' AUTOMATIC ACTIVATION If objFSO.FileExists(SignaturePath & "OutlookSignature.txt") Then keyPath = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles" if objRegistry.EnumKey(&H80000001, keyPath, valueNames1) = 0 then if isArray(valueNames1) then for i1 = 0 to UBound(valueNames1) if objRegistry.EnumKey(&H80000001, keyPath & "\" & valueNames1(i1), valueNames2) = 0 then if isArray(valueNames2) then for i2 = 0 to UBound(valueNames2) if objRegistry.EnumKey(&H80000001, keyPath & "\" & valueNames1(i1) & "\" & valueNames2(i2), valueNames3) = 0 then if isArray(valueNames3) then for i3 = 0 to UBound(valueNames3) If InStr(valueNames3(i3),"0000") > 0 Then If OutlookSignatureFirsNew = 1 Then objRegistry.SetBinaryValue &H80000001, keyPath & "\" & valueNames1(i1) & "\" & valueNames2(i2) & "\" & valueNames3(i3), "New Signature", OutlookSignatureBinName End If If OutlookSignatureFirsRep = 1 Then objRegistry.SetBinaryValue &H80000001, keyPath & "\" & valueNames1(i1) & "\" & valueNames2(i2) & "\" & valueNames3(i3), "Reply-Forward Signature", OutlookSignatureBinName End If SetRegCounter = SetRegCounter + 1 End If next end if end if next end if end if next end if end if keyPath = "Software\Microsoft\Office" if objRegistry.EnumKey(&H80000001, keyPath, valueNames1) = 0 then if isArray(valueNames1) then for i1 = 0 to UBound(valueNames1) if objRegistry.EnumKey(&H80000001, keyPath & "\" & valueNames1(i1) & "\Outlook\Profiles", valueNames2) = 0 then if isArray(valueNames2) then for i2 = 0 to UBound(valueNames2) if objRegistry.EnumKey(&H80000001, keyPath & "\" & valueNames1(i1) & "\Outlook\Profiles\" & valueNames2(i2), valueNames3) = 0 then if isArray(valueNames3) then for i3 = 0 to UBound(valueNames3) if objRegistry.EnumKey(&H80000001, keyPath & "\" & valueNames1(i1) & "\Outlook\Profiles\" & valueNames2(i2) & "\" & valueNames3(i3), valueNames4) = 0 then if isArray(valueNames4) then for i4 = 0 to UBound(valueNames4) If InStr(valueNames4(i4),"0000") > 0 Then If OutlookSignatureFirsNew = 1 Then objRegistry.SetBinaryValue &H80000001, keyPath & "\" & valueNames1(i1) & "\Outlook\Profiles\" & valueNames2(i2) & "\" & valueNames3(i3) & "\" & valueNames4(i4), "New Signature", OutlookSignatureBinName End If If OutlookSignatureFirsRep = 1 Then objRegistry.SetBinaryValue &H80000001, keyPath & "\" & valueNames1(i1) & "\Outlook\Profiles\" & valueNames2(i2) & "\" & valueNames3(i3) & "\" & valueNames4(i4), "Reply-Forward Signature", OutlookSignatureBinName End If SetRegCounter = SetRegCounter + 1 End If next end if end if next end if end if next end if end if objRegistry.DeleteValue &H80000001, keyPath & "\" & valueNames1(i1) & "\Outlook\Setup", "First-Run" next end if end if Set objFile = objFSO.CreateTextFile(SignatureFrst, True) objFile.Close Else If objFSO.FolderExists(SignaturePath & "OutlookSignature_files") = True Then objFSO.DeleteFolder SignaturePath & "OutlookSignature_files" End If If objFSO.FileExists(SignaturePath & "OutlookSignature.htm") = True Then objFSO.DeleteFile SignaturePath & "OutlookSignature.htm" End If If objFSO.FileExists(SignaturePath & "OutlookSignature.txt") = True Then objFSO.DeleteFile SignaturePath & "OutlookSignature.txt" End If If objFSO.FileExists(SignaturePath & "OutlookSignature.rtf") = True Then objFSO.DeleteFile SignaturePath & "OutlookSignature.rtf" End If End If End If ' FORCE RE-ACTIVATION If objFSO.FileExists(SignatureFrst) = True Or objFSO.FileExists(SignatureFlag) = True Then WScript.Sleep 60000 keyPath = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles" if objRegistry.EnumKey(&H80000001, keyPath, valueNames1) = 0 then if isArray(valueNames1) then for i1 = 0 to UBound(valueNames1) if objRegistry.EnumKey(&H80000001, keyPath & "\" & valueNames1(i1), valueNames2) = 0 then if isArray(valueNames2) then for i2 = 0 to UBound(valueNames2) if objRegistry.EnumKey(&H80000001, keyPath & "\" & valueNames1(i1) & "\" & valueNames2(i2), valueNames3) = 0 then if isArray(valueNames3) then for i3 = 0 to UBound(valueNames3) If InStr(valueNames3(i3),"0000") > 0 Then If (OutlookSignatureFirsNew = 1 And OutlookSignatureRefrNew = 1) Or objFSO.FileExists(SignatureFrst) = True Then objRegistry.SetBinaryValue &H80000001, keyPath & "\" & valueNames1(i1) & "\" & valueNames2(i2) & "\" & valueNames3(i3), "New Signature", OutlookSignatureBinName End If If (OutlookSignatureFirsRep = 1 And OutlookSignatureRefrRep = 1) Or objFSO.FileExists(SignatureFrst) = True Then objRegistry.SetBinaryValue &H80000001, keyPath & "\" & valueNames1(i1) & "\" & valueNames2(i2) & "\" & valueNames3(i3), "Reply-Forward Signature", OutlookSignatureBinName End If SetRegCounter = SetRegCounter + 1 End If next end if end if next end if end if next end if end if keyPath = "Software\Microsoft\Office" if objRegistry.EnumKey(&H80000001, keyPath, valueNames1) = 0 then if isArray(valueNames1) then for i1 = 0 to UBound(valueNames1) if objRegistry.EnumKey(&H80000001, keyPath & "\" & valueNames1(i1) & "\Outlook\Profiles", valueNames2) = 0 then if isArray(valueNames2) then for i2 = 0 to UBound(valueNames2) if objRegistry.EnumKey(&H80000001, keyPath & "\" & valueNames1(i1) & "\Outlook\Profiles\" & valueNames2(i2), valueNames3) = 0 then if isArray(valueNames3) then for i3 = 0 to UBound(valueNames3) if objRegistry.EnumKey(&H80000001, keyPath & "\" & valueNames1(i1) & "\Outlook\Profiles\" & valueNames2(i2) & "\" & valueNames3(i3), valueNames4) = 0 then if isArray(valueNames4) then for i4 = 0 to UBound(valueNames4) If InStr(valueNames4(i4),"0000") > 0 Then If (OutlookSignatureFirsNew = 1 And OutlookSignatureRefrNew = 1) Or objFSO.FileExists(SignatureFrst) = True Then objRegistry.SetBinaryValue &H80000001, keyPath & "\" & valueNames1(i1) & "\Outlook\Profiles\" & valueNames2(i2) & "\" & valueNames3(i3) & "\" & valueNames4(i4), "New Signature", OutlookSignatureBinName End If If (OutlookSignatureFirsRep = 1 And OutlookSignatureRefrRep = 1) Or objFSO.FileExists(SignatureFrst) = True Then objRegistry.SetBinaryValue &H80000001, keyPath & "\" & valueNames1(i1) & "\Outlook\Profiles\" & valueNames2(i2) & "\" & valueNames3(i3) & "\" & valueNames4(i4), "Reply-Forward Signature", OutlookSignatureBinName End If SetRegCounter = SetRegCounter + 1 End If next end if end if next end if end if next end if end if If OutlookSignatureRefrNew = 1 Or OutlookSignatureRefrRep = 1 Or objFSO.FileExists(SignatureFrst) = True Then objRegistry.DeleteValue &H80000001, keyPath & "\" & valueNames1(i1) & "\Outlook\Setup", "First-Run" End If next end if end if End If ' END If objFSO.FileExists(SignatureFrst) = True Then objFSO.DeleteFile SignatureFrst End If If SetRegCounter > 0 Then Set objFile = objFSO.CreateTextFile(SignatureFlag, True) End If objFile.Close Set objFile = Nothing Set objFSO = Nothing Set objUser = Nothing Set objSysInfo = Nothing Set oShell = Nothing |