henrydenhengst

user-environment

Mar 17th, 2015
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set objFSO=CreateObject("Scripting.FileSystemObject")
  2. oFile="userinformation.html"
  3. set objFile = objFSO.CreateTextFile(oFile,True)
  4.  
  5. ' header
  6. objFile.Write "<html>"
  7. objFile.Write "<head>"
  8. objFile.Write "<title>User Information</title>"
  9. objFile.Write "<style type=""text/css"">"
  10. objFile.Write ".hktable {font-size:12px;color:#333333;width:900;border-width: 1px;border-color: #a9a9a9;border-collapse: collapse;}"
  11. objFile.Write ".hktable th {font-size:12px;background-color:#ffffff;border-width: 1px;padding: 8px;border-style: solid;border-color: #a9a9a9;text-align:left;}"
  12. objFile.Write ".hktable tr {background-color:#cdcdcd;}"
  13. objFile.Write ".hktable td {font-size:12px;border-width: 1px;padding: 8px;border-style: solid;border-color: #a9a9a9;}"
  14. objFile.Write "</style>"
  15.  
  16. objFile.Write "</head>"
  17. objFile.Write "<body>"
  18.  
  19. set wshShell = WScript.createobject("Wscript.Shell")
  20. set wshEnv = WshShell.Environment("Process")
  21.  
  22. 'starting table
  23. objFile.Write "<table class=hktable border=1>"
  24. objFile.Write " <tr>"
  25. objFile.Write "  <th bgcolor=#fffccc>Environment item</th>"
  26. objFile.Write "  <th bgcolor=#fffccc>Value</th>"
  27. objFile.Write " </tr>"
  28.  
  29. ' splitting the array in 2 seperate variables
  30. for each envitem in WshEnv
  31.     splititem=Split(envitem,"=")
  32.  
  33. objFile.Write "  <tr>"
  34. objFile.Write "   <th>"
  35. objFile.Write splititem(0)
  36. objFile.Write "   </th>"
  37. objFile.Write "   <th>"
  38. objFile.Write splititem(1)
  39. objFile.Write "   </th>"
  40. objFile.Write "  </tr>"
  41. Next
  42.  
  43. 'footer
  44. objFile.Write "</body>"
  45. objFile.Write "</html>"
  46.  
  47. ' start html file
  48. startProcess oFile
  49.  
  50.  
  51. ' subs
  52. sub startProcess(path)
  53.                 Dim objShell
  54.                 Set objShell = createobject("Wscript.Shell")
  55.                 objShell.Run path
  56.                 Set objShell = nothing
  57. end sub
Advertisement
Add Comment
Please, Sign In to add comment