Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 19th, 2012  |  syntax: None  |  size: 8.20 KB  |  views: 30  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. On Error Resume Next
  2.  
  3. Dim strUser,strName,strTitle,strMail,strPhone,strFax
  4. Dim strCompany,strLocation,strAddress,strCity,strState
  5. Dim strZip,strWeb,strInfo,ADObject
  6.  
  7.                             'Active Directory Info Object
  8. Set ADObject = CreateObject("ADSystemInfo")
  9.  
  10. strUser = ADObject.UserName
  11.  
  12.                             'Active Directory Connection
  13. Set objUser = GetObject("LDAP://" & strUser)
  14.  
  15.                             'Pull Active Directory Info for this User
  16. strName = objUser.FullName
  17. strTitle = objUser.Title
  18. strMail = objUser.Mail
  19. strPhone = "123-456-7890"
  20. strFax = "123-456-7890"
  21. strCompany = "Company Name Inc"
  22. strLocation = objuser.physicalDeliveryOfficeName
  23. strAddress = "123 Street st"   
  24. strCity = "Anytown"
  25. strState = "CA"
  26. strZip = "90210"
  27. strWeb = "www.ourwebsite.com"
  28. strInfo = objuser.info
  29. strpobox = "PO BOX 123"
  30.  
  31. Dim objFSO, objWsh, appDataPath, pathToCopyTo, plainTextFile
  32. Dim plainTextFilePath, richTextFile, richTextFilePath, htmlFile, htmlFilePath
  33.  
  34. Set objFSO = CreateObject("Scripting.FileSystemObject")
  35. Set objWsh = CreateObject("WScript.Shell")
  36. appDataPath = objWsh.ExpandEnvironmentStrings("%APPDATA%")
  37. pathToCopyTo = appDataPath & "\Microsoft\Signatures\"
  38.  
  39. 'Create Plain Text Signature
  40. plainTextFilePath = pathToCopyTo & "Default.txt"
  41. Set plainTextFile = objFSO.CreateTextFile(plainTextFilePath, TRUE)
  42. plainTextFile.WriteLine(strName)
  43. plainTextFile.WriteLine(strTitle)
  44. plainTextFile.WriteLine(strAddress &" "& strpobox &" "& strCity & ", " & strState  & " " & strZip)
  45. plainTextFile.WriteLine("T: " & strPhone & " | " & "F: " & strFax)
  46. plainTextFile.WriteLine("")
  47. plainTextFile.WriteLine("Company Name Inc")
  48. plainTextFile.WriteLine("Company Slogan")
  49. plainTextFile.WriteLine("Company Slogan line two")
  50. plainTextFile.WriteLine("Please consider the environment before printing this email.")
  51. plainTextFile.Close
  52.  
  53. 'Create Rich Text Signature
  54. richTextFilePath = pathToCopyTo & "Default.rtf"
  55. Set richTextFile = objFSO.CreateTextFile(richTextFilePath, TRUE)
  56. richTextFile.WriteLine("{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fswiss\fcharset0Century Gothic;}}")
  57. richTextFile.WriteLine("\viewkind4\uc1\pard\f0\fs20 \par")
  58. richTextFile.WriteLine(strName & "\par")
  59. richTextFile.WriteLine(strTitle & "\par")
  60. richTextFile.WriteLine(strAddress &" "& strpobox &" "& strCity & ", " & strState  & " " & strZip &"\par")
  61. richTextFile.WriteLine("T: " & strPhone & " | " & "F: " & strFax & "\par")
  62. richTextFile.WriteLine("\par")
  63. richTextFile.WriteLine("Company Name Inc")
  64. richTextFile.WriteLine("Company Slogan""\par")
  65. richTextFile.WriteLine("Company Slogan line two""\par")
  66. richTextFile.WriteLine("Please consider the environment before printing this.")
  67. richTextFile.WriteLine("\par")
  68. richTextFile.Close
  69.  
  70. 'Create HTML Signature
  71. htmlFilePath = pathToCopyTo & "Default.htm"
  72. Set htmlFile = objFSO.CreateTextFile(htmlFilePath, TRUE)
  73. htmlfile.WriteLine("<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0Transitional//EN""""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">")
  74. htmlfile.WriteLine("<html xmlns=""http://www.w3.org/1999/xhtml"" >")
  75. htmlfile.WriteLine("<body>")
  76. htmlfile.WriteLine("<div style=""font-size:12pt;font-weight:bold;font-family:Century Gothic;"">" & strName & "</div>")
  77. htmlfile.WriteLine("<div style=""font-size:10pt;font-weight:bold;font-family:Century Gothic;"">" & strTitle & "</div>")
  78. htmlfile.WriteLine("<div style=""font-size:9.0pt;font-family:Century Gothic;"">" & strAddress &" "& strpobox &" "& strCity & ", " & strState  & " " & strZip & "</div>")
  79. htmlfile.WriteLine("<div style=""font-size:9.0pt;font-family:Century Gothic;""> T: " & strPhone & " | " & "F: " & strFax & "</div>")
  80. htmlfile.WriteLine("<br>")
  81. htmlfile.WriteLine(" <div style=""font-size:22.0pt;color:#00B050;text-decoration:none;font-family:Century Gothic;"">Company Name Inc</div>")
  82. htmlFile.WriteLine("<div style==""font-size:10.0pt;color:black;""> Company Slogan </div>")
  83. htmlFile.WriteLine("<div style==""font-size:10.0pt;color:black;""> Company Slogan line two </div>")
  84. htmlFile.WriteLine("<div style=""font-size:9.0pt;font-family:Century Gothic;color:#008C00"">Please consider the environment before printing this. </div")
  85. htmlfile.WriteLine("</div>")
  86. htmlfile.WriteLine("</body>")
  87. htmlfile.Write("</html>")
  88. htmlFile.Close
  89.  
  90. 'Create Plain Reply Text Signature
  91. plainTextFilePath = pathToCopyTo & "Reply.txt"
  92. Set plainTextFile = objFSO.CreateTextFile(plainTextFilePath, TRUE)
  93. plainTextFile.WriteLine(strName)
  94. plainTextFile.WriteLine(strTitle)
  95. plainTextFile.WriteLine(strAddress &" "& strpobox &" "& strCity & ", " & strState  & " " & strZip)
  96. plainTextFile.WriteLine("T: " & strPhone & " | " & "F: " & strFax)
  97. plainTextFile.WriteLine("")
  98. plainTextFile.WriteLine("Company Name Inc")
  99. plainTextFile.WriteLine("Company Slogan")
  100. plainTextFile.WriteLine("Company Slogan line two")
  101. plainTextFile.WriteLine("Please consider the environment before printing this email.")
  102. plainTextFile.Close
  103.  
  104. 'Create reply Rich Text Signature
  105. richTextFilePath = pathToCopyTo & "Reply.rtf"
  106. Set richTextFile = objFSO.CreateTextFile(richTextFilePath, TRUE)
  107. richTextFile.WriteLine("{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fswiss\fcharset0Century Gothic;}}")
  108. richTextFile.WriteLine("\viewkind4\uc1\pard\f0\fs20 \par")
  109. richTextFile.WriteLine(strName & "\par")
  110. richTextFile.WriteLine(strTitle & "\par")
  111. richTextFile.WriteLine(strAddress &" "& strpobox &" "& strCity & ", " & strState  & " " & strZip &"\par")
  112. richTextFile.WriteLine("T: " & strPhone & " | " & "F: " & strFax & "\par")
  113. richTextFile.WriteLine("\par")
  114. richTextFile.WriteLine("Company Name Inc")
  115. richTextFile.WriteLine("Company Slogan""\par")
  116. richTextFile.WriteLine("Company Slogan line two""\par")
  117. richTextFile.WriteLine("Please consider the environment before printing this.")
  118. richTextFile.WriteLine("\par")
  119. richTextFile.Close
  120.  
  121. 'Create HTML Relpy Signature
  122. htmlFilePath = pathToCopyTo & "Reply.htm"
  123. Set htmlFile = objFSO.CreateTextFile(htmlFilePath, TRUE)
  124. htmlfile.WriteLine("<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0Transitional//EN""""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">")
  125. htmlfile.WriteLine("<html xmlns=""http://www.w3.org/1999/xhtml"" >")
  126. htmlfile.WriteLine("<body>")
  127. htmlfile.WriteLine("<div style=""font-size:12pt;font-weight:bold;font-family:Century Gothic;"">" & strName & "</div>")
  128. htmlfile.WriteLine("<div style=""font-size:10pt;font-weight:bold;font-family:Century Gothic;"">" & strTitle & "</div>")
  129. htmlfile.WriteLine("<div style=""font-size:9.0pt;font-family:Century Gothic;"">" & strAddress &" "& strpobox &" "& strCity & ", " & strState  & " " & strZip & "</div>")
  130. htmlfile.WriteLine("<div style=""font-size:9.0pt;font-family:Century Gothic;""> T: " & strPhone & " | " & "F: " & strFax & "</div>")
  131. htmlfile.WriteLine("<br>")
  132. htmlfile.WriteLine("<div style=""font-size:22.0pt;color:#00B050;text-decoration:none;font-family:Century Gothic;"">Company Name Inc</div>")
  133. htmlFile.WriteLine("<div style==""font-size:10.0pt;color:black;""> Company Slogan </div>")
  134. htmlFile.WriteLine("<div style==""font-size:10.0pt;color:black;""> Company Slogan line two </div>")
  135. htmlFile.WriteLine("<div style=""font-size:9.0pt;font-family:Century Gothic;color:#008C00"">Please consider the environment before printing this. </div")
  136. htmlfile.WriteLine("</div>")
  137. htmlfile.WriteLine("</body>")
  138. htmlfile.Write("</html>")
  139. htmlFile.Close
  140.  
  141. Set objFSO = Nothing
  142. Set objWsh = Nothing
  143.  
  144. 'Connect to Registry
  145. Dim objShell, RegKey
  146. Set objShell =  CreateObject("WScript.Shell")
  147.  
  148. 'Disable Change of Signature for the User
  149. Set objOutlook = CreateObject("Outlook.Application")
  150. strOutlookVersion = Left(objOutlook.Version, 2)
  151. objOutlook.Quit
  152. Set objOutlook = Nothing
  153. If Right(strOutlookVersion, 1) <> "." Then
  154.       strOutlookVersion = strOutlookVersion & ".0"
  155. Else
  156.       strOutlookVersion = strOutlookVersion & "0"
  157. End If
  158.  
  159. objShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\" & strOutlookVersion & "\Common\MailSettings\NewSignature" , "Default"
  160. objShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\" & strOutlookVersion & "\Common\MailSettings\ReplySignature" , "Reply"
  161. objShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\" & strOutlookVersion & "\Outlook\Options\Mail\EnableLogging" , "0", "REG_DWORD"
  162.  
  163. Set objShell = Nothing