Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for hardware.hta

(view source code of hardware.hta as plain text)

  1. <!DOCTYPE HTML>
  2. <html lang="en">
  3. <head>
  4. <title>Basic Hardware Inventory</title>
  5.  
  6. <meta name="viewport" content="width=device-width; initial-scale=1" />
  7.  
  8. <HTA:APPLICATION
  9.   APPLICATIONNAME="Basic Hardware Inventory"
  10.   ID="Hardware"
  11.   VERSION="9.04"
  12.   ICON="Hardware.ico"
  13.   SCROLL="auto"
  14.   SINGLEINSTANCE="yes"
  15.   WINDOWSTATE="maximize"/>
  16.  
  17. <style type="text/css">
  1. html {
  2. 	height: 100%;
  3. }
  4.  
  5. body {
  6. 	font: 11pt arial,sans-serif;
  7. 	color: black;
  8. 	background-color: white;
  9. 	padding: 20px 0;
  10. 	margin: 0;
  11. 	height: 100%;
  12. 	width: 100%;
  13. }
  14.  
  15. a {
  16. 	color: red;
  17. }
  18.  
  19. code {
  20. 	color: yellow;
  21. 	font-size: 110%;
  22. }
  23.  
  24. input[type=radio] {
  25. 	width: 2em;
  26. }
  27.  
  28. table {
  29. 	max-width: 100%;
  30. }
  31.  
  32. td {
  33. 	overflow-x: auto;
  34. 	text-align: left;
  35. }
  36.  
  37. tr {
  38. 	vertical-align: top;
  39. }
  40.  
  41. .Button {
  42. 	height: 2em;
  43. 	margin: 0 1em 0 1em;
  44. 	overflow: visible;
  45. 	padding: 2px;
  46. 	vertical-align: middle;
  47. 	width: 6em;
  48. }
  49.  
  50. .Center {
  51. 	margin-left: auto;
  52. 	margin-right: auto;
  53. 	text-align: center;
  54. }
  55.  
  56. .DebugOnly {
  57. 	display: none;
  58. }
  59.  
  60. .Left {
  61. 	text-align: left;
  62. }
  63.  
  64. .Nowrap {
  65. 	white-space: nowrap;
  66. }
  67.  
  68. .Top {
  69. 	vertical-align: top;
  70. }
  71.  
  72. #CreditsScreen, #HelpScreen {
  73. 	display: none;
  74. 	margin: 0 auto;
  75. 	max-width: 90%;
  76. 	width: 800px;
  77. }
  78.  
  79. #CreditsScreen .Button, #HelpScreen .Button {
  80. 	margin: 3px;
  81. }
  82.  
  83. #HelpScreen table tr td {
  84. 	text-align: left;
  85. }
  86.  
  87. @media screen
  88. {
  89. 	.PrintOnly {
  90. 		display: none;
  91. 	}
  92. }
  93.  
  94. @media print
  95. {
  96. 	body {
  97. 		font: 12pt arial,sans-serif;
  98. 		color: black;
  99. 		background-color: white;
  100. 		filter: unset;
  101. 		padding: 0;
  102. 		margin: 0;
  103. 		height: 100%;
  104. 	}
  105.  
  106. 	.DontPrint {
  107. 		display: none;
  108. 	}
  109.  
  110. 	.Nowrap {
  111. 		white-space: normal;
  112. 	}
  113. }
  1. </style>
  2. </head>
  3.  
  4. <script language="VBScript">
  1. Option Explicit
  2.  
  3. ' File IO constants
  4. Const TristateFalse      =  0
  5. Const TristateMixed      = -2
  6. Const TristateTrue       = -1
  7. Const TristateUseDefault = -2
  8.  
  9. Const ForAppending = 8
  10. Const ForReading   = 1
  11. Const ForWriting   = 2
  12.  
  13. ' Registry hives constants
  14. Const HKEY_CLASSES_ROOT   = &H80000000
  15. Const HKEY_CURRENT_USER   = &H80000001
  16. Const HKEY_LOCAL_MACHINE  = &H80000002
  17. Const HKEY_USERS          = &H80000003
  18. Const HKEY_CURRENT_CONFIG = &H80000005
  19.  
  20. ' Registry data types constants
  21. Const REG_SZ                         =  1
  22. Const REG_EXPAND_SZ                  =  2
  23. Const REG_BINARY                     =  3
  24. Const REG_DWORD                      =  4
  25. Const REG_DWORD_BIG_ENDIAN           =  5
  26. Const REG_LINK                       =  6
  27. Const REG_MULTI_SZ                   =  7
  28. Const REG_RESOURCE_LIST              =  8
  29. Const REG_FULL_RESOURCE_DESCRIPTOR   =  9
  30. Const REG_RESOURCE_REQUIREMENTS_LIST = 10
  31. Const REG_QWORD                      = 11
  32.  
  33. ' Character and year to be displayed in copyrights notices
  34. Const COPYRIGHTS_YEAR = 2025
  35. Dim COPYRIGHTS_CHAR
  36. COPYRIGHTS_CHAR = Chr( 169 ) ' May need correction in non-latin languages
  37.  
  38. Const KB = 1024
  39. Const MB = 1048576 ' 1024 * 1024
  40. Const GB = 1073741824 ' 1024 * 1024 * 1024
  41. Const TB = 1099511627776 ' 1024 * 1024 * 1024 * 1024
  42.  
  43. ' Variable to get elevation status
  44. Dim gvbIsElevated
  45.  
  46. ' Variable to hold local/remote check result
  47. Dim gvbIsLocalComputer
  48.  
  49. ' Variables to hold the command line
  50. Dim gvsCommandline, gvsCommandlineUC
  51.  
  52. ' Global File System Object
  53. Dim gvoFSO
  54.  
  55. ' Global variables to receive the WinSAT scores
  56. Dim sngCPU, sngDisk, sngMemory, sngTotal, sngVideo
  57.  
  58. ' Minimum window size
  59. Dim gviMinHeight, gviMinWidth
  60.  
  61. ' Configuration file
  62. Dim gvsConfigFile
  63.  
  64. ' Temporary files to display detailed query results and print previews
  65. Dim gvsDetailsFile, gvsPrintFile
  66.  
  67. ' Path to DMIDecode.exe
  68. Dim gvsDMIDecode
  69.  
  70. ' Dictionary objects to hold all defaults, permanent settings and session settings
  71. Dim gvaDefaultsBool, gvaDefaultsStr, gvaSettingsBool, gvaSettingsStr
  72.  
  73. ' Internet connection available?
  74. Dim gvbConnected
  75. gvbConnected = True
  76.  
  77. ' Random generator
  78. Dim gvoRandom
  79.  
  80. ' Registry DataTypes to string
  81. Dim gvaRegDataType(11)
  82. gvaRegDataType(1)  = "REG_SZ"
  83. gvaRegDataType(2)  = "REG_EXPAND_SZ"
  84. gvaRegDataType(3)  = "REG_BINARY"
  85. gvaRegDataType(4)  = "REG_DWORD"
  86. gvaRegDataType(5)  = "REG_DWORD_BIG_ENDIAN"
  87. gvaRegDataType(6)  = "REG_LINK"
  88. gvaRegDataType(7)  = "REG_MULTI_SZ"
  89. gvaRegDataType(8)  = "REG_RESOURCE_LIST"
  90. gvaRegDataType(9)  = "REG_FULL_RESOURCE_DESCRIPTOR"
  91. gvaRegDataType(10) = "REG_RESOURCE_REQUIREMENTS_LIST"
  92. gvaRegDataType(11) = "REG_QWORD"
  93.  
  94. ' WMI objects for all namespaces used in this HTA
  95. Dim gvoWMIlocalCimv2, gvoWMIrootCimv2, gvoWMIrootMSWinStorage, gvoWMIrootStandardCimv2, gvoWMIrootWMI
  96.  
  97. ' Other global variables
  98. Dim gvaCSSColors, gvaPATH, gvaVideo( )
  99. Dim gvbSilent, gvbWinPE
  100. Dim clrBgErr, clrTxtErr
  101. Dim gvcBanks, gvcCPU, gvcMemory
  102. Dim gviNumOS, gviMemSize, gviMemSpeed
  103. Dim gvoHDDInterfaces, gvoWSHShell
  104. Dim gvsDefaultBrowserName, gvsDefaultBrowserPath
  105. Dim gvsAudioRegKey, gvsBIOSSerial, gvsComputer, gvsCSVTxt, gvsDebugText, gvsDetails, gvsHeader, gvsPATH, gvsSlots, gvsWinDrive
  106.  
  107.  
  108. Sub window_onload
  109. 	Dim blnComputer, strFile
  110.  
  111. 	' Global File System and WSH Shell objects must be initialized here because they are requireded now, before Initialize( ) subroutine has run
  112. 	Set gvoWSHShell      = CreateObject( "WScript.Shell" )
  113. 	Set gvoFSO           = CreateObject( "Scripting.FileSystemObject" )
  114. 	Set gvoWMIlocalCimv2 = GetObject( "winmgmts://./root/CIMV2" )
  115.  
  116. 	' Check if in WinPE
  117. 	gvbWinPE = CheckWinPE( )
  118.  
  119. 	' Initialize the program window
  120. 	AppVersion.innerHTML  = Hardware.Version
  121. 	HelpVer.innerHTML     = Hardware.Version
  122. 	CredVersion.innerHTML = Hardware.Version
  123. 	AppYear.innerHTML     = COPYRIGHTS_YEAR
  124. 	document.title = "Basic Hardware Inventory (Version " & Hardware.Version & ") " & COPYRIGHTS_CHAR & " 2005 - " & COPYRIGHTS_YEAR & ", Rob van der Woude"
  125.  
  126. 	' Initialize the program
  127. 	Initialize ' includes read and set defaults
  128. 	ConfigReadFile
  129. 	ConfigReadCommandline
  130. 	ConfigUpdateStatus
  131.  
  132. 	ButtonCopy.disabled  = True
  133. 	ButtonPaste.disabled = False
  134. 	ButtonPrint.disabled = True
  135. 	ButtonSave.disabled  = True
  136. 	If gvaSettingsBool.Item( "BASIC" ) Then
  137. 		ButtonBasic.value = "Full"
  138. 	End If
  139. 	CheckboxBIOS.Checked            = Not gvaSettingsBool.Item( "BASIC" )
  140. 	CheckboxCDROM.Checked           = Not gvaSettingsBool.Item( "BASIC" )
  141. 	CheckboxCPU.Checked             = True
  142. 	CheckboxFDD.Checked             = Not gvaSettingsBool.Item( "BASIC" )
  143. 	CheckboxHDD.Checked             = True
  144. 	CheckboxKeyboard.Checked        = Not gvaSettingsBool.Item( "BASIC" )
  145. 	CheckboxMainBoard.Checked       = Not gvaSettingsBool.Item( "BASIC" )
  146. 	CheckboxMemory.Checked          = True
  147. 	CheckboxMonitor.Checked         = Not gvaSettingsBool.Item( "BASIC" )
  148. 	CheckboxMouse.Checked           = Not gvaSettingsBool.Item( "BASIC" )
  149. 	CheckboxNIC.Checked             = Not gvaSettingsBool.Item( "BASIC" )
  150. 	CheckboxPorts.Checked           = Not gvaSettingsBool.Item( "BASIC" )
  151. 	CheckboxVideo.Checked           = Not gvaSettingsBool.Item( "BASIC" )
  152. 	CheckboxSound.Checked           = Not gvaSettingsBool.Item( "BASIC" )
  153. 	ButtonDetailsBIOS.disabled      = True
  154. 	ButtonDetailsCPU.disabled       = True
  155. 	ButtonDetailsCDROM.disabled     = True
  156. 	ButtonDetailsFDD.disabled       = True
  157. 	ButtonDetailsHDD.disabled       = True
  158. 	ButtonDetailsKeyboard.disabled  = True
  159. 	ButtonDetailsMainBoard.disabled = True
  160. 	ButtonDetailsMemory.disabled    = True
  161. 	ButtonDetailsMonitor.disabled   = True
  162. 	ButtonDetailsMouse.disabled     = True
  163. 	ButtonDetailsNIC.disabled       = True
  164. 	ButtonDetailsPorts.disabled     = True
  165. 	ButtonDetailsSound.disabled     = True
  166. 	ButtonDetailsVideo.disabled     = True
  167.  
  168. 	If InStr( gvsCommandlineUC, "/?" ) Or InStr( gvsCommandlineUC, "/HELP" ) Then showHelp
  169.  
  170. 	If gvaSettingsBool.Item( "DEVTEST" ) Then Set gvoRandom = CreateObject( "System.Random" )
  171.  
  172. 	window.offscreenBuffering = True
  173.  
  174. 	gviNumOS = GetOSVer( )
  175. 	If Split( gviNumOS, "." )(0) < 8 Then
  176. 		MsgBox "As of version 9.00, this HTA requires Windows 8 or later." & vbCrLf & vbCrLf & "Use Hardware.hta version 8.04 for Windows 7 or older Windows versions.", vbOKOnly + vbExclamation, "Windows version issue"
  177. 		self.window.close
  178. 		Exit Sub
  179. 	End If
  180.  
  181. 	GetDefaultBrowser
  182.  
  183. 	If Not IsAdmin( True ) Then
  184. 		Self.window.close
  185. 		Exit Sub
  186. 	End If
  187.  
  188. 	blnComputer = CBool( InStr( gvsCommandlineUC, "/COMPUTER:" ) )
  189. 	gvbSilent   = gvaSettingsBool.Item( "COPY" ) Or gvaSettingsBool.Item( "PRINT" ) Or ( gvaSettingsStr.Item( "SAVE" ) <> "" )
  190. 	If gvbSilent Or blnComputer Then Inventory
  191. 	If gvbSilent Then
  192. 		If gvaSettingsBool.Item( "COPY" )      Then CopyToClipboard
  193. 		If gvaSettingsBool.Item( "PRINT" )     Then Print
  194. 		If gvaSettingsStr.Item( "SAVE" ) <> "" Then strFile = SaveTabDelimited( )
  195. 		window.close
  196. 		Exit Sub
  197. 	End If
  198.  
  199. 	' Start a separate thread/process for the update check
  200. 	setTimeout "CheckUpdate", 100, "VBScript"
  201.  
  202. 	ComputerName.focus
  203. End Sub
  204.  
  205.  
  206. Sub Add2CsvBIOS( )
  207. 	gvsHeader = gvsHeader _
  208. 	          & vbTab & "BIOS Manufacturer:" _
  209. 	          & vbTab & "BIOS Model:"   _
  210. 	          & vbTab & "BIOS Version:" _
  211. 	          & vbTab & "BIOS Date:"    _
  212. 	          & vbTab & "BIOS Serial Number:"
  213. 	On Error Resume Next ' REQUIRED
  214. 	gvsCSVTxt = gvsCSVTxt & vbTab
  215. 	gvsCSVTxt = gvsCSVTxt & BIOSManufacturer.value
  216. 	gvsCSVTxt = gvsCSVTxt & vbTab
  217. 	gvsCSVTxt = gvsCSVTxt & BIOSModel.value
  218. 	gvsCSVTxt = gvsCSVTxt & vbTab
  219. 	gvsCSVTxt = gvsCSVTxt & BIOSVersion.value
  220. 	gvsCSVTxt = gvsCSVTxt & vbTab
  221. 	gvsCSVTxt = gvsCSVTxt & BIOSDate.value
  222. 	gvsCSVTxt = gvsCSVTxt & vbTab
  223. 	gvsCSVTxt = gvsCSVTxt & gvsBIOSSerial
  224. 	On Error GoTo 0
  225. End Sub
  226.  
  227.  
  228. Sub Add2CsvCDROM( )
  229. 	Dim i
  230. 	On Error Resume Next ' REQUIRED
  231. 	For i = 0 To 64
  232. 		gvsCSVTxt = gvsCSVTxt _
  233. 		          & vbTab & document.getElementById( "CDROM" & i & "Model"     ).value _
  234. 		          & vbTab & document.getElementById( "CDROM" & i & "Firmware"  ).value _
  235. 		          & vbTab & document.getElementById( "CDROM" & i & "Interface" ).value
  236. 		If Err Then
  237. 			Exit For
  238. 		Else
  239. 			gvsHeader = gvsHeader _
  240. 			           & vbTab & "CDROM " & i & " Model:"    _
  241. 			           & vbTab & "CDROM " & i & " Firmware:" _
  242. 			           & vbTab & "CDROM " & i & " Interface:"
  243. 		End if
  244. 	Next
  245. 	On Error GoTo 0
  246. End Sub
  247.  
  248.  
  249. Sub Add2CsvCPU
  250. 	gvsHeader = gvsHeader _
  251. 	          & vbTab & "# CPUs:" _
  252. 	          & vbTab & "CPU Type:" _
  253. 	          & vbTab & "CPU Speed:" _
  254. 	          & vbTab & "CPU Socket:" _
  255. 	          & vbTab & "WinSat CPU Score:"
  256. 	On Error Resume Next ' REQUIRED
  257. 	gvsCSVTxt = gvsCSVTxt & vbTab
  258. 	gvsCSVTxt = gvsCSVTxt & CPUNumber.value
  259. 	gvsCSVTxt = gvsCSVTxt & vbTab
  260. 	gvsCSVTxt = gvsCSVTxt & CPUModel.value
  261. 	gvsCSVTxt = gvsCSVTxt & vbTab
  262. 	gvsCSVTxt = gvsCSVTxt & CPUSpeed.value
  263. 	gvsCSVTxt = gvsCSVTxt & vbTab
  264. 	gvsCSVTxt = gvsCSVTxt & CPUSocket.value
  265. 	gvsCSVTxt = gvsCSVTxt & vbTab
  266. 	gvsCSVTxt = gvsCSVTxt & CPUScore.value
  267. 	On Error GoTo 0
  268. End Sub
  269.  
  270.  
  271. Sub Add2CsvFDD( )
  272. 	Dim i
  273. 	On Error Resume Next ' REQUIRED
  274. 	For i = 0 To 256
  275. 		gvsCSVTxt = gvsCSVTxt _
  276. 		          & vbTab & document.getElementById( "FDD" & i & "DeviceID"    ).value _
  277. 		          & vbTab & document.getElementById( "FDD" & i & "Description" ).value _
  278. 		          & vbTab & document.getElementById( "FDD" & i & "Capacity"    ).value _
  279. 		          & vbTab & document.getElementById( "FDD" & i & "Interface"   ).value
  280. 		If Err Then
  281. 			Exit For
  282. 		Else
  283. 				gvsHeader = gvsHeader _
  284. 				          & vbTab & "FDD " & i & " Drive:"       _
  285. 				          & vbTab & "FDD " & i & " Description:" _
  286. 				          & vbTab & "FDD " & i & " Capacity:"    _
  287. 				          & vbTab & "FDD " & i & " Interface:"
  288. 		End If
  289. 	Next
  290. 	On Error GoTo 0
  291. End Sub
  292.  
  293.  
  294. Sub Add2CsvHDD( )
  295. 	Dim i
  296. 	On Error Resume Next ' REQUIRED
  297. 	For i = 0 To 256
  298. 		gvsCSVTxt = gvsCSVTxt _
  299. 		          & vbTab & document.getElementById( "HardDisk" & i & "Model"     ).value _
  300. 		          & vbTab & document.getElementById( "HardDisk" & i & "Size"      ).value _
  301. 		          & vbTab & document.getElementById( "HardDisk" & i & "Interface" ).value
  302. 		If Err Then
  303. 			Exit For
  304. 		Else
  305. 				gvsHeader = gvsHeader _
  306. 				          & vbTab & "HDD " & i & " Model:"     _
  307. 				          & vbTab & "HDD " & i & " Size (GB):" _
  308. 				          & vbTab & "HDD " & i & " Interface:"
  309. 		End If
  310. 	Next
  311. 	On Error GoTo 0
  312. 	gvsHeader = gvsHeader & vbTab & "WinSat Disk Score:"
  313. 	gvsCSVTxt = gvsCSVTxt & vbTab & DiskScore.value
  314. End Sub
  315.  
  316.  
  317. Sub Add2CsvKbd( )
  318. 	gvsHeader = gvsHeader _
  319. 	          & vbTab & "Keyboard Type:" _
  320. 	          & vbTab & "Keyboard Model:"
  321. 	On Error Resume Next ' REQUIRED
  322. 	gvsCSVTxt = gvsCSVTxt & vbTab
  323. 	gvsCSVTxt = gvsCSVTxt & KeyboardType.value
  324. 	gvsCSVTxt = gvsCSVTxt & vbTab
  325. 	gvsCSVTxt = gvsCSVTxt & KeyboardModel.value
  326. 	On Error GoTo 0
  327. End Sub
  328.  
  329.  
  330. Sub Add2CsvMainBoard( )
  331. 	gvsHeader = gvsHeader            & vbTab _
  332. 	          & "Chassis:"           & vbTab _
  333. 	          & "MB Manufacturer:"   & vbTab _
  334. 	          & "MB Model:"          & vbTab _
  335. 	          & "MB Version:"        & vbTab _
  336. 	          & "WinSAT Score:"
  337. 	gvsCSVTxt = gvsCSVTxt            & vbTab _
  338. 	          & ChassisType.value    & vbTab _
  339. 	          & MBManufacturer.value & vbTab _
  340. 	          & MBModel.value        & vbTab _
  341. 	          & MBVersion.value      & vbTab _
  342. 	          & WinSATScore.value
  343. End Sub
  344.  
  345.  
  346. Sub Add2CsvMemory
  347. 	gvsHeader = gvsHeader _
  348. 	          & vbTab & "# Memory Banks:" _
  349. 	          & vbTab & "# Memory Modules:" _
  350. 	          & vbTab & "Total Memory (MB):" _
  351. 	          & vbTab & "Memory Speed (ns):" _
  352. 	          & vbTab & "Memory FormFactor:" _
  353. 	          & vbTab & "WinSat Memory Score:"
  354.     On Error Resume Next ' REQUIRED
  355.     gvsCSVTxt = gvsCSVTxt & vbTab
  356.     gvsCSVTxt = gvsCSVTxt & gvcBanks
  357.     gvsCSVTxt = gvsCSVTxt & vbTab
  358.     gvsCSVTxt = gvsCSVTxt & gvcMemory
  359.     gvsCSVTxt = gvsCSVTxt & vbTab
  360.     gvsCSVTxt = gvsCSVTxt & MemorySize.value
  361.     gvsCSVTxt = gvsCSVTxt & vbTab
  362.     gvsCSVTxt = gvsCSVTxt & MemorySpeed.value
  363.     gvsCSVTxt = gvsCSVTxt & vbTab
  364.     gvsCSVTxt = gvsCSVTxt & MemoryFormFactor.value
  365.     gvsCSVTxt = gvsCSVTxt & vbTab
  366.     gvsCSVTxt = gvsCSVTxt & MemoryScore.value
  367. 	On Error GoTo 0
  368. End Sub
  369.  
  370.  
  371. Sub Add2CsvMouse( )
  372. 	gvsHeader = gvsHeader _
  373. 	          & vbTab & "Mouse Type:"    _
  374. 	          & vbTab & "Mouse Model:"
  375. 	On Error Resume Next ' REQUIRED
  376. 	gvsCSVTxt = gvsCSVTxt & vbTab
  377. 	gvsCSVTxt = gvsCSVTxt & MouseType.value
  378. 	gvsCSVTxt = gvsCSVTxt & vbTab
  379. 	gvsCSVTxt = gvsCSVTxt & MouseModel.value
  380. 	On Error GoTo 0
  381. End Sub
  382.  
  383.  
  384. Sub Add2CsvNIC
  385. 	Dim i
  386. 	On Error Resume Next ' REQUIRED
  387. 	For i = 0 To 64
  388. 		gvsCSVTxt = gvsCSVTxt _
  389. 		          & vbTab & document.getElementById( "NICModel" & i ).value _
  390. 		          & vbTab & document.getElementById( "MACAddress" & i ).value _
  391. 		          & vbTab & document.getElementById( "NICSpeed" & i ).value
  392. 		If Err Then
  393. 			Exit For
  394. 		Else
  395. 			gvsHeader = gvsHeader _
  396. 			          & vbTab & "NIC " & i & " Model (and medium):" _
  397. 			          & vbTab & "NIC " & i & " MAC Address:" _
  398. 			          & vbTab & "NIC " & i & " Speed:"
  399. 		End if
  400. 	Next
  401. 	On Error GoTo 0
  402. End Sub
  403.  
  404.  
  405. Sub Add2CsvPorts
  406. 	gvsHeader = gvsHeader _
  407. 	          & vbTab & "USB:" _
  408. 	          & vbTab & "System Slots:" _
  409. 	          & vbTab & "Parallel Ports:" _
  410. 	          & vbTab & "Serial Ports:"
  411. 	On Error Resume Next ' REQUIRED
  412. 	gvsCSVTxt = gvsCSVTxt & vbTab
  413. 	gvsCSVTxt = gvsCSVTxt & USB.value
  414. 	gvsCSVTxt = gvsCSVTxt & vbTab
  415. 	gvsCSVTxt = gvsCSVTxt & gvsSlots
  416. 	gvsCSVTxt = gvsCSVTxt & vbTab
  417. 	gvsCSVTxt = gvsCSVTxt & Parallel.value
  418. 	gvsCSVTxt = gvsCSVTxt & vbTab
  419. 	gvsCSVTxt = gvsCSVTxt & Serial.value
  420. 	On Error GoTo 0
  421. End Sub
  422.  
  423.  
  424. Sub Add2CsvSound
  425. 	gvsHeader = gvsHeader _
  426. 	          & vbTab & "Sound Card Model:" _
  427. 	          & vbTab & "Sound Card Manufacturer:"
  428. 	On Error Resume Next ' REQUIRED
  429. 	gvsCSVTxt = gvsCSVTxt & vbTab
  430. 	gvsCSVTxt = gvsCSVTxt & SoundCardManufacturer.value
  431. 	gvsCSVTxt = gvsCSVTxt & vbTab
  432. 	gvsCSVTxt = gvsCSVTxt & SoundCardModel.value
  433. 	On Error GoTo 0
  434. End Sub
  435.  
  436.  
  437. Sub Add2CsvVideo( )
  438. 	Dim i
  439. 	On Error Resume Next ' REQUIRED
  440. 	For i = 0 To 32
  441. 		gvsCSVTxt = gvsCSVTxt _
  442. 		          & vbTab & document.getElementById( "VideoModel"  & i ).value _
  443. 		          & vbTab & document.getElementById( "VideoMemory" & i ).value _
  444. 		          & vbTab & document.getElementById( "VideoMode"   & i ).value
  445. 		If Err Then
  446. 			Exit For
  447. 		Else
  448. 			gvsHeader = gvsHeader _
  449. 			          & vbTab & "Video " & i & " Model:" _
  450. 			          & vbTab & "Video " & i & " Memory (MB):" _
  451. 			          & vbTab & "Video " & i & " Mode:"
  452. 		End If
  453. 	Next
  454. 	gvsCSVTxt = gvsCSVTxt & vbTab & GraphicsScore.value
  455. 	gvsHeader = gvsHeader & vbTab & "WinSat Graphics Score:"
  456. 	On Error GoTo 0
  457. End Sub
  458.  
  459.  
  460. Function Align( myString, myLength )
  461. 	Align = Left( myString & Space( myLength ), myLength )
  462. End Function
  463.  
  464.  
  465. Sub Basic( )
  466. 	gvaSettingsBool.Item( "BASIC" ) = Not gvaSettingsBool.Item( "BASIC" )
  467. 	CheckboxBIOS.Checked            = Not gvaSettingsBool.Item( "BASIC" )
  468. 	CheckboxCDROM.Checked           = Not gvaSettingsBool.Item( "BASIC" )
  469. 	CheckboxCPU.Checked             = True
  470. 	CheckboxHDD.Checked             = True
  471. 	CheckboxFDD.Checked             = Not gvaSettingsBool.Item( "BASIC" )
  472. 	CheckboxKeyboard.Checked        = Not gvaSettingsBool.Item( "BASIC" )
  473. 	CheckboxMainBoard.Checked       = Not gvaSettingsBool.Item( "BASIC" )
  474. 	CheckboxMemory.Checked          = True
  475. 	CheckboxMonitor.Checked         = Not gvaSettingsBool.Item( "BASIC" )
  476. 	CheckboxMouse.Checked           = Not gvaSettingsBool.Item( "BASIC" )
  477. 	CheckboxNIC.Checked             = Not gvaSettingsBool.Item( "BASIC" )
  478. 	CheckboxPorts.Checked           = Not gvaSettingsBool.Item( "BASIC" )
  479. 	CheckboxVideo.Checked           = Not gvaSettingsBool.Item( "BASIC" )
  480. 	CheckboxSound.Checked           = Not gvaSettingsBool.Item( "BASIC" )
  481. 	If gvaSettingsBool.Item( "BASIC" ) Then
  482. 		ButtonBasic.value     = "Full"
  483. 		ButtonBasic.accessKey = "f"
  484. 	Else
  485. 		ButtonBasic.value     = "Basic"
  486. 		ButtonBasic.accessKey = "b"
  487. 	End If
  488. End Sub
  489.  
  490.  
  491. Function Chain( myCharList )
  492. 	Dim intChar, strChar, strCharChain
  493. 	Chain = ""
  494. 	If Not IsArray( myCharList ) Then
  495. 		If InStr( myCharList, ";" ) Then
  496. 			myCharList = Split( myCharList, ";" )
  497. 		ElseIf InStr( myCharList, "," ) Then
  498. 			myCharList = Split( myCharList, "," )
  499. 		Else
  500. 			Exit Function
  501. 		End If
  502. 	End If
  503. 	For Each intChar In myCharList
  504. 		If CInt( intChar ) = 0 Then
  505. 			' Uncomment next line to abort at first null character
  506. 			' Exit For
  507. 			' Comment next line when aborting at first null character
  508. 			strChar = " "
  509. 		Else
  510. 			strChar = Chr( intChar )
  511. 		End If
  512. 		strCharChain = strCharChain & strChar
  513. 	Next
  514. 	Chain = Trim( strCharChain )
  515. End Function
  516.  
  517.  
  518. Function CheckComputerName( myComputerName )
  519. 	Dim blnReady, colItems, objItem, objWMIService, strComputerName
  520. 	strComputerName = UCase( myComputerName )
  521. 	CheckComputerName = ""
  522. 	blnReady = False
  523. 	If Not gvbWinPE Then
  524. 		strComputerName = GetHostName( strComputerName )
  525. 		If strComputerName = "" Then
  526. 			MsgBox "Error while trying to ping computer " & strComputerName, vbOKOnly, "Connection Error"
  527. 			Reset
  528. 			Exit Function
  529. 		End If
  530. 	End If
  531. 	CheckComputerName = strComputerName
  532. End Function
  533.  
  534.  
  535. Sub CheckDMIDecode( )
  536. 	Dim blnFound, i
  537. 	blnFound = False
  538. 	If gvbWinPE Then Exit Sub
  539. 	For i = 0 To UBound( gvaPATH )
  540. 		With gvoFSO
  541. 			gvsDMIDecode = .BuildPath( gvaPATH(i), "dmidecode.exe" )
  542. 			If .FileExists( gvsDMIDecode ) Then
  543. 				blnFound = True
  544. 				Exit For
  545. 			End If
  546. 		End With
  547. 	Next
  548. 	gvaSettingsBool.Item( "DMIDECODE" ) = gvaSettingsBool.Item( "DMIDECODE" ) And blnFound
  549. 	CheckboxDMIDecode.disabled = Not blnFound
  550. 	DebugMessage "", "DMIDecode found: " & CStr( blnFound )
  551. End Sub
  552.  
  553.  
  554. Sub CheckKey( )
  555. 	' Backspace
  556. 	If SettingsScreen.style.display = "none" And MainScreen.style.display = "none" Then ' Not in Settings or Main screen
  557. 		If Self.window.event.keyCode =  8 Then
  558. 			ShowMain ' BackSpace => Back to main window
  559. 		End If
  560. 	End If
  561. 	' Escape
  562. 	If Self.window.event.keyCode = 27 Then
  563. 		ShowMain ' Esc => Back to main window
  564. 	End If
  565. 	' Enter
  566. 	If Not MainScreen.style.display = "none" Then ' In Main screen
  567. 		If Self.window.event.keyCode =  13 Then
  568. 			Inventory ' Enter => Start inventory
  569. 		End If
  570. 	End if
  571. 	If Self.window.event.altKey Then
  572. 		If Self.window.event.keyCode = 68 Then ' Alt+d, toggle Debug mode
  573. 			gvaSettingsBool.Item( "DEBUG" ) = Not gvaSettingsBool.Item( "DEBUG" )
  574. 			ConfigUpdateStatus
  575. 		End If
  576. 	End If
  577. End Sub
  578.  
  579.  
  580. Sub CheckUpdate( )
  581. 	Dim intAnswer, intButtons, lenLatestVer, strCurrentVer, strLatestver, strPrompt, strTitle
  582.  
  583. 	If Not gvaSettingsBool.Item( "NOUPD" ) And Not gvbWinPE Then
  584. 		' Change cursor to hourglass while checking for update
  585. 		Document.Body.style.Cursor = "wait"
  586.  
  587. 		intButtons = vbYesNoCancel + vbApplicationModal + vbInformation
  588. 		strCurrentVer = Split( Hardware.Version )(0)
  589. 		strLatestVer  = TextFromHTML( "https://www.robvanderwoude.com/updates/hardware.txt" )
  590.  
  591. 		If strCurrentVer <> strLatestver Then
  592. 			On Error Resume Next ' REQUIRED
  593. 			' Clear the IE cache
  594. 			gvoWSHShell.Run "RUNDll32.EXE InetCpl.cpl,ClearMyTracksByProcess 8", 7, True
  595. 			' Try again, read the latest version info from the web
  596. 			strLatestver = TextFromHTML( "https://www.robvanderwoude.com/updates/hardware.txt" )
  597. 			On Error Goto 0
  598. 		End If
  599.  
  600. 		DebugMessage "Check for Update", Align( "Connected to Internet:", 25 ) & gvbConnected  & vbCrLf & Align( "Current Version:", 25 ) & strCurrentVer & vbCrLf & Align( "Latest  Version:", 25 ) & strLatestver  & vbCrLf
  601.  
  602. 		If gvbConnected Then
  603. 			lenLatestVer = Len( strLatestVer )
  604. 			If lenLatestVer >= 4 And lenLatestVer <= 6 Then
  605. 				If strLatestVer < strCurrentVer Then
  606. 					strTitle  = "Unofficial version"
  607. 					strPrompt = "You seem to be using a pre-release version (" & strCurrentVer & ") of Hardware.hta." _
  608. 					          & vbCrLf & vbCrLf _
  609. 					          & "The latest official release is " & strLatestver _
  610. 					          & vbCrLf & vbCrLf _
  611. 					          & "Do you want to download the latest official release?"
  612. 					intAnswer = MsgBox( strPrompt, intButtons + vbDefaultButton2, strTitle )
  613. 					If intAnswer = vbYes Then
  614. 						gvoWSHShell.Run "https://www.robvanderwoude.com/hardware.php", 7, False
  615. 					End If
  616. 				End If
  617. 				If strLatestVer > strCurrentVer Then
  618. 					strTitle  = "Old version"
  619. 					strPrompt = "You are using version " & strCurrentVer & " of Hardware.hta." _
  620. 					          & vbCrLf & vbCrLf _
  621. 					          & "The latest official release is " & strLatestver _
  622. 					          & vbCrLf & vbCrLf _
  623. 					          & "Do you want to download the latest official release?"
  624. 					intAnswer = MsgBox( strPrompt, intButtons, strTitle )
  625. 					If intAnswer = vbYes Then
  626. 						gvoWSHShell.Run "https://www.robvanderwoude.com/hardware.php", 7, False
  627. 					End If
  628. 				End If
  629. 			Else
  630. 				strTitle  = "Update Check Failure"
  631. 				strPrompt = "Unable to check for updates." _
  632. 				          & vbCrLf & vbCrLf _
  633. 				          & "Do you want to ""manually"" check for updates now?"
  634. 				intAnswer = MsgBox( strPrompt, intButtons, strTitle )
  635. 				If intAnswer = vbYes Then
  636. 					gvoWSHShell.Run "https://www.robvanderwoude.com/hardware.php", 7, False
  637. 				End If
  638. 			End If
  639. 		End If
  640.  
  641. 		' Change cursor back to default
  642. 		Document.Body.style.Cursor = "default"
  643. 	End If
  644. End Sub
  645.  
  646.  
  647. Function CheckWinPE( )
  648. 	' Check if running in WinPE environment
  649. 	' Based on a tip by Mitch Tulloch
  650. 	' http://techgenix.com/HowtodetectwhetheryouareinWindowsPE/
  651. 	Dim arrKeys, blnWinPE, colItems, i, objItem, objReg, objWMIService
  652. 	blnWinPE = False
  653.     Set objReg = GetObject( "winmgmts:{impersonationLevel=impersonate}!//./root/default:StdRegProv" )
  654. 	objReg.EnumKey HKEY_LOCAL_MACHINE, "SYSTEM\ControlSet001\Control", arrKeys
  655. 	For i = 0 To UBound( arrKeys )
  656. 		If UCase( arrKeys(i) ) = "MININT" Then
  657. 			blnWinPE = True
  658. 			Exit For
  659. 		End If
  660. 	Next
  661. 	Set objReg = Nothing
  662. 	If blnWinPE Then
  663. 		' Find computer name when in WinPE
  664. 		' Based on code by Richie Schuster
  665. 		' http://www.sccmog.com/get-current-old-machine-name-winpe-vbscript/
  666. 		Set objWMIService = GetObject( "winmgmts://./root/CIMV2" )
  667. 		Set colItems = objWMIService.ExecQuery ( "Select * From Win32_LogicalDisk" )
  668. 		gvsWinDrive = ""
  669. 		For Each objItem in colItems
  670. 			' Find Windows system drive (won't work if Windows folder is renamed)
  671. 			If gvoFSO.FolderExists( gvoFSO.BuildPath( objItem.DeviceID, "Windows\System32\config" ) ) Then
  672. 				gvsWinDrive = objItem.DeviceID
  673. 			End If
  674. 		Next
  675. 		Set colItems = Nothing
  676. 		If gvsWinDrive <> "" Then
  677. 			' Mount registry hive from Windows Drive
  678. 			gvoWSHShell.Run "CMD.EXE /C REG.EXE Load HKLM\TempHive " & gvsWinDrive & "\windows\system32\config\system", 0, True
  679. 			' Read computer name from mounted registry hive
  680. 			gvsComputer = wshShell.RegRead( "HKEY_LOCAL_MACHINE\TempHive\ControlSet001\Control\ComputerName\ComputerName" )
  681. 			' Unmount temporary registry hive
  682. 			gvoWSHShell.Run "CMD.EXE /C REG.EXE Unload HKLM\TempHive", 0, True
  683. 		End If
  684. 		Set objWMIService = Nothing
  685. 	End If
  686. 	CheckWinPE = blnWinPE
  687. End Function
  688.  
  689.  
  690. Sub ConfigReadCommandline( )
  691. 	Dim objRE
  692. 	Dim strDebug, strItem, strKey, strSubItem
  693. 	For Each strKey In gvaSettingsBool.Keys
  694. 		If InStr( gvsCommandlineUC, "/" & UCase( strKey ) ) Then gvaSettingsBool.Item( strKey ) = True
  695. 	Next
  696. 	strItem = GetParameter( gvsCommandline, "COMPUTER" )
  697. 	If strItem <> "" Then gvaSettingsStr.Item( "COMPUTER" ) = UCase( strItem )
  698. 	strItem = GetParameter( gvsCommandline, "SAVE" )
  699. 	If strItem <> "" Then
  700. 		With gvoFSO
  701. 			strItem = .GetAbsolutePathName( strItem )
  702. 			If .FolderExists( .GetParentFolderName( strItem ) ) Then
  703. 				gvaSettingsStr.Item( "SAVE" ) = strItem
  704. 			Else
  705. 				gvaSettingsStr.Item( "SAVE" ) = ""
  706. 			End If
  707. 		End With
  708. 	End If
  709. 	strItem = GetParameter( gvsCommandline, "TEMPDIR" )
  710. 	If strItem <> "" And gvoFSO.FolderExists( strItem ) Then
  711. 		gvaSettingsStr.Item( "TEMPDIR" ) = strItem
  712. 	End If
  713. 	strItem = GetParameter( gvsCommandline, "THEME" )
  714. 	Select Case UCase( strItem )
  715. 		Case "BW":
  716. 			gvaSettingsStr.Item( "THEME" ) = "ThemeBW"
  717. 		Case "BLUE":
  718. 			gvaSettingsStr.Item( "THEME" ) = "ThemeBlue"
  719. 		Case "CUSTOM":
  720. 			gvaSettingsStr.Item( "THEME" ) = "ThemeCustom"
  721. 		Case "DARK":
  722. 			gvaSettingsStr.Item( "THEME" ) = "ThemeDark"
  723. 		Case "DEFAULT":
  724. 			gvaSettingsStr.Item( "THEME" ) = "ThemeBW"
  725. 		Case "RED":
  726. 			gvaSettingsStr.Item( "THEME" ) = "ThemeRed"
  727. 	End Select
  728. 	strSubItem = GetParameter( gvsCommandline, "CUSTOMCOLORS" )
  729. 	If ( strItem = "" Or gvaSettingsStr.Item( "THEME" ) = "ThemeCustom" ) And strSubItem <> "" Then
  730. 		gvaSettingsStr.Item( "CUSTOMCOLORS" ) = LCase( strSubItem )
  731. 		gvaSettingsStr.Item( "THEME" )        = "ThemeCustom"
  732. 	End If
  733. 	strItem = GetParameter( gvsCommandline, "XML" )
  734. 	If strItem <> "" Then
  735. 		With gvoFSO
  736. 			strItem = .GetAbsolutePathName( strItem )
  737. 			If .FolderExists( .GetParentFolderName( strItem ) ) Then
  738. 				gvaSettingsStr.Item( "XML" ) = strItem
  739. 			End If
  740. 		End With
  741. 	End If
  742. 	strItem = GetParameter( gvsCommandline, "ZOOM" )
  743. 	If strItem <> "" Then
  744. 		If IsNumeric( strItem ) Then
  745. 			If CInt( strItem ) < 50 Then strItem = 50
  746. 			If CInt( strItem ) > 250 Then strItem = 250
  747. 			gvaSettingsStr.Item( "ZOOM" ) = CInt( strItem )
  748. 		End If
  749. 	End If
  750. 	strDebug = Align( "<u>Setting:</u>", 21 ) & "<u>Value:</u>" & vbCrLf
  751. 	For Each strKey In gvaSettingsBool.Keys
  752. 		strDebug = strDebug & Align( strKey, 14 ) & gvaSettingsBool.Item( strKey ) & vbCrLf
  753. 	Next
  754. 	For Each strKey In gvaSettingsStr.Keys
  755. 		strDebug = strDebug & Align( strKey, 14 ) & """" & gvaSettingsStr.Item( strKey ) & """" & vbCrLf
  756. 	Next
  757. 	DebugMessage "Settings After Reading Command Line", strDebug
  758. 	' Remove HTA path from command line
  759. 	Set objRE = New RegExp
  760. 	objRE.IgnoreCase = True
  761. 	objRE.Pattern = ".*?\.hta."
  762. 	If objRE.Test( gvsCommandline ) Then
  763. 		gvsCommandline = Trim( objRE.Replace( gvsCommandline, "" ) )
  764. 	End If
  765. 	DisplayCommandLine.innerHTML = gvsCommandline
  766. 	If gvaSettingsBool.item( "DEVTEST" ) Then
  767. 		' With /DEVTEST window size is 800x100, zoomfactor 75%
  768. 		gvaSettingsStr.Item( "ZOOM" ) = 75
  769. 		InputZoomFactor.value = "75"
  770. 		' Remove /DEVTEST from display
  771. 		objRE.Pattern = "/DEVTEST"
  772. 		If objRE.Test( DisplayCommandLine.innerHTML ) Then
  773. 			DisplayCommandLine.innerHTML = objRE.Replace( DisplayCommandLine.innerHTML, "" )
  774. 		End If
  775. 		objRE.Pattern = "\s+"
  776. 		DisplayCommandLine.innerHTML = objRE.Replace( DisplayCommandLine.innerHTML, " " )
  777. 	End If
  778. 	Set objRE = Nothing
  779. End Sub
  780.  
  781.  
  782. Sub ConfigReadDefaults( )
  783. 	Dim strDebug, strKey
  784. 	gvaDefaultsBool.Item( "BASIC" )       = False
  785. 	gvaDefaultsBool.Item( "CHAIN" )       = False
  786. 	gvaDefaultsBool.Item( "CM" )          = False
  787. 	gvaDefaultsBool.Item( "COPY" )        = False
  788. 	gvaDefaultsBool.Item( "DEBUG" )       = False
  789. 	gvaDefaultsBool.Item( "DEVTEST" )     = False
  790. 	gvaDefaultsBool.Item( "DMIDECODE" )   = False
  791. 	gvaDefaultsBool.Item( "DXDIAG" )      = False
  792. 	gvaDefaultsBool.Item( "KEEPXML" )     = False
  793. 	gvaDefaultsBool.Item( "NOUPD" )       = False
  794. 	gvaDefaultsBool.Item( "NOSCORES" )    = False
  795. 	gvaDefaultsBool.Item( "PRINT" )       = False
  796. 	gvaDefaultsBool.Item( "USBSTOR" )     = False
  797. 	gvaDefaultsBool.Item( "VIRTUAL" )     = False
  798. 	gvaDefaultsStr.Item( "COMPUTER" )     = GetLocalComputerName( )
  799. 	gvaDefaultsStr.Item( "CUSTOMCOLORS" ) = "white;black;blue;silver;black;black" ' Background;Captions;Links;ButtonFace;ButtonCaption;Code
  800. 	gvaSettingsStr.Item( "DEBUGLOG" )     = Left( Self.location.pathname, Len( Self.location.pathname ) - 4 ) & ".debuglog.html"
  801. 	gvaDefaultsStr.Item( "SAVE" )         = ""
  802. 	gvaDefaultsStr.Item( "TEMPDIR" )      = gvoFSO.GetAbsolutePathName( gvoWSHShell.ExpandEnvironmentStrings( "%Temp%" ) )
  803. 	gvaDefaultsStr.Item( "THEME" )        = "ThemeBW" ' ThemeBlue, ThemeBW, ThemeCustom, ThemeDark or ThemeRed
  804. 	gvaDefaultsStr.Item( "XML" )          = Left( Self.location.pathname, Len( Self.location.pathname ) - 4 ) & ".xml"
  805. 	gvaDefaultsStr.Item( "ZOOM" )         = 100
  806. 	ConfigSetDefaults
  807. 	strDebug = Align( "<u>Setting:</u>", 21 ) & "<u>Value:</u>" & vbCrLf
  808. 	For Each strKey In gvaDefaultsBool.Keys
  809. 		strDebug = strDebug & Align( strKey, 14 ) & gvaSettingsBool.Item( strKey ) & vbCrLf
  810. 	Next
  811. 	For Each strKey In gvaDefaultsStr.Keys
  812. 		strDebug = strDebug & Align( strKey, 14 ) & """" & gvaSettingsStr.Item( strKey ) & """" & vbCrLf
  813. 	Next
  814. 	DebugMessage "Settings After Reading Defaults", strDebug
  815. End Sub
  816.  
  817.  
  818. Sub ConfigReadFile( )
  819. 	Dim intMinSize, intSize
  820. 	Dim objFile, objRE
  821. 	Dim strDebug, strConfig, strItem, strKey, strSubItem, strUConfig
  822. 	If gvoFSO.FileExists( gvsConfigFile ) Then
  823. 		' Check config file size
  824. 		Set objFile = gvoFSO.GetFile( gvsConfigFile )
  825. 		intSize = objFile.Size
  826. 		Set objFile = Nothing
  827. 		' Check minimum required file size by "measuring" command line switch length
  828. 		intMinSize = 9999
  829. 		For Each strKey In gvaDefaultsBool.Keys
  830. 			intMinSize = Min( intMinSize, Len( strKey ) )
  831. 		Next
  832. 		' Add 1 for the forward slash
  833. 		intMinSize = intMinSize + 1
  834. 		' Config file is useless if its size is less than the length of the shortest command line switch
  835. 		If intSize < intMinSize Then
  836. 			gvoFSO.DeleteFile gvsConfigFile, True
  837. 		Else
  838. 			' Read the entire contents of the configuration file
  839. 			Set objFile = gvoFSO.OpenTextFile( gvsConfigFile, ForReading, False, TristateFalse )
  840. 			strConfig  = Trim( Replace( objFile.ReadAll( ), vbCrLf, " " ) )
  841. 			strUConfig = UCase( strConfig )
  842. 			objFile.Close
  843. 			Set objFile = Nothing
  844. 			' Replace all whitespace (space, tab, linefeed, carriage return, or any combination) by single spaces
  845. 			DisplayConfig.innerHTML = Join( Split( strConfig, vbCrLf ), " " )
  846. 			DisplayConfig.innerHTML = Join( Split( DisplayConfig.innerHTML, vbCr ), " " )
  847. 			DisplayConfig.innerHTML = Join( Split( DisplayConfig.innerHTML, vbLf ), " " )
  848. 			DisplayConfig.innerHTML = Trim( Join( Split( DisplayConfig.innerHTML, vbTab ), " " ) )
  849. 			' Remove /DEVTEST from display
  850. 			Set objRE = New RegExp
  851. 			objRE.Pattern = "/DEVTEST"
  852. 			objRE.IgnoreCase = True
  853. 			If objRE.Test( DisplayConfig.innerHTML ) Then
  854. 				DisplayConfig.innerHTML = objRE.Replace( DisplayConfig.innerHTML, "" )
  855. 			End If
  856. 			Set objRE  = Nothing
  857. 			For Each strKey In gvaSettingsBool.Keys
  858. 				If InStr( strUConfig, "/" & strKey ) Then gvaSettingsBool.Item( strKey ) = True
  859. 			Next
  860. 			strItem = GetParameter( strConfig, "THEME" )
  861. 			Select Case UCase( strItem )
  862. 				Case "BLUE":
  863. 					gvaSettingsStr.Item( "THEME" ) = "ThemeBlue"
  864. 				Case "BW":
  865. 					gvaSettingsStr.Item( "THEME" ) = "ThemeBW"
  866. 				Case "CUSTOM":
  867. 					gvaSettingsStr.Item( "THEME" ) = "ThemeCustom"
  868. 				Case "DARK":
  869. 					gvaSettingsStr.Item( "THEME" ) = "ThemeDark"
  870. 				Case "":
  871. 				Case "DEFAULT":
  872. 					gvaSettingsStr.Item( "THEME" ) = "ThemeBW"
  873. 				Case "RED":
  874. 					gvaSettingsStr.Item( "THEME" ) = "ThemeRed"
  875. 			End Select
  876. 			strSubItem = GetParameter( strConfig, "CUSTOMCOLORS" )
  877. 			If ( strItem = "" Or gvaSettingsStr.Item( "THEME" ) = "ThemeCustom" ) And strSubItem <> "" Then
  878. 				gvaSettingsStr.Item( "CUSTOMCOLORS" ) = LCase( strSubItem )
  879. 				gvaSettingsStr.Item( "THEME" )        = "ThemeCustom"
  880. 			End If
  881. 			strItem = GetParameter( strConfig, "XML" )
  882. 			If strItem <> "" Then
  883. 				With gvoFSO
  884. 					If .FolderExists( .GetParentFolderName( .GetAbsolutePathName( strItem ) ) ) Then
  885. 							gvaSettingsStr.Item( "XML" ) = .GetAbsolutePathName( strItem )
  886. 					End If
  887. 				End With
  888. 			End If
  889. 			strItem = GetParameter( strConfig, "ZOOM" )
  890. 			If strItem <> "" Then
  891. 				If IsNumeric( strItem ) Then
  892. 					If CInt( strItem ) < 50 Then strItem = 50
  893. 					If CInt( strItem ) > 250 Then strItem = 250
  894. 					gvaSettingsStr.Item( "ZOOM" ) = CInt( strItem )
  895. 				End If
  896. 			End If
  897. 		End If
  898. 	End If
  899. 	strDebug = Align( "<u>Setting:</u>", 21 ) & "<u>Value:</u>" & vbCrLf
  900. 	For Each strKey In gvaDefaultsBool.Keys
  901. 		strDebug = strDebug & Align( strKey, 14 ) & gvaSettingsBool.Item( strKey ) & vbCrLf
  902. 	Next
  903. 	For Each strKey In gvaDefaultsStr.Keys
  904. 		strDebug = strDebug & Align( strKey, 14 ) & """" & gvaSettingsStr.Item( strKey ) & """" & vbCrLf
  905. 	Next
  906. 	If gvaSettingsBool.Item( "DEBUG" ) And gvoFSO.FileExists( gvaSettingsStr.Item( "DEBUGLOG" ) ) Then gvoFSO.DeleteFile gvaSettingsStr.Item( "DEBUGLOG" ), True
  907. 	DebugMessage "Settings After Reading " & gvsConfigFile, strDebug
  908. End Sub
  909.  
  910.  
  911. Sub ConfigRemoveFile( )
  912. 	If gvoFSO.FileExists( gvsConfigFile ) Then gvoFSO.DeleteFile gvsConfigFile, True
  913. End Sub
  914.  
  915.  
  916. Sub ConfigReset( )
  917. 	ConfigRemoveFile
  918. 	DisplayConfig.innerHTML = ""
  919. 	ButtonEditCfg.disabled  = True
  920. 	ButtonReset.disabled    = True
  921. 	InputZoomFactor.value   = gvaDefaultsStr.Item( "ZOOM" )
  922. 	ConfigSetDefaults
  923. 	ConfigUpdateStatus
  924. End Sub
  925.  
  926.  
  927. Sub ConfigSaveChanges( )
  928. 	Dim objItem, objOption, strCustomColors, strDebug, strKey
  929. 	With gvoFSO
  930. 		If Not IsEmpty( InputDxDiag.value ) Then
  931. 			If .FolderExists( .GetParentFolderName( InputDxDiag.value ) ) Then
  932. 					InputDxDiag.value = .GetAbsolutePathName( InputDxDiag.value )
  933. 				End If
  934. 		End If
  935. 		If Not IsEmpty( InputDebugLogPath.value ) Then
  936. 			If .FolderExists( .GetParentFolderName( InputDebugLogPath.value ) ) Then
  937. 				InputDebugLogPath.value = .GetAbsolutePathName( InputDebugLogPath.value )
  938. 			End If
  939. 		End If
  940. 	End With
  941. 	gvaSettingsBool.Item( "CM" )        = CheckboxCM.checked
  942. 	gvaSettingsBool.Item( "CHAIN" )     = CheckboxCharacterChains.checked
  943. 	gvaSettingsBool.Item( "DEBUG" )     = CheckboxDebugMode.checked
  944. 	gvaSettingsBool.Item( "DMIDECODE" ) = CheckboxDMIDecode.checked
  945. 	gvaSettingsBool.Item( "DXDIAG" )    = CheckboxDxDiag.checked
  946. 	gvaSettingsBool.Item( "KEEPXML" )   = CheckboxKeepXML.checked
  947. 	gvaSettingsBool.Item( "NOUPD" )     = Not CheckboxCheckUpd.checked
  948. 	gvaSettingsBool.Item( "NOSCORES" )  = Not CheckboxScores.checked
  949. 	gvaSettingsBool.Item( "USBSTOR" )   = CheckboxUSBSTOR.checked
  950. 	gvaSettingsBool.Item( "VIRTUAL" )   = CheckboxVirtual.checked
  951. 	If gvaSettingsStr.Item( "XML" ) <> "" Then
  952. 		If InputDxDiag.value <> "" Then
  953. 			gvaSettingsStr.Item( "XML" ) = gvaDefaultsStr.Item( "XML" )
  954. 		Else
  955. 			gvaSettingsStr.Item( "XML" ) = InputDxDiag.value
  956. 		End If
  957. 	End If
  958. 	If InputDebugLogPath.value = "" Then
  959. 		gvaSettingsStr.Item( "DEBUGLOG" ) = gvaDefaultsStr.Item( "DEBUGLOG" )
  960. 	Else
  961. 		gvaSettingsStr.Item( "DEBUGLOG" ) = InputDebugLogPath.value
  962. 	End If
  963. 	If ThemeBlue.checked Then
  964. 		gvaSettingsStr.Item( "THEME" )        = "ThemeBlue"
  965. 		gvaSettingsStr.Item( "CUSTOMCOLORS" ) = "darkblue;white;red;silver;black;yellow"
  966. 	ElseIf ThemeDark.checked Then
  967. 		gvaSettingsStr.Item( "THEME" )        = "ThemeDark"
  968. 		gvaSettingsStr.Item( "CUSTOMCOLORS" ) = "black;white;gold;slategray;snow;red"
  969. 	ElseIf ThemeBW.checked Then
  970. 		gvaSettingsStr.Item( "THEME" )        = "ThemeBW"
  971. 		gvaSettingsStr.Item( "CUSTOMCOLORS" ) = gvaDefaultsStr.Item( "CUSTOMCOLORS" )
  972. 	ElseIf ThemeRed.checked Then
  973. 		gvaSettingsStr.Item( "THEME" )        = "ThemeRed"
  974. 		gvaSettingsStr.Item( "CUSTOMCOLORS" ) = "red;yellow;darkblue;silver;black;white"
  975. 	ElseIf ThemeCustom.checked Then
  976. 		For Each objOption In BackgroundColor.options
  977. 			If objOption.selected Then strCustomColors = objOption.value
  978. 		Next
  979. 		For Each objOption In CaptionsColor.options
  980. 			If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  981. 		Next
  982. 		For Each objOption In LinksColor.options
  983. 			If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  984. 		Next
  985. 		For Each objOption In ButtonFaceColor.options
  986. 			If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  987. 		Next
  988. 		For Each objOption In ButtonCaptionsColor.options
  989. 			If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  990. 		Next
  991. 		For Each objOption In CodeColor.options
  992. 			If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  993. 		Next
  994. 		gvaSettingsStr.Item( "THEME" )        = "ThemeCustom"
  995. 		gvaSettingsStr.Item( "CUSTOMCOLORS" ) = LCase( strCustomColors )
  996. 	End If
  997. 	If Not InputZoomFactor.value = gvaSettingsStr.Item( "ZOOM" ) Then
  998. 		If IsEmpty( InputZoomFactor.value ) Then
  999. 			InputZoomFactor.value = 100
  1000. 		Else
  1001. 			InputZoomFactor.value = Min( 250, Max( 50, InputZoomFactor.value ) )
  1002. 		End If
  1003. 		gvaSettingsStr.Item( "ZOOM" ) = InputZoomFactor.value
  1004. 		document.body.style.zoom = gvaSettingsStr.Item( "ZOOM" ) & "%"
  1005. 	End If
  1006. 	If ConfigTestIfDefault( ) Then
  1007. 		If gvoFSO.FileExists( gvsConfigFile ) Then
  1008. 			strDebug = "Deleting config file"
  1009. 			gvoFSO.DeleteFile gvsConfigFile, True
  1010. 		End If
  1011. 		DebugMessage "Save settings was clicked, but all settings are default", strDebug
  1012. 		ButtonReset.disabled = True
  1013. 	Else
  1014. 		strDebug = Align( "<u>Setting:</u>", 21 ) & "<u>Value:</u>" & vbCrLf
  1015. 		For Each strKey In gvaSettingsBool.Keys
  1016. 			strDebug = strDebug & Align( strKey, 14 ) & gvaSettingsBool.Item( strKey ) & vbCrLf
  1017. 		Next
  1018. 		For Each strKey In gvaSettingsStr.Keys
  1019. 			strDebug = strDebug & Align( strKey, 14 ) & """" & gvaSettingsStr.Item( strKey ) & """" & vbCrLf
  1020. 		Next
  1021. 		DebugMessage "Settings After Saving Changes", strDebug
  1022. 	End If
  1023. End Sub
  1024.  
  1025.  
  1026. Sub ConfigSaveFile( )
  1027. 	Dim objFile
  1028. 	dim strConfig, strKey
  1029. 	If ConfigTestIfDefault( ) Then
  1030. 		If gvoFSO.FileExists( gvsConfigFile ) Then
  1031. 			gvoFSO.DeleteFile gvsConfigFile, True
  1032. 			MsgBox "Since all settings are back to their default values, """ & gvsConfigFile & """ has been deleted", vbOKOnly, "Save Settings"
  1033. 		Else
  1034. 			MsgBox "Since all settings have their default values, nothing was saved", vbOKOnly, "Save Settings"
  1035. 		End If
  1036. 	Else
  1037. 		strConfig = ""
  1038. 		For Each strKey In gvaSettingsBool.Keys
  1039. 			If gvaSettingsBool.Item( strKey ) Then
  1040. 				strConfig = strConfig & " /" & strKey
  1041. 			End If
  1042. 		Next
  1043. 		If gvaSettingsBool.Item( "DXDIAG" ) And ( gvaSettingsStr.Item( "XML" ) <> "" ) Then
  1044. 			strConfig = strConfig & " /XML:" & gvaSettingsStr.Item( "XML" )
  1045. 		End If
  1046. 		If gvaSettingsStr.Item( "COMPUTER" ) <> "" Then
  1047. 			If UCase( gvaSettingsStr.Item( "COMPUTER" ) ) <> UCase( GetLocalComputerName ) Then
  1048. 				strConfig = strConfig & " /COMPUTER:" & UCase( gvaSettingsStr.Item( "COMPUTER" ) )
  1049. 			End If
  1050. 		End If
  1051. 		If gvaSettingsStr.Item( "THEME" ) <> "" And gvaSettingsStr.Item( "THEME" ) <> "ThemeBW" Then
  1052. 			strConfig = strConfig & " /THEME:" & Mid( gvaSettingsStr.Item( "THEME" ), 6 )
  1053. 			If gvaSettingsStr.Item( "THEME" ) = "ThemeCustom" Then
  1054. 				If gvaSettingsStr.Item( "CUSTOMCOLORS" ) <> "" Then
  1055. 					strConfig = Trim( strConfig & " /CUSTOMCOLORS:" & LCase( gvaSettingsStr.Item( "CUSTOMCOLORS" ) ) )
  1056. 				End If
  1057. 			End If
  1058. 		End If
  1059. 		If Not CInt( gvaSettingsStr.Item( "ZOOM" ) ) = 100 Then
  1060. 			strConfig = strConfig & " /ZOOM:" & gvaSettingsStr.Item( "ZOOM" )
  1061. 		End If
  1062. 		Set objFile = gvoFSO.OpenTextFile( gvsConfigFile, ForWriting, True, TristateFalse )
  1063. 		objFile.Write strConfig
  1064. 		objFile.Close
  1065. 		Set objFile = Nothing
  1066. 		DisplayConfig.innerHTML = strConfig
  1067. 		MsgBox "The new settings have been saved in """ & gvsConfigFile & """", vbOKOnly + vbInformation + vbApplicationModal, "Settings saved"
  1068. 		DebugMessage "Saving Settings to " & gvsConfigFile, strConfig
  1069. 	End If
  1070. End Sub
  1071.  
  1072.  
  1073. Sub ConfigSetDefaults( )
  1074. 		Dim strKey
  1075. 		For Each strKey In gvaDefaultsBool.Keys
  1076. 			gvaSettingsBool.Item( strKey ) = gvaDefaultsBool.Item( strKey )
  1077. 		Next
  1078. 		For Each strKey In gvaDefaultsStr.Keys
  1079. 			gvaSettingsStr.Item( strKey ) = gvaDefaultsStr.Item( strKey )
  1080. 		Next
  1081. End Sub
  1082.  
  1083.  
  1084. Function ConfigTestIfDefault( )
  1085. 	Dim blnStart, objChkBx, strTest
  1086. 	' In debug mode (best set on the command line), show a MessageBox with checkbox settings vs defaults
  1087. 	If gvaSettingsBool.Item( "DEBUG" ) Or ( InStr( gvsCommandlineUC, "/DEBUG" ) > 0 ) Then
  1088. 		blnStart = False
  1089. 		strTest = Align( "CHECKBOX", 23 ) & vbTab & Align( "CHECKED", 7 ) & vbTab & "BY DEFAULT" & vbCrLf _
  1090. 		        & Align( "=======",  23 ) & vbTab & Align( "======",  7 ) & vbTab & "========"   & vbCrLf & vbCrLf
  1091. 		For Each objChkBx In document.getElementsByTagName( "input" )
  1092. 			If objChkBx.type = "checkbox" Then
  1093. 				If InStr( objChkBx.id, "DMIDecode" ) > 0 Then
  1094. 					blnStart = True
  1095. 				End If
  1096. 				If blnStart Then
  1097. 					strTest = strTest & Align( objChkBx.id, 23 ) & vbTab & Align( objChkBx.checked, 20 ) & vbTab
  1098. 					If objChkBx.id = "CheckboxCM"              Then strTest = strTest & gvaDefaultsBool.Item( "CM" )
  1099. 					If objChkBx.id = "CheckboxCharacterChains" Then strTest = strTest & gvaDefaultsBool.Item( "CHAIN" )
  1100. 					If objChkBx.id = "CheckboxDebugMode"       Then strTest = strTest & gvaDefaultsBool.Item( "DEBUG" )
  1101. 					If objChkBx.id = "CheckboxDMIDecode"       Then strTest = strTest & gvaDefaultsBool.Item( "DMIDECODE" )
  1102. 					If objChkBx.id = "CheckboxDxDiag"          Then strTest = strTest & gvaDefaultsBool.Item( "DXDIAG" )
  1103. 					If objChkBx.id = "CheckboxKeepXML"         Then strTest = strTest & gvaDefaultsBool.Item( "KEEPXML" )
  1104. 					If objChkBx.id = "CheckboxCheckUpd"        Then strTest = strTest & Not gvaDefaultsBool.Item( "NOUPD" )
  1105. 					If objChkBx.id = "CheckboxScores"          Then strTest = strTest & Not gvaDefaultsBool.Item( "NOSCORES" )
  1106. 					If objChkBx.id = "CheckboxUSBSTOR"         Then strTest = strTest & gvaDefaultsBool.Item( "USBSTOR" )
  1107. 					If objChkBx.id = "CheckboxVirtual"         Then strTest = strTest & gvaDefaultsBool.Item( "VIRTUAL" )
  1108. 					strTest = strTest & vbCrLf
  1109. 				End If
  1110. 			End if
  1111. 		Next
  1112. 		MsgBox strTest, vbOKOnly, "Debugging Info for ConfigTestIfDefault( )"
  1113. 	End If ' end of debugging code
  1114.  
  1115. 	' Check all checkboxes in Settings screen and compare with defaults
  1116. 	If Not ( CheckboxCM.checked = gvaSettingsBool.Item( "CM" ) ) Then
  1117. 		ConfigTestIfDefault = False
  1118. 		Exit Function
  1119. 	End If
  1120. 	If Not ( CheckboxCharacterChains.checked = gvaDefaultsBool.Item( "CHAIN" ) ) Then
  1121. 		ConfigTestIfDefault = False
  1122. 		Exit Function
  1123. 	End If
  1124. 	If Not ( CheckboxDebugMode.checked = gvaDefaultsBool.Item( "DEBUG" ) ) Then
  1125. 		ConfigTestIfDefault = False
  1126. 		Exit Function
  1127. 	End If
  1128. 	If Not ( CheckboxDMIDecode.checked = gvaDefaultsBool.Item( "DMIDECODE" ) ) Then
  1129. 		ConfigTestIfDefault = False
  1130. 		Exit Function
  1131. 	End If
  1132. 	If Not ( CheckboxDxDiag.checked = gvaDefaultsBool.Item( "DXDIAG" ) ) Then
  1133. 		ConfigTestIfDefault = False
  1134. 		Exit Function
  1135. 	End If
  1136. 	If Not ( CheckboxKeepXML.checked = gvaDefaultsBool.Item( "KEEPXML" ) ) Then
  1137. 		ConfigTestIfDefault = False
  1138. 		Exit Function
  1139. 	End If
  1140. 	If ( CheckboxCheckUpd.checked = gvaDefaultsBool.Item( "NOUPD" ) ) Then
  1141. 		ConfigTestIfDefault = False
  1142. 		Exit Function
  1143. 	End If
  1144. 	If ( CheckboxScores.checked = gvaDefaultsBool.Item( "NOSCORES" ) ) Then
  1145. 		ConfigTestIfDefault = False
  1146. 		Exit Function
  1147. 	End If
  1148. 	If Not ( CheckboxUSBSTOR.checked = gvaDefaultsBool.Item( "USBSTOR" ) ) Then
  1149. 		ConfigTestIfDefault = False
  1150. 		Exit Function
  1151. 	End If
  1152. 	If Not ( CheckboxVirtual.checked = gvaDefaultsBool.Item( "VIRTUAL" ) ) Then
  1153. 		ConfigTestIfDefault = False
  1154. 		Exit Function
  1155. 	End If
  1156. 	If gvaSettingsStr.Item( "THEME" ) = "" Then
  1157. 		gvaSettingsStr.Item( "THEME" )        = gvaDefaultsStr.Item( "THEME" )
  1158. 		gvaSettingsStr.Item( "CUSTOMCOLORS" ) = gvaDefaultsStr.Item( "CUSTOMCOLORS" )
  1159. 		document.getElementById( gvaDefaultsStr.Item( "THEME" ) ).checked = True
  1160. 	End If
  1161. 	If ThemeCustom.checked Or ThemeBlue.checked Or ThemeDark.checked Or ThemeRed.checked Then
  1162. 		ConfigTestIfDefault = False
  1163. 		Exit Function
  1164. 	End If
  1165. 	ConfigTestIfDefault = True
  1166. End Function
  1167.  
  1168.  
  1169. Sub ConfigUpdateStatus( )
  1170. 	Dim arrCustomColors, colElements, objElement, objOption
  1171. 	If gvaSettingsBool.Item( "BASIC" ) Then
  1172. 		ButtonBasic.value     = "Full"
  1173. 		ButtonBasic.accessKey = "f"
  1174. 	Else
  1175. 		ButtonBasic.value     = "Basic"
  1176. 		ButtonBasic.accessKey = "b"
  1177. 	End If
  1178. 	ButtonDeleteXML.disabled        = Not gvoFSO.FileExists( gvaSettingsStr.Item( "XML" ) )
  1179. 	CheckboxCM.checked              = gvaSettingsBool.Item( "CM" )
  1180. 	CheckboxCharacterChains.checked = gvaSettingsBool.Item( "CHAIN" )
  1181. 	CheckboxDebugMode.checked       = gvaSettingsBool.Item( "DEBUG" )
  1182. 	CheckDMIDecode
  1183. 	CheckboxDMIDecode.checked       = gvaSettingsBool.Item( "DMIDECODE" )
  1184. 	CheckboxDMIDecode.disabled      = gvbWinPE
  1185. 	CheckboxDxDiag.checked          = gvaSettingsBool.Item( "DXDIAG" ) And Not gvbWinPE
  1186. 	CheckboxDxDiag.disabled         = gvbWinPE
  1187. 	CheckboxKeepXML.checked         = gvaSettingsBool.Item( "KEEPXML" ) And gvaSettingsBool.Item( "DXDIAG" ) And Not gvbWinPE
  1188. 	CheckboxKeepXML.disabled        = gvbWinPE
  1189. 	CheckboxCheckUpd.checked        = Not gvaSettingsBool.Item( "NOUPD" )
  1190. 	CheckboxScores.checked          = Not gvaSettingsBool.Item( "NOSCORES" )
  1191. 	CheckboxUSBSTOR.checked         = gvaSettingsBool.Item( "USBSTOR" )
  1192. 	CheckboxVirtual.checked         = gvaSettingsBool.Item( "VIRTUAL" )
  1193. 	ComputerName.value              = gvaSettingsStr.Item( "COMPUTER" )
  1194. 	InputDxDiag.value               = gvaSettingsStr.Item( "XML" )
  1195. 	InputDxDiag.readonly            = Not CheckboxDxDiag.checked Or gvbWinPE
  1196. 	InputDebugLogPath.value         = gvaSettingsStr.Item( "DEBUGLOG" )
  1197. 	InputDebugLogPath.disabled      = Not gvaSettingsBool.Item( "DEBUG" )
  1198. 	If gvaSettingsStr.Item( "THEME" ) = "" Then
  1199. 		ThemeBW.checked = True
  1200. 	Else
  1201. 		document.getElementById( gvaSettingsStr.Item( "THEME" ) ).checked = True
  1202. 	End If
  1203. 	If ThemeCustom.checked Then
  1204. 		arrCustomColors = Split( gvaSettingsStr.Item( "CUSTOMCOLORS" ), ";" )
  1205. 		For Each objOption In BackgroundColor.options
  1206. 			objOption.selected = ( objOption.value = arrCustomColors(0) )
  1207. 		Next
  1208. 		For Each objOption In CaptionsColor.options
  1209. 			objOption.selected = ( objOption.value = arrCustomColors(1) )
  1210. 		Next
  1211. 		For Each objOption In LinksColor.options
  1212. 			objOption.selected = ( objOption.value = arrCustomColors(2) )
  1213. 		Next
  1214. 		For Each objOption In ButtonFaceColor.options
  1215. 			objOption.selected = ( objOption.value = arrCustomColors(3) )
  1216. 		Next
  1217. 		For Each objOption In ButtonCaptionsColor.options
  1218. 			objOption.selected = ( objOption.value = arrCustomColors(4) )
  1219. 		Next
  1220. 		For Each objOption In CodeColor.options
  1221. 			objOption.selected = ( objOption.value = arrCustomColors(5) )
  1222. 		Next
  1223. 	ElseIf ThemeBlue.checked Then
  1224. 		gvaSettingsStr.Item( "CUSTOMCOLORS" ) = "darkblue;white;red;silver;black;yellow"
  1225. 		arrCustomColors                       = Split( gvaSettingsStr.Item( "CUSTOMCOLORS" ), ";" )
  1226. 	ElseIf ThemeDark.checked Then
  1227. 		gvaSettingsStr.Item( "CUSTOMCOLORS" ) = "black;white;gold;slategray;snow;red"
  1228. 		arrCustomColors                       = Split( gvaSettingsStr.Item( "CUSTOMCOLORS" ), ";" )
  1229. 	ElseIf ThemeRed.checked Then
  1230. 		gvaSettingsStr.Item( "CUSTOMCOLORS" ) = "red;yellow;darkblue;silver;black;white"
  1231. 		arrCustomColors                       = Split( gvaSettingsStr.Item( "CUSTOMCOLORS" ), ";" )
  1232. 	Else
  1233. 		gvaSettingsStr.Item( "CUSTOMCOLORS" ) = gvaDefaultsStr.Item( "CUSTOMCOLORS" )
  1234. 		arrCustomColors                       = Split( gvaSettingsStr.Item( "CUSTOMCOLORS" ), ";" )
  1235. 	End If
  1236. 	ListColors     "BackgroundColor",     arrCustomColors(0)
  1237. 	ListColors     "CaptionsColor",       arrCustomColors(1)
  1238. 	ListColors     "LinksColor",          arrCustomColors(2)
  1239. 	ListColors     "ButtonFaceColor",     arrCustomColors(3)
  1240. 	ListColors     "ButtonCaptionsColor", arrCustomColors(4)
  1241. 	ListColors     "CodeColor",           arrCustomColors(5)
  1242. 	SetCustomColor "BackgroundColor"
  1243. 	SetCustomColor "CaptionsColor"
  1244. 	SetCustomColor "LinksColor"
  1245. 	SetCustomColor "ButtonFaceColor"
  1246. 	SetCustomColor "ButtonCaptionsColor"
  1247. 	SetCustomColor "CodeColor"
  1248. 	document.body.style.zoom = gvaSettingsStr.Item( "ZOOM" ) & "%"
  1249. 	EnableWinSATScores
  1250. End Sub
  1251.  
  1252.  
  1253. Sub CopyToClipboard
  1254. 	On Error Resume Next ' REQUIRED
  1255. 	Document.parentWindow.clipboardData.setData "text", gvsHeader & vbCrLf & gvsCSVTxt & vbCrLf
  1256. 	If Err Then
  1257. 		MsgBox "An error occurred while trying to copy data to the clipboard:" & vbCrLf & vbCrLf & Err.Description, vbOKOnly, "Clipboard Error"
  1258. 	End If
  1259. 	On Error Goto 0
  1260. End Sub
  1261.  
  1262.  
  1263. Sub CreateDebugLogFile( )
  1264. 	Dim objDebugLog, strHTML
  1265. 	' Header for new debugging log file; note the "refresh" meta tag, allowing dynamic updates of the displayed log
  1266. 	strHTML = "<!DOCTYPE html>" & vbCrLf _
  1267. 	        & "<html lang=""en"">" _
  1268. 	        & vbCrLf _
  1269. 	        & "<head>" _
  1270. 	        & vbCrLf _
  1271. 	        & "<title>Basic Hardware Inventory Debugging Log " & gvsComputer & "</title>" _
  1272. 	        & vbCrLf _
  1273. 	        & "<meta http-equiv=""refresh"" content=""5"">" _
  1274. 	        & vbCrLf _
  1275. 	        & "</head>" _
  1276. 	        & vbCrLf _
  1277. 	        & "<body>" _
  1278. 	        & vbCrLf _
  1279. 	        & "<pre>" _
  1280. 	        & vbCrLf
  1281. 	' Create the new debugging log file, then close it
  1282. 	Set objDebugLog = gvoFSO.OpenTextFile( gvaSettingsStr.Item( "DEBUGLOG" ), ForWriting, True )
  1283. 	objDebugLog.Write strHTML
  1284. 	objDebugLog.Close
  1285. 	Set objDebugLog = Nothing
  1286. 	' Open the new debugging log file in the default browser (requires .html log file extension)
  1287. 	gvoWSHShell.Run gvaSettingsStr.Item( "DEBUGLOG" ), 7, False
  1288. End Sub
  1289.  
  1290.  
  1291. Function CreateLine( strProperty )
  1292. 	' This subroutine will split up a string into separate words:
  1293. 	' "SCSILogicalUnit" will be converted to "SCSI Logical Unit"
  1294. 	Dim chrA, chrB, chrC
  1295. 	Dim i, j, k
  1296. 	Dim strCaps, strLowc, strPropDescr
  1297.  
  1298. 	strPropDescr = strProperty
  1299. 	strCaps      = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1300. 	strLowc      = LCase( strCaps )
  1301. 	' Default value, in case something goes wrong
  1302. 	CreateLine   = strProperty
  1303. 	i = 0
  1304. 	Do
  1305. 		i = i + 1
  1306. 		j = i + 1
  1307. 		If j >= Len( strPropDescr ) Then Exit Do
  1308. 		chrA = Mid( strPropDescr, i, 1 )
  1309. 		chrB = Mid( strPropDescr, j, 1 )
  1310. 		If InStr( strLowc, chrA ) > 0 And InStr( strCaps, chrB ) > 0 Then
  1311. 			strPropDescr = Left( strPropDescr, i ) & " " & Mid( strPropDescr, j )
  1312. 			i = i + 2
  1313. 			j = i + 1
  1314. 		End If
  1315. 	Loop
  1316. 	If Len( strPropDescr ) > 2 Then
  1317. 		i = 0
  1318. 		Do
  1319. 			i = i + 1
  1320. 			j = i + 1
  1321. 			k = i + 2
  1322. 			If k >= Len( strPropDescr ) Then Exit Do
  1323. 			chrA = Mid( strPropDescr, i, 1 )
  1324. 			chrB = Mid( strPropDescr, j, 1 )
  1325. 			chrC = Mid( strPropDescr, k, 1 )
  1326. 			If InStr( strCaps, chrA ) > 0 And InStr( strCaps, chrB ) > 0 And InStr( strLowc, chrC ) > 0 Then
  1327. 				strPropDescr = Left( strPropDescr, i ) & " " & Mid( strPropDescr, j )
  1328. 				i = i + 3
  1329. 				j = i + 1
  1330. 				k = i + 2
  1331. 			End If
  1332. 		Loop
  1333. 	End If
  1334. 	CreateLine = strPropDescr
  1335. End Function
  1336.  
  1337.  
  1338. Sub DebugMessage( myTitle, myMessage )
  1339. 	' If Debug Logging is enabled, create or open a debug log file, and append a debugging message
  1340. 	Dim objDebugLog, objRE, strDebugText
  1341. 	On Error Resume Next ' REQUIRED
  1342. 	If gvaSettingsBool.Item( "DEBUG" ) Then
  1343. 		If gvoFSO.FileExists( gvaSettingsStr.Item( "DEBUGLOG" ) ) Then
  1344. 			' Open existing log file and remove closing tags at the end of the HTML content
  1345. 			Set objDebugLog = gvoFSO.OpenTextFile( gvaSettingsStr.Item( "DEBUGLOG" ) )
  1346. 			strDebugText = objDebugLog.ReadAll( )
  1347. 			objDebugLog.Close
  1348. 			Set objRE = New RegExp
  1349. 			objRE.Global     = True
  1350. 			objRE.IgnoreCase = True
  1351. 			objRE.Pattern    = "</pre>\s*</body>\s*</html>\s*$"
  1352. 			Set objDebugLog = gvoFSO.OpenTextFile( gvaSettingsStr.Item( "DEBUGLOG" ), ForWriting, True )
  1353. 			objDebugLog.Write objRE.Replace( strDebugText, "" )
  1354. 			objDebugLog.Close
  1355. 			Set objDebugLog = Nothing
  1356. 		Else
  1357. 			' Create a new debugging log file and open it in the default browser
  1358. 			CreateDebugLogFile
  1359. 		End If
  1360. 		' Append debugging message to log file
  1361. 		Set objDebugLog = gvoFSO.OpenTextFile( gvaSettingsStr.Item( "DEBUGLOG" ), ForAppending, True )
  1362. 		If ( Trim( myTitle ) = "" ) Then
  1363. 			objDebugLog.WriteLine "[" & TimeStamp( ) & "] " & myMessage
  1364. 		Else
  1365. 			objDebugLog.WriteLine "[" & TimeStamp( ) & "] " & myTitle & vbCrLf & String( Len( myTitle ), "-" ) & vbCrLf & myMessage
  1366. 		End If
  1367. 		' Append closing tags at the end of the HTML content
  1368. 		objDebugLog.WriteLine vbCrLf & vbCrLf & "</pre>" & vbCrLf & "</body>" & vbCrLf & "</html>"
  1369. 		' Close the log file
  1370. 		objDebugLog.Close
  1371. 		Set objDebugLog = Nothing
  1372. 	End If
  1373. 	On Error GoTo 0
  1374. End Sub
  1375.  
  1376.  
  1377. Sub DeleteDxDiagXML( )
  1378. 	If InputDxDiag.value <> "" Then
  1379. 		On Error Resume Next ' REQUIRED
  1380. 		If gvoFSO.FileExists( InputDxDiag.value ) Then
  1381. 			gvoFSO.DeleteFile InputDxDiag.value, True
  1382. 		End If
  1383. 		If Err Then
  1384. 			MsgBox "Error while trying to delete the existing DxDiag XML file" & vbCrLf & """" & InputDxDiag.value & """", vbOKOnly + vbExclamation + vbApplicationModal, "File Delete Error"
  1385. 			Err.Clear
  1386. 		End If
  1387. 		On Error Goto 0
  1388. 	End If
  1389. 	ButtonDeleteXML.disabled = True
  1390. End Sub
  1391.  
  1392.  
  1393. Sub DetailsBIOS( )
  1394. 	gvsDetails = HandleClass( "Win32_BIOS", "root/CIMV2" )
  1395. 	If gvaSettingsBool.Item( "DXDIAG" ) Then
  1396. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleXMLValue( "/DxDiag/SystemInformation/BIOS" )
  1397. 	End If
  1398. 	If gvaSettingsBool.Item( "DMIDECODE" ) Then
  1399. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleDMIDetails( "BIOS" )
  1400. 	End If
  1401. 	DetailsWindow "BIOS", gvsDetails
  1402. End Sub
  1403.  
  1404.  
  1405. Sub DetailsCDROM( )
  1406. 	gvsDetails = HandleClass( "Win32_CDROMDrive",           "root/CIMV2" ) & vbCrLf & vbCrLf _
  1407. 	           & HandleClass( "Win32_IDEController",        "root/CIMV2" ) & vbCrLf & vbCrLf _
  1408. 	           & HandleClass( "Win32_SCSIController",       "root/CIMV2" ) & vbCrLf & vbCrLf _
  1409. 	           & HandleClass( "Win32_IDEControllerDevice",  "root/CIMV2" ) & vbCrLf & vbCrLf _
  1410. 	           & HandleClass( "Win32_SCSIControllerDevice", "root/CIMV2" )
  1411. 	If gvaSettingsBool.Item( "DXDIAG" ) Then
  1412. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleXMLNode( "/DxDiag/LogicalDisks/LogicalDisk[HardDriveIndex = 0 and FileSystem <= """"]" )
  1413. 	End If
  1414. 	DetailsWindow "CD/DVD-ROM Drives and Controllers", gvsDetails
  1415. End Sub
  1416.  
  1417.  
  1418. Sub DetailsCPU( )
  1419. 	gvsDetails = HandleClass( "Win32_Processor", "root/CIMV2" ) & vbCrLf & vbCrLf _
  1420. 	           & HandleClass( "Win32_WinSAT",    "root/CIMV2" )
  1421. 	If gvaSettingsBool.Item( "DXDIAG" ) Then
  1422. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleXMLValue( "/DxDiag/SystemInformation/Processor" )
  1423. 	End If
  1424. 	If gvaSettingsBool.Item( "DMIDECODE" ) Then
  1425. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleDMIDetails( "Processor" )
  1426. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleDMIDetails( "Cache" )
  1427. 	End If
  1428. 	DetailsWindow "CPU", gvsDetails
  1429. End Sub
  1430.  
  1431.  
  1432. Sub DetailsFDD( )
  1433. 	On Error Resume Next ' REQUIRED
  1434. 	gvsDetails = HandleClass( "MSFT_Volume",         "root/Microsoft/Windows/Storage" ) & vbCrLf & vbCrLf _
  1435. 	           & HandleClass( "Win32_LogicalDisk",   "root/CIMV2" ) & vbCrLf & vbCrLf _
  1436. 	           & HandleClass( "Win32_PortConnector", "root/CIMV2" )
  1437. 	DetailsWindow "Floppy Disk Drives and Connectors", gvsDetails
  1438. 	On Error GoTo 0
  1439. End Sub
  1440.  
  1441.  
  1442. Sub DetailsHDD( )
  1443. 	Dim objRE
  1444. 	Set objRE = New RegExp
  1445. 	objRE.Global  = True
  1446. 	objRE.Pattern = vbcrlf & "+"
  1447. 	Set objRE = Nothing
  1448. 	On Error Resume Next ' REQUIRED
  1449. 	gvsDetails = HandleClass( "MSFT_PhysicalDisk",            "root/Microsoft/Windows/Storage" ) & vbCrLf & vbCrLf _
  1450. 	           & HandleClass( "MSFT_Volume",                  "root/Microsoft/Windows/Storage" ) & vbCrLf & vbCrLf _
  1451. 	           & HandleClass( "Win32_DiskDrive",              "root/CIMV2" ) & vbCrLf & vbCrLf _
  1452. 	           & HandleClass( "Win32_LogicalDiskToPartition", "root/CIMV2" ) & vbCrLf & vbCrLf _
  1453. 	           & HandleClass( "Win32_IDEController",          "root/CIMV2" ) & vbCrLf & vbCrLf _
  1454. 	           & HandleClass( "Win32_SCSIController",         "root/CIMV2" ) & vbCrLf & vbCrLf _
  1455. 	           & HandleClass( "Win32_IDEControllerDevice",    "root/CIMV2" ) & vbCrLf & vbCrLf _
  1456. 	           & HandleClass( "Win32_SCSIControllerDevice",   "root/CIMV2" ) & vbCrLf & vbCrLf _
  1457. 	           & HandleClass( "Win32_WinSAT",                 "root/CIMV2" )
  1458. 	If gvaSettingsBool.Item( "DXDIAG" ) Then
  1459. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleXMLNode( "/DxDiag/LogicalDisks/LogicalDisk[Model > """" and FileSystem > """"]" )
  1460. 	End If
  1461. 	DetailsWindow "Disk Drives and Controllers", gvsDetails
  1462. 	On Error Goto 0
  1463. End Sub
  1464.  
  1465.  
  1466. Sub DetailsKeyboard( )
  1467. 	On Error Resume Next ' REQUIRED
  1468. 	gvsDetails = HandleClass( "Win32_Keyboard",             "root/CIMV2" ) & vbCrLf & vbCrLf _
  1469. 	           & HandleClass( "MSKeyboard_PortInformation", "root/WMI"   )
  1470. 	If gvaSettingsBool.Item( "DXDIAG" ) Then
  1471. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleXMLNode( "/DxDiag/DirectInput" )
  1472. 	End If
  1473. 	DetailsWindow "Keyboard", gvsDetails
  1474. 	On Error Goto 0
  1475. End Sub
  1476.  
  1477.  
  1478. Sub DetailsMainBoard( )
  1479. 	gvsDetails = HandleClass( "Win32_BaseBoard",       "root/CIMV2" ) & vbCrLf & vbCrLf _
  1480. 	           & HandleClass( "Win32_SystemEnclosure", "root/CIMV2" ) & vbCrLf & vbCrLf _
  1481. 	           & HandleClass( "Win32_WinSAT",          "root/CIMV2" )
  1482. 	If gvaSettingsBool.Item( "DMIDECODE" ) Then
  1483. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleDMIDetails( "Baseboard" )
  1484. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleDMIDetails( "System" )
  1485. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleDMIDetails( "Chassis" )
  1486. 	End If
  1487. 	DetailsWindow "Main Board and Chassis", gvsDetails
  1488. End Sub
  1489.  
  1490.  
  1491. Sub DetailsMemory( )
  1492. 	gvsDetails = HandleClass( "Win32_PhysicalMemoryArray", "root/CIMV2" ) & vbCrLf & vbCrLf _
  1493. 	           & HandleClass( "Win32_PhysicalMemory",      "root/CIMV2" ) & vbCrLf & vbCrLf _
  1494. 	           & HandleClass( "Win32_WinSAT",              "root/CIMV2" )
  1495. 	If gvaSettingsBool.Item( "DXDIAG" ) Then
  1496. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleXMLValue( "/DxDiag/SystemInformation/Memory" )
  1497. 	End If
  1498. 	If gvaSettingsBool.Item( "DMIDECODE" ) Then
  1499. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleDMIDetails( "Memory" )
  1500. 	End If
  1501. 	DetailsWindow "Memory", gvsDetails
  1502. End Sub
  1503.  
  1504.  
  1505. Sub DetailsMonitor( )
  1506. 	On Error Resume Next ' REQUIRED
  1507. 	gvsDetails = HandleClass( "Win32_DesktopMonitor",         "root/CIMV2" ) & vbCrLf & vbCrLf _
  1508. 	           & HandleClass( "WmiMonitorBasicDisplayParams", "root/WMI"   ) & vbCrLf & vbCrLf _
  1509. 	           & HandleClass( "WmiMonitorID",                 "root/WMI"   ) & vbCrLf & vbCrLf _
  1510. 	           & "<h2>\\" & gvsComputer & "\root\default:StdRegProv</h2>"    & vbcrlf & vbcrlf _
  1511. 	           & "<h3>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY</h3>"  & vbCrLf & vbCrLf _
  1512. 	           & HandleRegEnum( HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Enum\DISPLAY", 1 )
  1513. 	DetailsWindow "Monitors", gvsDetails
  1514. 	On Error Goto 0
  1515. End Sub
  1516.  
  1517.  
  1518. Sub DetailsMouse( )
  1519. 	On Error Resume Next ' REQUIRED
  1520. 	gvsDetails = HandleClass( "Win32_PointingDevice",       "root/CIMV2" ) & vbCrLf & vbCrLf _
  1521. 	           & HandleClass( "MSMouse_PortInformation",    "root/WMI"   )
  1522. 	If gvaSettingsBool.Item( "DXDIAG" ) Then
  1523. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleXMLNode( "/DxDiag/DirectInput" )
  1524. 	End If
  1525. 	DetailsWindow "Mouse", gvsDetails
  1526. 	On Error Goto 0
  1527. End Sub
  1528.  
  1529.  
  1530. Sub DetailsNIC( )
  1531. 	On Error Resume Next ' REQUIRED
  1532. 	gvsDetails = HandleClass( "MSFT_NetAdapter",                            "root/StandardCimv2" ) & vbCrLf & vbCrLf _
  1533. 	           & HandleClass( "MSFT_NetAdapterAdvancedPropertySettingData", "root/StandardCimv2" ) & vbCrLf & vbCrLf _
  1534. 	           & HandleClass( "Win32_NetworkAdapter",                       "root/CIMV2"         ) & vbCrLf & vbCrLf _
  1535. 	           & HandleClass( "MSNdis_LinkSpeed",                           "root/WMI"           ) & vbCrLf & vbCrLf _
  1536. 	           & HandleClass( "MSNdis_PhysicalMediumType",                  "root/WMI"           )
  1537. 	DetailsWindow "Network Adapter", gvsDetails
  1538. 	On Error Goto 0
  1539. End Sub
  1540.  
  1541.  
  1542. Sub DetailsPorts( )
  1543. 	gvsDetails = HandleClass( "Win32_ParallelPort",            "root/CIMV2" ) & vbCrLf & vbCrLf _
  1544. 	           & HandleClass( "Win32_SerialPort",              "root/CIMV2" ) & vbCrLf & vbCrLf _
  1545. 	           & HandleClass( "Win32_SerialPortConfiguration", "root/CIMV2" ) & vbCrLf & vbCrLf _
  1546. 	           & HandleClass( "Win32_USBController",           "root/CIMV2" ) & vbCrLf & vbCrLf _
  1547. 	           & HandleClass( "Win32_1394ControllerDevice",    "root/CIMV2" ) & vbCrLf & vbCrLf _
  1548. 	           & HandleClass( "Win32_SystemSlot",              "root/CIMV2" ) & vbCrLf & vbCrLf _
  1549. 	           & HandleClass( "Win32_PortConnector",           "root/CIMV2" )
  1550. 	If gvaSettingsBool.Item( "DXDIAG" ) Then
  1551. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleXMLNode( "/DxDiag/SystemDevices/SystemDevice" )
  1552. 	End If
  1553. 	If gvaSettingsBool.Item( "DMIDECODE" ) Then
  1554. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleDMIDetails( "Slot" )
  1555. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleDMIDetails( "Connector" )
  1556. 	End If
  1557. 	DetailsWindow "Ports and Slots", gvsDetails
  1558. End Sub
  1559.  
  1560.  
  1561. Sub DetailsSound( )
  1562. 	gvsDetails = HandleClass( "Win32_SoundDevice", "root/CIMV2" )
  1563. 	On Error Resume Next
  1564. 	gvsDetails = gvsDetails & HandleRegEnum( HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Enum\" & gvsAudioRegKey, True )
  1565. 	On Error GoTo 0
  1566. 	If gvaSettingsBool.Item( "DXDIAG" ) Then
  1567. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleXMLNode( "/DxDiag/DirectSound/SoundDevices/SoundDevice" )
  1568. 	End If
  1569. 	DetailsWindow "Sound Devices", gvsDetails
  1570. End Sub
  1571.  
  1572.  
  1573. Sub DetailsVideo( )
  1574. 	Dim arrSubKeys, i, intResult, objReg, strKey
  1575. 	gvsDetails = HandleClass( "Win32_VideoController",         "root/CIMV2" ) & vbCrLf & vbCrLf _
  1576. 	           & HandleClass( "CIM_VideoControllerResolution", "root/CIMV2" ) & vbCrLf & vbCrLf _
  1577. 	           & HandleClass( "Win32_WinSAT",                  "root/CIMV2" )
  1578. 	Set objReg = GetObject( "winmgmts:{impersonationLevel=impersonate}!//" & gvsComputer & "/root/default:StdRegProv" )
  1579. 	strKey    = "SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}"
  1580. 	intResult = objReg.EnumKey( HKEY_LOCAL_MACHINE, strKey, arrSubKeys )
  1581. 	If intResult = 0 Then
  1582. 		For i = 0 To UBound( arrSubKeys )
  1583. 			If IsNumeric( arrSubKeys(i) ) Then
  1584. 				gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleRegEnum( HKEY_LOCAL_MACHINE, strKey & "\" & arrSubKeys(i), 0 )
  1585. 			End If
  1586. 		Next
  1587. 	End If
  1588. 	Set objReg = Nothing
  1589.  
  1590. 	If gvaSettingsBool.Item( "DXDIAG" ) Then
  1591. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleXMLNode( "/DxDiag/DisplayDevices/DisplayDevice" )
  1592. 	End If
  1593. 	DetailsWindow "Display Adapters", gvsDetails
  1594. End Sub
  1595.  
  1596.  
  1597. Sub DetailsWindow( strCategory, gvsDetails )
  1598. 	Dim objDetailsFile, strHTMLBody, strHTMLFoot, strHTMLHead
  1599.  
  1600. 	strHTMLHead = "<html><head><title>" & strCategory & " details for " & gvsComputer & "</title></head><body>"
  1601. 	strHTMLBody = "<h1 style=""text-align: center;"">" & strCategory & " details for " & gvsComputer & "</h1> <pre style=""font-family: courier,monospace"">" & gvsDetails & "</pre>"
  1602. 	strHTMLFoot = "</body></html>"
  1603.  
  1604. 	' Create a temporary HTML file and open it in the default browser
  1605. 	Set objDetailsFile = gvoFSO.CreateTextFile( gvsDetailsFile )
  1606. 	objDetailsFile.Write( strHTMLHead )
  1607. 	objDetailsFile.Write( strHTMLBody )
  1608. 	objDetailsFile.Write( strHTMLFoot )
  1609. 	objDetailsFile.Close
  1610. 	Set objDetailsFile = Nothing
  1611. 	gvoWSHShell.Run gvsDetailsFile, , False
  1612. End Sub
  1613.  
  1614.  
  1615. Sub EditSettings( )
  1616. 	gvoWSHShell.Run "notepad.exe """ & gvsConfigFile & """", 1, True
  1617. 	ConfigReadFile
  1618. 	ConfigUpdateStatus
  1619. End Sub
  1620.  
  1621.  
  1622. Sub EnableWinSATScores( )
  1623. 	Dim objItem
  1624. 	' Hide WinSAT Score fields if not applicable
  1625. 	For Each objItem In document.all
  1626. 		If objItem.className = "Scores" Then
  1627. 			If gvaSettingsBool.Item( "NOSCORES" ) Or gvbWinPE Then
  1628. 				objItem.style.display    = "none"
  1629. 				objItem.style.visibility = "collapse"
  1630. 			Else
  1631. 				objItem.style.display    = "table-cell"
  1632. 				objItem.style.visibility = "visible"
  1633. 			End If
  1634. 		End If
  1635. 	Next
  1636. End Sub
  1637.  
  1638.  
  1639. Function GetBusType( myInt )
  1640. 	Dim arrBusTypes, strBusType
  1641. 	strBusType = "Unknown"
  1642. 	arrBusTypes = Split( "Unknown;SCSI;ATAPI;ATA;1394;SSA;Fibre Channel;USB;RAID;iSCSI;SAS;SATA;SD;MMC;Virtual;File Backed Virtual;Storage Spaces;NVMe;Microsoft Reserved", ";" )
  1643. 	If IsNumeric( myInt ) Then
  1644. 		If CInt( myint ) >= 0 And CInt( myInt ) <= UBound( arrBusTypes ) Then
  1645. 			strBusType = arrBusTypes( CInt( myInt ) )
  1646. 		End If
  1647. 	End If
  1648. 	GetBusType = strBusType
  1649. End Function
  1650.  
  1651.  
  1652. Function GetChassis( )
  1653. 	' Based on a script by Guy Thomas http://computerperformance.co.uk/
  1654. 	Dim colChassis, objChassis, strChassis
  1655. 	Set colChassis = gvoWMIrootCimv2.ExecQuery( "Select ChassisTypes from Win32_SystemEnclosure" )
  1656. 	For Each objChassis in colChassis
  1657. 		Select Case objChassis.ChassisTypes(0) ' ChassisTypes is returned as an array of integers
  1658. 			Case 1:
  1659. 				strChassis = "Maybe Virtual Machine"
  1660. 			Case 2:
  1661. 				strChassis = "Unknown"
  1662. 			Case 3:
  1663. 				strChassis = "Desktop"
  1664. 			Case 4:
  1665. 				strChassis = "Thin Desktop"
  1666. 			Case 5:
  1667. 				strChassis = "Pizza Box"
  1668. 			Case  6:
  1669. 				strChassis = "Mini Tower"
  1670. 			Case 7:
  1671. 				strChassis = "Full Tower"
  1672. 			Case 8:
  1673. 				strChassis = "Portable"
  1674. 			Case 9:
  1675. 				strChassis = "Laptop"
  1676. 			Case 10:
  1677. 				strChassis = "Notebook"
  1678. 			Case 11:
  1679. 				strChassis = "Hand Held"
  1680. 			Case 12:
  1681. 				strChassis = "Docking Station"
  1682. 			Case 13:
  1683. 				strChassis = "All in One"
  1684. 			Case 14:
  1685. 				strChassis = "Sub Notebook"
  1686. 			Case 15:
  1687. 				strChassis = "Space-Saving"
  1688. 			Case 16:
  1689. 				strChassis = "Lunch Box"
  1690. 			Case 17:
  1691. 				strChassis = "Main System Chassis"
  1692. 			Case 18:
  1693. 				strChassis = "Lunch Box"
  1694. 			Case 19:
  1695. 				strChassis = "SubChassis"
  1696. 			Case 20:
  1697. 				strChassis = "Bus Expansion Chassis"
  1698. 			Case 21:
  1699. 				strChassis = "Peripheral Chassis"
  1700. 			Case 22:
  1701. 				strChassis = "Storage Chassis"
  1702. 			Case 23:
  1703. 				strChassis = "Rack Mount Unit"
  1704. 			Case 24:
  1705. 				strChassis = "Sealed-Case PC"
  1706. 			Case Else:
  1707. 				strChassis = "Unknown"
  1708. 		End Select
  1709. 	Next
  1710. 	GetChassis = strChassis
  1711. End Function
  1712.  
  1713.  
  1714. Sub GetDefaultBrowser( )
  1715. 	Dim strProgID, wshShell
  1716. 	' Get default browser name
  1717. 	strProgID = gvoWSHShell.RegRead( "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice\ProgID" )
  1718. 	If InStr( strProgID, "-" ) Then
  1719. 		gvsDefaultBrowserName = Left( strProgID, InStr( strProgID, "-" ) - 1 )
  1720. 	Else
  1721. 		gvsDefaultBrowserName = strProgID
  1722. 	End If
  1723. 	If Right( gvsDefaultBrowserName, 4 ) = "HTML" Then gvsDefaultBrowserName = Left( gvsDefaultBrowserName, Len( gvsDefaultBrowserName ) - 4 )
  1724. 	If Right( gvsDefaultBrowserName, 3 ) = "HTM"  Then gvsDefaultBrowserName = Left( gvsDefaultBrowserName, Len( gvsDefaultBrowserName ) - 3 )
  1725. 	If Right( gvsDefaultBrowserName, 3 ) = "URL"  Then gvsDefaultBrowserName = Left( gvsDefaultBrowserName, Len( gvsDefaultBrowserName ) - 3 )
  1726. 	DebugMessage "", "Default browser name = """ & gvsDefaultBrowserName & """"
  1727. 	' Get default browser path
  1728. 	gvsDefaultBrowserPath = gvoWSHShell.RegRead( "HKEY_CLASSES_ROOT\" & strProgID & "\shell\open\command\" )
  1729. 	If Left( gvsDefaultBrowserPath, 1 ) = """" Then
  1730. 		gvsDefaultBrowserPath = Replace( Left( gvsDefaultBrowserPath, InStr( 2, gvsDefaultBrowserPath, """" ) ), """", "" )
  1731. 	ElseIf Not gvsDefaultBrowserPath = "" And Not gvsDefaultBrowserPath = Null Then
  1732. 		gvsDefaultBrowserPath = Left( gvsDefaultBrowserPath, InStr( gvsDefaultBrowserPath, " " ) - 1 )
  1733. 	End If
  1734. 	DebugMessage "", "Default browser path = """ & gvsDefaultBrowserPath & """"
  1735. End Sub
  1736.  
  1737.  
  1738. Function GetHostName( myComputer )
  1739. 	' This function uses a stripped version of my Hostname.cmd (version 3) batch file to get
  1740. 	' the hostname for the specified computer without requiring WMI access to that computer.
  1741. 	Dim objBatFile, objDatFile, strBatFile, strDatFile, strHostName
  1742. 	strHostName = myComputer
  1743. 	strBatFile  = gvoWSHShell.ExpandEnvironmentStrings( "%Temp%.\~hostname.bat" )
  1744. 	strDatFile  = strBatFile & ".dat"
  1745. 	With gvoFSO
  1746. 		If .FileExists( strBatFile ) Then .DeleteFile strBatFile
  1747. 		If .FileExists( strDatFile ) Then .DeleteFile strDatFile
  1748. 		Set objBatFile = .OpenTextFile( strBatFile, ForWriting, True, TristateFalse )
  1749. 		objBatFile.WriteLine "@ECHO OFF"
  1750. 		objBatFile.WriteLine "SETLOCAL ENABLEDELAYEDEXPANSION"
  1751. 		objBatFile.WriteLine "ECHO ""%~1"" | FIND.EXE "":"" >NUL && SET IPv4=|| SET IPv4=-4"
  1752. 		objBatFile.WriteLine "PING.EXE -a %1 %IPv4% -n 1 -w 100 | FIND.EXE ""["" >NUL && FOR /F ""tokens=2 delims=[]"" %%A IN ('PING.EXE -a %1 %IPv4% -n 1 -w 100 ^| FIND.EXE ""[""') DO FOR /F ""tokens=1,2 delims=[]"" %%B IN ('PING.EXE -a %%A %IPv4% -n 1 -w 100 ^| FIND.EXE ""[""') DO (FOR %%D IN (%%B) DO SET HostName=%%D)& FOR /F ""delims=."" %%E IN (""!HostName!"") DO (>""%~f0.dat"" ECHO.%%E)"
  1753. 		objBatFile.WriteLine "ENDLOCAL"
  1754. 		objBatFile.Close
  1755. 		Set objBatFile = Nothing
  1756. 		gvoWSHShell.Run strBatFile & " " & strHostName, 7, True
  1757. 		Sleep 1
  1758. 		.DeleteFile strBatFile
  1759. 		Set objDatFile = .OpenTextFile( strDatFile, ForReading, False, TristateFalse )
  1760. 		strHostName = objDatFile.ReadLine( )
  1761. 		objDatFile.Close
  1762. 		Set objDatFile = Nothing
  1763. 		.DeleteFile strDatFile
  1764. 	End With
  1765. 	GetHostName = strHostName
  1766. End Function
  1767.  
  1768.  
  1769. Function GetLocalComputerName( )
  1770. 	If gvbWinPE Then
  1771. 		GetLocalComputerName = GetLocalComputerNameWinPE( )
  1772. 	Else
  1773. 		GetLocalComputerName = UCase( gvoWSHShell.ExpandEnvironmentStrings( "%ComputerName%" ) )
  1774. 	End If
  1775. End Function
  1776.  
  1777.  
  1778. Function GetLocalComputerNameWinPE( )
  1779. ' Find computer name in WinPE
  1780. ' Based on code by Richie Schuster
  1781. ' http://www.sccmog.com/get-current-old-machine-name-winpe-vbscript/
  1782. ' Caveat: In case of a multi-boot system with multiple computer names, the script
  1783. '         only returns the computer name of the last Windows installation it finds
  1784. 	Dim colItems, objItem, objWMIService
  1785. 	GetLocalComputerNameWinPE = "localhost"
  1786. 	On Error Resume Next ' REQUIRED
  1787. 	' Find the Windows drive
  1788. 	If gvsWinDrive = "" Then
  1789. 		Set objWMIService = GetObject( "winmgmts://./root/CIMV2" )
  1790. 		Set colItems      = objWMIService.ExecQuery ( "SELECT * FROM Win32_LogicalDisk" )
  1791. 		For Each objItem in colItems
  1792. 			If gvoFSO.FolderExists( gvoFSO.BuildPath( objItem.DeviceID, "Windows\System32" ) ) Then
  1793. 				gvsWinDrive = objItem.DeviceID
  1794. 			End If
  1795. 		Next
  1796. 	End If
  1797. 	If gvsWinDrive <> "" Then
  1798. 		' Mount registry hive from Windows drive
  1799. 		gvoWSHShell.Run "CMD.EXE /C REG.EXE Load HKLM\TempHive " & gvsWinDrive & "\windows\system32\config\system", 0, True
  1800. 		' Read computer name from mounted registry hive
  1801. 		GetLocalComputerNameWinPE = UCase( gvoWSHShell.RegRead( "HKEY_LOCAL_MACHINE\TempHive\ControlSet001\Control\ComputerName\ComputerName\ComputerName" ) )
  1802. 		' Unmount registry hive from Windows drive
  1803. 		gvoWSHShell.Run "CMD.EXE /C REG.EXE Load HKLM\TempHive", 0, True
  1804. 	End If
  1805. 	Set colItems      = Nothing
  1806. 	Set objWMIService = Nothing
  1807. 	On Error Goto 0
  1808. End Function
  1809.  
  1810.  
  1811. Function GetMediaType( mtnumber )
  1812. 	Dim strMediaTypeDescription
  1813. 	strMediaTypeDescription = "Unknown"
  1814. 	Select Case mtnumber
  1815. 		Case 1:
  1816. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 1.2 MB"
  1817. 		Case 2:
  1818. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 1.44 MB"
  1819. 		Case 3:
  1820. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 2.88 MB"
  1821. 		Case 4:
  1822. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 20.8 MB"
  1823. 		Case 5:
  1824. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 720 KB"
  1825. 		Case 6:
  1826. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 360 KB"
  1827. 		Case 7:
  1828. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 320 KB"
  1829. 		Case 8:
  1830. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 320 KB"
  1831. 		Case 9:
  1832. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 180 KB"
  1833. 		Case 10:
  1834. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 160 KB"
  1835. 		Case 11:
  1836. 			strMediaTypeDescription = "Removable media other than floppy"
  1837. 		Case 12:
  1838. 			strMediaTypeDescription = "Fixed hard disk media"
  1839. 		Case 13:
  1840. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 120 MB"
  1841. 		Case 14:
  1842. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 640 KB"
  1843. 		Case 15:
  1844. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 640 KB"
  1845. 		Case 16:
  1846. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 720 KB"
  1847. 		Case 17:
  1848. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 1.2 MB"
  1849. 		Case 18:
  1850. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 1.23 MB"
  1851. 		Case 19:
  1852. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 1.23 MB"
  1853. 		Case 20:
  1854. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 128 MB"
  1855. 		Case 21:
  1856. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 230 MB"
  1857. 		Case 22:
  1858. 			strMediaTypeDescription = "8 Inch Floppy Disk 256 KB"
  1859. 		Case Else:
  1860. 			strMediaTypeDescription = "Unknown"
  1861. 	End Select
  1862. 	GetMediaType = strMediaTypeDescription
  1863. End Function
  1864.  
  1865.  
  1866. Function GetMemoryFormFactor( )
  1867. 	Dim colItems, objItem, objWMIService, intFormFactor, strFormFactor, strQuery
  1868. 	intFormFactor = 0
  1869. 	strFormFactor = ""
  1870. 	strQuery = "SELECT FormFactor FROM Win32_PhysicalMemory"
  1871. 	Set objWMIService = GetObject( "winmgmts://" & gvsComputer & "/root/CIMV2"   )
  1872. 	Set colItems = objWMIService.ExecQuery( strQuery )
  1873. 	If Not Err Then
  1874. 		For Each objItem In colItems
  1875. 			intFormFactor = CInt( objItem.FormFactor )
  1876. 		Next
  1877. 	End If
  1878. 	Select Case intFormFactor
  1879. 		Case 0:
  1880. 			strFormFactor = "Unknown"
  1881. 		Case 1:
  1882. 			strFormFactor = "Other"
  1883. 		Case 2:
  1884. 			strFormFactor = "SIP"
  1885. 		Case 3:
  1886. 			strFormFactor = "DIP"
  1887. 		Case 4:
  1888. 			strFormFactor = "ZIP"
  1889. 		Case 5:
  1890. 			strFormFactor = "SOJ"
  1891. 		Case 6:
  1892. 			strFormFactor = "Proprietary"
  1893. 		Case 7:
  1894. 			strFormFactor = "SIMM"
  1895. 		Case 8:
  1896. 			strFormFactor = "DIMM"
  1897. 		Case 9:
  1898. 			strFormFactor = "TSOP"
  1899. 		Case 10:
  1900. 			strFormFactor = "PGA"
  1901. 		Case 11:
  1902. 			strFormFactor = "RIMM"
  1903. 		Case 12:
  1904. 			strFormFactor = "SODIMM"
  1905. 		Case 13:
  1906. 			strFormFactor = "SRIMM"
  1907. 		Case 14:
  1908. 			strFormFactor = "SMD"
  1909. 		Case 15:
  1910. 			strFormFactor = "SSMP"
  1911. 		Case 16:
  1912. 			strFormFactor = "QFP"
  1913. 		Case 17:
  1914. 			strFormFactor = "TQFP"
  1915. 		Case 18:
  1916. 			strFormFactor = "SOIC"
  1917. 		Case 19:
  1918. 			strFormFactor = "LCC"
  1919. 		Case 20:
  1920. 			strFormFactor = "PLCC"
  1921. 		Case 21:
  1922. 			strFormFactor = "BGA"
  1923. 		Case 22:
  1924. 			strFormFactor = "FPBGA"
  1925. 		Case 23:
  1926. 			strFormFactor = "LGA"
  1927. 		Case Else:
  1928. 			strFormFactor = "Unknown"
  1929. 	End Select
  1930. 	GetMemoryFormFactor = strFormFactor
  1931. End Function
  1932.  
  1933.  
  1934. Function GetMonitorManufacturerFullName( tlc )
  1935. 	' List of 3-letter monitor manufacturer codes
  1936. 	' https://community.lansweeper.com/t5/managing-assets/list-of-3-letter-monitor-manufacturer-codes/ta-p/64429
  1937. 	Dim MonitorManufacturerCodes
  1938. 	Set MonitorManufacturerCodes = CreateObject( "Scripting.Dictionary" )
  1939. 	MonitorManufacturerCodes.Item( "ACI" ) = "Asus (ASUSTeK Computer Inc.)"
  1940. 	MonitorManufacturerCodes.Item( "ACR" ) = "Acer America Corp."
  1941. 	MonitorManufacturerCodes.Item( "ACT" ) = "Targa"
  1942. 	MonitorManufacturerCodes.Item( "ADI" ) = "ADI Corporation"
  1943. 	MonitorManufacturerCodes.Item( "AMW" ) = "AMW"
  1944. 	MonitorManufacturerCodes.Item( "AOC" ) = "AOC International (USA) Ltd."
  1945. 	MonitorManufacturerCodes.Item( "API" ) = "Acer America Corp."
  1946. 	MonitorManufacturerCodes.Item( "APP" ) = "Apple Computer, Inc."
  1947. 	MonitorManufacturerCodes.Item( "ART" ) = "ArtMedia"
  1948. 	MonitorManufacturerCodes.Item( "AST" ) = "AST Research"
  1949. 	MonitorManufacturerCodes.Item( "AUO" ) = "AU Optronics"
  1950. 	MonitorManufacturerCodes.Item( "BMM" ) = "BMM"
  1951. 	MonitorManufacturerCodes.Item( "BNQ" ) = "BenQ Corporation"
  1952. 	MonitorManufacturerCodes.Item( "BOE" ) = "BOE Display Technology"
  1953. 	MonitorManufacturerCodes.Item( "CPL" ) = "Compal Electronics, Inc. / ALFA"
  1954. 	MonitorManufacturerCodes.Item( "CPQ" ) = "COMPAQ Computer Corp."
  1955. 	MonitorManufacturerCodes.Item( "CTX" ) = "CTX / Chuntex Electronic Co."
  1956. 	MonitorManufacturerCodes.Item( "DEC" ) = "Digital Equipment Corporation"
  1957. 	MonitorManufacturerCodes.Item( "DEL" ) = "Dell Computer Corp."
  1958. 	MonitorManufacturerCodes.Item( "DPC" ) = "Delta Electronics, Inc."
  1959. 	MonitorManufacturerCodes.Item( "DWE" ) = "Daewoo Telecom Ltd"
  1960. 	MonitorManufacturerCodes.Item( "ECS" ) = "ELITEGROUP Computer Systems"
  1961. 	MonitorManufacturerCodes.Item( "EIZ" ) = "EIZO"
  1962. 	MonitorManufacturerCodes.Item( "EPI" ) = "Envision Peripherals, Inc."
  1963. 	MonitorManufacturerCodes.Item( "FCM" ) = "Funai Electric Company of Taiwan"
  1964. 	MonitorManufacturerCodes.Item( "FUS" ) = "Fujitsu Siemens"
  1965. 	MonitorManufacturerCodes.Item( "GSM" ) = "LG Electronics Inc. (GoldStar Technology, Inc.)"
  1966. 	MonitorManufacturerCodes.Item( "GWY" ) = "Gateway 2000"
  1967. 	MonitorManufacturerCodes.Item( "HEI" ) = "Hyundai Electronics Industries Co., Ltd."
  1968. 	MonitorManufacturerCodes.Item( "HIQ" ) = "Hyundai ImageQuest"
  1969. 	MonitorManufacturerCodes.Item( "HIT" ) = "Hitachi"
  1970. 	MonitorManufacturerCodes.Item( "HSD" ) = "Hannspree Inc"
  1971. 	MonitorManufacturerCodes.Item( "HSL" ) = "Hansol Electronics"
  1972. 	MonitorManufacturerCodes.Item( "HTC" ) = "Hitachi Ltd. / Nissei Sangyo America Ltd."
  1973. 	MonitorManufacturerCodes.Item( "HWP" ) = "Hewlett Packard (HP)"
  1974. 	MonitorManufacturerCodes.Item( "HPN" ) = "Hewlett Packard (HP)"
  1975. 	MonitorManufacturerCodes.Item( "IBM" ) = "IBM PC Company"
  1976. 	MonitorManufacturerCodes.Item( "ICL" ) = "Fujitsu ICL"
  1977. 	MonitorManufacturerCodes.Item( "IFS" ) = "InFocus"
  1978. 	MonitorManufacturerCodes.Item( "IQT" ) = "Hyundai"
  1979. 	MonitorManufacturerCodes.Item( "IVM" ) = "Idek Iiyama North America, Inc."
  1980. 	MonitorManufacturerCodes.Item( "KDS" ) = "KDS USA"
  1981. 	MonitorManufacturerCodes.Item( "KFC" ) = "KFC Computek"
  1982. 	MonitorManufacturerCodes.Item( "LEN" ) = "Lenovo"
  1983. 	MonitorManufacturerCodes.Item( "LGD" ) = "LG Display"
  1984. 	MonitorManufacturerCodes.Item( "LKM" ) = "ADLAS / AZALEA"
  1985. 	MonitorManufacturerCodes.Item( "LNK" ) = "LINK Technologies, Inc."
  1986. 	MonitorManufacturerCodes.Item( "LPL" ) = "LG Philips"
  1987. 	MonitorManufacturerCodes.Item( "LTN" ) = "Lite-On"
  1988. 	MonitorManufacturerCodes.Item( "MAG" ) = "MAG InnoVision"
  1989. 	MonitorManufacturerCodes.Item( "MAX" ) = "Maxdata Computer GmbH"
  1990. 	MonitorManufacturerCodes.Item( "MEI" ) = "Panasonic Comm. & Systems Co."
  1991. 	MonitorManufacturerCodes.Item( "MEL" ) = "Mitsubishi Electronics"
  1992. 	MonitorManufacturerCodes.Item( "MIR" ) = "Miro Computer Products AG"
  1993. 	MonitorManufacturerCodes.Item( "MTC" ) = "MITAC"
  1994. 	MonitorManufacturerCodes.Item( "NAN" ) = "NANAO"
  1995. 	MonitorManufacturerCodes.Item( "NEC" ) = "NEC Technologies, Inc."
  1996. 	MonitorManufacturerCodes.Item( "NOK" ) = "Nokia"
  1997. 	MonitorManufacturerCodes.Item( "NVD" ) = "Nvidia"
  1998. 	MonitorManufacturerCodes.Item( "OQI" ) = "OPTIQUEST"
  1999. 	MonitorManufacturerCodes.Item( "PBN" ) = "Packard Bell"
  2000. 	MonitorManufacturerCodes.Item( "PCK" ) = "Daewoo"
  2001. 	MonitorManufacturerCodes.Item( "PDC" ) = "Polaroid"
  2002. 	MonitorManufacturerCodes.Item( "PGS" ) = "Princeton Graphic Systems"
  2003. 	MonitorManufacturerCodes.Item( "PHL" ) = "Philips Consumer Electronics Co."
  2004. 	MonitorManufacturerCodes.Item( "PRT" ) = "Princeton"
  2005. 	MonitorManufacturerCodes.Item( "REL" ) = "Relisys"
  2006. 	MonitorManufacturerCodes.Item( "SAM" ) = "Samsung"
  2007. 	MonitorManufacturerCodes.Item( "SEC" ) = "Seiko Epson Corporation"
  2008. 	MonitorManufacturerCodes.Item( "SMC" ) = "Samtron"
  2009. 	MonitorManufacturerCodes.Item( "SMI" ) = "Smile"
  2010. 	MonitorManufacturerCodes.Item( "SNI" ) = "Siemens Nixdorf"
  2011. 	MonitorManufacturerCodes.Item( "SNY" ) = "Sony Corporation"
  2012. 	MonitorManufacturerCodes.Item( "SPT" ) = "Sceptre"
  2013. 	MonitorManufacturerCodes.Item( "SRC" ) = "Shamrock Technology"
  2014. 	MonitorManufacturerCodes.Item( "STN" ) = "Samtron"
  2015. 	MonitorManufacturerCodes.Item( "STP" ) = "Sceptre"
  2016. 	MonitorManufacturerCodes.Item( "TAT" ) = "Tatung Co. of America, Inc."
  2017. 	MonitorManufacturerCodes.Item( "TRL" ) = "Royal Information Company"
  2018. 	MonitorManufacturerCodes.Item( "TSB" ) = "Toshiba, Inc."
  2019. 	MonitorManufacturerCodes.Item( "UNM" ) = "Unisys Corporation"
  2020. 	MonitorManufacturerCodes.Item( "VSC" ) = "ViewSonic Corporation"
  2021. 	MonitorManufacturerCodes.Item( "WTC" ) = "Wen Technology"
  2022. 	MonitorManufacturerCodes.Item( "ZCM" ) = "Zenith Data Systems"
  2023. 	If MonitorManufacturerCodes.Exists( UCase( tlc ) ) Then
  2024. 		GetMonitorManufacturerFullName = MonitorManufacturerCodes.Item( UCase( tlc ) )
  2025. 	Else
  2026. 		GetMonitorManufacturerFullName = UCase( tlc )
  2027. 	End If
  2028. End Function
  2029.  
  2030.  
  2031. Function GetOSVer( )
  2032. 	Dim arrOS, colItems, objItem, objWMIService
  2033. 	GetOSVer = 0
  2034. 	Set objWMIService = GetObject( "winmgmts://./root/CIMV2" )
  2035. 	Set colItems = objWMIService.ExecQuery( "SELECT Version FROM Win32_OperatingSystem" )
  2036. 	If Not Err Then
  2037. 		For Each objItem In colItems
  2038. 			arrOS = Split( objItem.Version, "." )
  2039. 			If UBound( arrOS ) > 1 Then
  2040. 				GetOSVer = arrOS(0) & "." & arrOS(1)
  2041. 			Else
  2042. 				GetOSVer = arrOS(0)
  2043. 			End If
  2044. 		Next
  2045. 	End If
  2046. 	Set colItems      = Nothing
  2047. 	Set objWMIService = Nothing
  2048. End Function
  2049.  
  2050.  
  2051. Function GetParameter( myString, myParameter )
  2052. 	' Extract switch value from command line,
  2053. 	' e.g. GetParameter( "/CM /SIZE:1024x768 /NOUPD", "SIZE" ) to extract "1024x768"
  2054. 	Dim strItem, strParameter, strString
  2055. 	' Default return value is an empty string
  2056. 	strParameter = UCase( myParameter )
  2057. 	myString     = Trim( myString )
  2058. 	strString    = UCase( myString )
  2059. 	If InStr( strString, "/" & strParameter & ":" ) Then
  2060. 		' Step 1: extract switch and everything following it, e.g. "/SIZE:1024x768 /NOUPD"
  2061. 		strItem = Mid( myString, InStr( strString, "/" & strParameter & ":" ) )
  2062. 		' Check if there is anything following the switch and colon
  2063. 		If Len( strItem ) > Len( "/" & strParameter & ":" ) Then
  2064. 			' Step 2: remove the switch name and colon, e.g. in our example this leaves us with "1024x768 /NOUPD"
  2065. 			strItem = Mid( strItem, Len( "/" & strParameter & ":" ) + 1 )
  2066. 			' Check again if there is anything left to parse
  2067. 			If Len( strItem ) > 1 Then
  2068. 				' Check if the value starts with a doublequote
  2069. 				If Left( strItem, 1 ) = """" Then
  2070. 					' Remove the opening doublequote
  2071. 					strItem = Mid( strItem, 2 )
  2072. 					' Remove the closing doublequote and everything after it
  2073. 					strItem = Left( strItem, InStr( strItem, """" ) - 1 )
  2074. 				Else
  2075. 					' If not in doublequotes, remove the first space and everything following it,
  2076. 					' e.g. in our example this leaves us with "1024x768"
  2077. 					If InStr( strItem, " " ) Then strItem = Left( strItem, InStr( strItem, " " ) - 1 )
  2078. 				End If
  2079. 				' Return the result
  2080. 				GetParameter = Trim( strItem )
  2081. 			End If
  2082. 		End If
  2083. 	End If
  2084. End Function
  2085.  
  2086.  
  2087. Function GetRandomString( myLength )
  2088. 	Dim i, intChar, strResult
  2089. 	strResult = ""
  2090. 	For i = 1 To myLength
  2091. 		intChar = gvoRandom.Next_2( 48, 83 )
  2092. 		If intChar > 57 Then intChar = intChar + 7 ' numbers and captital letters only
  2093. 		strResult = strResult & Chr( intChar )
  2094. 	Next
  2095. 	GetRandomString = strResult
  2096. End Function
  2097.  
  2098.  
  2099. Function GetVideoRAM( myVideoCard )
  2100. 	' UInt32 cannot handle 4GB and greater, so we'll have to look it up in the registry
  2101. 	' Based on PowerShell code by "farag" at
  2102. 	' https://superuser.com/questions/1461858/fetch-correct-vram-for-gpu-via-command-line-on-windows/1497378#1497378
  2103. 	' Corrected for remote computers AND for multiple video controllers AND for both integrated and discrete video controllers by Steve Robertson
  2104. 	Dim arrSubKeys
  2105. 	Dim binVidMem
  2106. 	Dim i, intRegKeyCount, lngVidMem
  2107. 	Dim objReg
  2108. 	Dim strAdapterName, strRegKey, strSubKey, strVidMem
  2109.  
  2110. 	lngVidMem   = 0
  2111.  
  2112. 	strRegKey = "SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}"
  2113. 	Set objReg = GetObject( "winmgmts:{impersonationLevel=impersonate}!//" & gvaSettingsStr.Item( "COMPUTER" ) & "/root/default:StdRegProv" )
  2114. 	If objReg.EnumKey( HKEY_LOCAL_MACHINE, strRegKey, arrSubKeys ) = 0 Then
  2115. 		For intRegKeyCount = 0 To UBound( arrSubKeys )
  2116. 			If IsNumeric( arrSubKeys( intRegKeyCount ) ) Then
  2117. 				strSubKey = strRegKey & "\" & Right( "0000" & intRegKeyCount, 4 )
  2118. 				If objReg.GetStringValue( HKEY_LOCAL_MACHINE, strSubKey, "DriverDesc", strAdapterName ) = 0 Then
  2119. 					If strAdapterName = myVideoCard Then
  2120. 						' If a value is specified for HardwareInformation.qwMemorySize, the memory size is 4GB or more and we can ignore HardwareInformation.MemorySize
  2121. 						If objReg.GetQWORDValue( HKEY_LOCAL_MACHINE, strSubKey, "HardwareInformation.qwMemorySize", lngVidMem ) = 0 Then
  2122. 							' lngVidMem contains the amount of video RAM in bytes
  2123. 						ElseIf objReg.GetDWORDValue( HKEY_LOCAL_MACHINE, strSubKey, "HardwareInformation.MemorySize", lngVidMem ) = 0 Then
  2124. 							' lngVidMem contains the amount of video RAM in bytes
  2125. 						ElseIf objReg.GetBinaryValue( HKEY_LOCAL_MACHINE, strSubKey, "HardwareInformation.MemorySize", binVidMem ) = 0 Then
  2126. 							' binVidMem contains the amount of video RAM in MB and specified in a binary array
  2127. 							strVidMem = "&H"
  2128. 							For i = 0 To UBound( binVidMem )
  2129. 								strVidMem = strVidMem & binVidMem( i )
  2130. 							Next
  2131. 							lngVidMem = Int( strVidMem ) * MB
  2132. 						Else
  2133. 							lngVidMem = 0
  2134. 						End If
  2135. 					End If
  2136. 				End If
  2137. 			End If
  2138. 		Next
  2139. 	Else
  2140. 		Exit Function
  2141. 	End If
  2142. 	Set objReg = Nothing
  2143. 	GetVideoRAM = Round( lngVidMem / MB )
  2144. End Function
  2145.  
  2146.  
  2147. Function HandleClass( myClass, myNameSpace )
  2148. ' This subroutine lists all properties and their values for a specified class.
  2149. ' Created using an example from a Microsoft TechNet ScriptCenter article:
  2150. ' http://www.microsoft.com/technet/scriptcenter/resources/guiguy/default.mspx
  2151. 	Dim blnNumChain, colItems, intChar, intPadding, intTest, objClass, objItem, objProperty, objWMIService2, strPadding, strProperties
  2152.  
  2153. 	On Error Resume Next ' REQUIRED
  2154.  
  2155. 	strProperties = "<h2>\\" & gvsComputer & "\" & Replace( myNameSpace, "/", "\" ) & ":" & myClass & "</h2>" & vbCrLf & vbCrLf
  2156.  
  2157. 	If LCase( myNameSpace ) = "root/cimv2" Then
  2158. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM " & myClass )
  2159. 		Set objClass = gvoWMIrootCimv2.Get( myClass )
  2160. 		If Err Then
  2161. 			HandleClass = strProperties & "<p>Error while trying to query \\" & gvsComputer & "\root\CIMV2\" & myClass & "</p>" & vbCrLf & vbCrLf
  2162. 			Exit Function
  2163. 		End If
  2164. 	ElseIf LCase( myNameSpace ) = "root/wmi" Then
  2165. 		Set colItems = gvoWMIrootWMI.ExecQuery( "SELECT * FROM " & myClass )
  2166. 		Set objClass = gvoWMIrootWMI.Get( myClass )
  2167. 		If Err Then
  2168. 			HandleClass = strProperties & "<p>Error while trying to query \\" & gvsComputer & "\root\WMI\" & myClass & "</p>" & vbCrLf & vbCrLf
  2169. 			Exit Function
  2170. 		End If
  2171. 	ElseIf LCase( myNameSpace ) = "root/standardcimv2" Then
  2172. 		Set colItems = gvoWMIrootStandardCimv2.ExecQuery( "SELECT * FROM " & myClass )
  2173. 		Set objClass = gvoWMIrootStandardCimv2.Get( myClass )
  2174. 		If Err Then
  2175. 			HandleClass = strProperties & "<p>Error while trying to query \\" & gvsComputer & "\root\StandardCimv2\" & myClass & "</p>" & vbCrLf & vbCrLf
  2176. 			Exit Function
  2177. 		End If
  2178. 	Else
  2179. 		Set objWMIService2 = GetObject( "winmgmts://" & gvsComputer & "/" & myNameSpace )
  2180. 		If Err Then
  2181. 			HandleClass = strProperties & "<p>Error while trying to connect to \\" & gvsComputer & "\" & Replace( myNameSpace, "/", "\" ) & "</p>" & vbCrLf & vbCrLf
  2182. 			Exit Function
  2183. 		End If
  2184. 		Set colItems = objWMIService2.ExecQuery( "SELECT * FROM " & myClass )
  2185. 		Set objClass = objWMIService2.Get( myClass )
  2186. 		If Err Then
  2187. 			HandleClass = strProperties & "<p>Error while trying to query \\" & gvsComputer & "\" & Replace( myNameSpace, "/", "\" ) & "\" & myClass & "</p>" & vbCrLf & vbCrLf
  2188. 			Exit Function
  2189. 		End If
  2190. 	End If
  2191.  
  2192. 	Select Case colItems.Count
  2193. 		Case 0
  2194. 			strProperties = strProperties & "<p>No instances.</p>" & vbCrLf & vbCrLf
  2195. 		Case 1
  2196. 			strProperties = strProperties & "<p>1 instance:</p>" & vbCrLf & vbCrLf
  2197. 		Case Else
  2198. 			strProperties = strProperties & "<p>" & colItems.Count & " instances:</p>" & vbCrLf & vbCrLf
  2199. 	End Select
  2200.  
  2201. 	For Each objItem In colItems
  2202. 		intPadding = 1
  2203. 		For Each objProperty In objClass.Properties_
  2204. 			intPadding = Max( intPadding, Len( CreateLine( objProperty.Name ) ) )
  2205. 		Next
  2206. 		strpadding = Space( intPadding )
  2207. 		For Each objProperty In objClass.Properties_
  2208. 			If objProperty.IsArray = True Then
  2209. 				blnNumChain = True
  2210. 				intTest     = 0
  2211. 				For Each intChar In Eval( "objItem." & objProperty.Name )
  2212. 					If IsNumeric( intChar ) Then
  2213. 						intTest = intTest + intChar
  2214. 					Else
  2215. 						blnNumChain = False
  2216. 						Exit For
  2217. 					End If
  2218. 				Next
  2219. 				If blnNumChain And gvaSettingsBool.Item( "CHAIN" ) And ( intTest > 0 ) And ( InStr( objProperty.Name, "Characteristic" ) < 1 ) And ( InStr( objProperty.Name, "Capabilit" ) < 1 ) Then
  2220. 					strProperties = strProperties & Left( CreateLine( objProperty.Name & " (array)"  ) & strPadding, intPadding ) & " : " & Eval( "Join( objItem." & objProperty.Name & ", "","" )" ) & vbCrLf
  2221. 					strProperties = strProperties & Left( CreateLine( objProperty.Name & " (string)" ) & strPadding, intPadding ) & " : " & Eval( "Chain( objItem." & objProperty.Name & " )" ) & vbCrLf
  2222. 				Else
  2223. 					strProperties = strProperties & Left( CreateLine( objProperty.Name ) & strPadding, intPadding ) & " : " & Eval( "Join( objItem." & objProperty.Name & ", "","" )" ) & vbCrLf
  2224. 				End If
  2225. 			Else
  2226. 				If IsDate( Eval( "objItem." & objProperty.Name ) ) Then
  2227. 					strProperties = strProperties & Left( CreateLine( objProperty.Name ) & strPadding, intPadding ) & " : " & FormatDateTime( Eval( "objItem." & objProperty.Name ) ) & vbCrLf
  2228. 				Else
  2229. 					strProperties = strProperties & Left( CreateLine( objProperty.Name ) & strPadding, intPadding ) & " : " & Eval( "objItem." & objProperty.Name ) & vbCrLf
  2230. 				End If
  2231. 			End If
  2232. 		Next
  2233. 		strProperties = strProperties & vbCrLf & vbCrLf
  2234. 	Next
  2235.  
  2236. 	Set objWMIService2 = Nothing
  2237.  
  2238. 	On Error Goto 0
  2239.  
  2240. 	HandleClass = strProperties
  2241. End Function
  2242.  
  2243.  
  2244. Function HandleDMIDetails( myType )
  2245. 	Dim objCMD, strMsg, strOutput
  2246. 	HandleDMIDetails = ""
  2247. 	If gvbWinPE Then Exit Function
  2248. 	On Error Resume Next ' REQUIRED
  2249. 	Set objCMD = gvoWSHShell.Exec( "CMD.EXE /C """ & gvsDMIDecode & """ --type " & LCase( myType ) & " 2>&1" )
  2250. 	strOutput = objCMD.StdOut.ReadAll
  2251. 	objCMD.Terminate
  2252. 	Set objCMD = Nothing
  2253. 	On Error Goto 0
  2254. 	HandleDMIDetails = "<h2>\\" & gvsComputer & " " & "DMI " & myType & " details</h2>" & vbCrLf & vbCrLf & "<pre>" & strOutput & "</pre>" & vbCrLf
  2255. End Function
  2256.  
  2257.  
  2258. Function HandleRegEnum( myHive, myRegPath, myRecursion )
  2259. 	Dim arrSubkeys, arrValueNames, arrValueTypes
  2260. 	Dim blnRecursion
  2261. 	Dim i, intMaxTypeLen, intMaxNameLen, intResult
  2262. 	Dim objReg
  2263. 	Dim strData, strHive, strResult
  2264. 	Dim varData
  2265. 	blnRecursion = ( myRecursion <> 0 )
  2266. 	strResult     = ""
  2267. 	intMaxTypeLen = 0
  2268. 	intMaxNameLen = 0
  2269. 	Select Case myHive
  2270. 		Case HKEY_CLASSES_ROOT
  2271. 			strHive = "HKEY_CLASSES_ROOT"
  2272. 		Case HKEY_CURRENT_USER
  2273. 			strHive = "HKEY_CURRENT_USER"
  2274. 		Case HKEY_LOCAL_MACHINE
  2275. 			strHive = "HKEY_LOCAL_MACHINE"
  2276. 		Case HKEY_USERS
  2277. 			strHive = "HKEY_USERS"
  2278. 		Case HKEY_CURRENT_CONFIG
  2279. 			strHive = "HKEY_CURRENT_CONFIG"
  2280. 		Case Else
  2281. 			strHive = myHive
  2282. 	End Select
  2283. 	On Error Resume Next ' REQUIRED
  2284. 	Set objReg = GetObject( "winmgmts:{impersonationLevel=impersonate}!//" & gvsComputer & "/root/default:StdRegProv" )
  2285. 	strResult = "<h2>[" & strHive & "\" & myRegPath & "]</h2>" & vbCrLf
  2286. 	intResult = objReg.EnumValues( myHive, myRegPath, arrValueNames, arrValueTypes )
  2287. 	If intResult = 0 Then
  2288. 		If IsArray( arrValueNames ) And IsArray( arrValueTypes ) Then
  2289. 			For i = 0 To UBound( arrValueNames )
  2290. 				If Len( arrValueNames(i) )                 > intMaxNameLen Then intMaxNameLen = Len( arrValueNames(i) )
  2291. 				If Len( gvaRegDataType(arrValueTypes(i)) ) > intMaxTypeLen Then intMaxTypeLen = Len( gvaRegDataType(arrValueTypes(i)) )
  2292. 			Next
  2293. 			For i = 0 To UBound( arrValueNames )
  2294. 				strData = ""
  2295. 				Select Case arrValueTypes(i)
  2296. 					Case REG_SZ:
  2297. 						intResult = objReg.GetStringValue( myHive, myRegPath, arrValueNames(i), strData )
  2298. 					Case REG_EXPAND_SZ:
  2299. 						intResult = objReg.GetExpandedStringValue( myHive, myRegPath, arrValueNames(i), strData )
  2300. 					Case REG_BINARY:
  2301. 						intResult = objReg.GetBinaryValue( myHive, myRegPath, arrValueNames(i), varData )
  2302. 						If Not Err And IsArray( varData ) Then
  2303. 							strData = Join( varData, ";" )
  2304. 						End If
  2305. 					Case REG_DWORD, REG_DWORD_BIG_ENDIAN:
  2306. 						intResult = objReg.GetDWORDValue( myHive, myRegPath, arrValueNames(i), varData )
  2307. 						strData = "0x" & Right( String( 8, "0" ) & CStr( Hex( varData ) ), 8 ) & " (" & varData & ")"
  2308. 					Case REG_MULTI_SZ:
  2309. 						intResult = objReg.GetMultiStringValue( myHive, myRegPath, arrValueNames(i), varData )
  2310. 						strData = Join( varData, ";" )
  2311. 					Case REG_QWORD:
  2312. 						intResult = objReg.GetQWORDValue( myHive, myRegPath, arrValueNames(i), varData )
  2313. 						strData = "0x" & Right( String( 16, "0" ) & CStr( Hex( varData ) ), 16 ) & " (" & varData & ")"
  2314. 				End Select
  2315. 				If intResult = 0 Then
  2316. 					strResult = strResult & Left( arrValueNames(i) & Space( intMaxNameLen + 4 ), intMaxNameLen + 4) & Left( "[" & gvaRegDataType(arrValueTypes(i)) & "]" & Space( intMaxTypeLen + 4 ), intMaxTypeLen + 4 ) & strData & vbCrLf
  2317. 				End If
  2318. 			Next
  2319. 		End If
  2320. 	End If
  2321.  
  2322. 	If blnRecursion And intResult = 0 Then
  2323. 		strResult = strResult & vbCrLf
  2324. 		objReg.EnumKey myHive, myRegPath, arrSubkeys
  2325. 		If Not Err And IsArray( arrSubkeys ) Then
  2326. 			For i = 0 To UBound( arrSubkeys )
  2327. 				strResult = strResult & HandleRegEnum( myHive, myRegPath & "\" & arrSubkeys(i), 1 )
  2328. 			Next
  2329. 		End If
  2330. 	End If
  2331. 	Set objReg = Nothing
  2332. 	On Error Goto 0
  2333. 	HandleRegEnum = strResult
  2334. End Function
  2335.  
  2336.  
  2337. Function HandleXMLNode( myQuery )
  2338. 	Dim i, strDeviceType, strMsg, strQuery2
  2339. 	Dim colNodes, colNodes2, objNode, objNode2, objNode3, objNode4, objNode5, objNode6, xmlDoc
  2340. 	HandleXMLNode = ""
  2341. 	If gvbWinPE Then Exit Function
  2342. 	strDeviceType = Left( myQuery, InStrRev( myQuery, "/" ) - 1 )
  2343. 	strDeviceType = Mid( strDeviceType, InStrRev( strDeviceType, "/" ) + 1 )
  2344. 	strMsg        = "<h2>\\" & gvsComputer & " " & "DxDiag " & strDeviceType & " data</h2>" & vbCrLf & vbCrLf
  2345. 	On Error Resume Next ' REQUIRED
  2346. 	Set xmlDoc = CreateObject( "Microsoft.XMLDOM" )
  2347. 	xmlDoc.Async = "False"
  2348. 	xmlDoc.Load gvaSettingsStr.Item( "XML" )
  2349. 	Set colNodes = xmlDoc.selectNodes( myQuery )
  2350. 	Select Case colNodes.length
  2351. 		Case 0
  2352. 			strMsg = strMsg & "<p>No instances.</p>"
  2353. 		Case 1
  2354. 			strMsg = strMsg & "<p>1 instance:</p>"
  2355. 		Case Else
  2356. 			strMsg = strMsg & "<p>" & colNodes.length & " instances:</p>"
  2357. 	End Select
  2358. 	strMsg = strMsg & vbCrLf & vbCrLf & "<pre>"
  2359. 	For i = 0 To colNodes.length - 1
  2360. 		strQuery2 = myQuery & "[" & i & "]/*"
  2361. 		Set colNodes2 = xmlDoc.selectNodes( strQuery2 )
  2362. 		For Each objNode2 in colNodes2
  2363. 			If objNode2.childNodes.length = 1 Then
  2364. 				strMsg = strMsg & objNode2.nodeName & " = " & objNode2.text & vbCrLf
  2365. 			Else
  2366. 				strMsg = strMsg & objNode2.nodeName & ":" & vbCrLf
  2367. 				For Each objNode3 In objNode2.childNodes
  2368. 					If objNode3.childNodes.length = 1 Then
  2369. 						strMsg = strMsg & "  " & objNode3.nodeName & " = " & objNode3.text & vbCrLf
  2370. 					Else
  2371. 						strMsg = strMsg & objNode3.nodeName & ":" & vbCrLf
  2372. 						For Each objNode4 In objNode3.childNodes
  2373. 							If objNode4.childNodes.length = 1 Then
  2374. 								strMsg = strMsg & "  " & objNode4.nodeName & " = " & objNode4.text & vbCrLf
  2375. 							Else
  2376. 								strMsg = strMsg & objNode4.nodeName & ":" & vbCrLf
  2377. 								For Each objNode5 In objNode4.childNodes
  2378. 									If objNode5.childNodes.length = 1 Then
  2379. 										strMsg = strMsg & "  " & objNode5.nodeName & " = " & objNode5.text & vbCrLf
  2380. 									Else
  2381. 										strMsg = strMsg & objNode5.nodeName & ":" & vbCrLf
  2382. 										For Each objNode6 In objNode5.childNodes
  2383. 											strMsg = strMsg & "  " & objNode6.nodeName & " = " & objNode6.text & vbCrLf
  2384. 										Next
  2385. 									End If
  2386. 								Next
  2387. 							End If
  2388. 						Next
  2389. 					End If
  2390. 				Next
  2391. 			End If
  2392. 		Next
  2393. 		strMsg = strMsg & vbCrLf & vbCrLf
  2394. 	Next
  2395. 	strMsg = strMsg & "</pre>" & vbCrLf
  2396. 	Set colNodes2 = Nothing
  2397. 	Set colNodes  = Nothing
  2398. 	Set xmlDoc    = Nothing
  2399. 	On Error Goto 0
  2400. 	HandleXMLNode = strMsg
  2401. End Function
  2402.  
  2403.  
  2404. Function HandleXMLValue( myQuery )
  2405. 	Dim i, strDeviceType, strMsg, strQuery2
  2406. 	Dim colNodes, colNodes2, objNode, objNode2, objNode3, xmlDoc
  2407. 	HandleXMLValue = ""
  2408. 	If gvbWinPE Then Exit Function
  2409. 	strDeviceType  = Left( myQuery, InStrRev( myQuery, "/" ) - 1 )
  2410. 	strDeviceType  = Mid( strDeviceType, InStrRev( strDeviceType, "/" ) + 1 )
  2411. 	strMsg         = "<h2>\\" & gvsComputer & " " & "DxDiag " & strDeviceType & " data</h2>" & vbCrLf & vbCrLf
  2412. 	On Error Resume Next ' REQUIRED
  2413. 	Set xmlDoc = CreateObject( "Microsoft.XMLDOM" )
  2414. 	xmlDoc.Async = "False"
  2415. 	xmlDoc.Load gvaSettingsStr.Item( "XML" )
  2416. 	Set colNodes = xmlDoc.selectNodes( myQuery )
  2417. 	Select Case colNodes.length
  2418. 		Case 0
  2419. 			strMsg = strMsg & "<p>No instances.</p>"
  2420. 		Case 1
  2421. 			strMsg = strMsg & "<p>1 instance:</p>"
  2422. 		Case Else
  2423. 			strMsg = strMsg & "<p>" & colNodes.length & " instances:</p>"
  2424. 	End Select
  2425. 	strMsg = strMsg & vbCrLf & vbCrLf & "<pre>"
  2426. 	For i = 0 To colNodes.length - 1
  2427. 		strQuery2 = myQuery & "[" & i & "]"
  2428. 		Set colNodes2 = xmlDoc.selectNodes( strQuery2 )
  2429. 		For Each objNode2 in colNodes2
  2430. 			strMsg = strMsg & objNode2.nodeName & " #" & i & " : " & objNode2.text & vbCrLf
  2431. 		Next
  2432. 		strMsg = strMsg & vbCrLf & vbCrLf
  2433. 	Next
  2434. 	strMsg = strMsg & "</pre>" & vbCrLf
  2435. 	Set colNodes2 = Nothing
  2436. 	Set colNodes  = Nothing
  2437. 	Set xmlDoc    = Nothing
  2438. 	On Error Goto 0
  2439. 	HandleXMLValue = strMsg
  2440. End Function
  2441.  
  2442.  
  2443. Sub Initialize( )
  2444. 	Dim i, j, k, objRE
  2445. 	' Read PATH
  2446. 	gvsPATH = Trim( gvoWSHShell.ExpandEnvironmentStrings( "%PATH%" ) )
  2447. 	' Remove empty PATH entries
  2448. 	Set objRE = New RegExp
  2449. 	objRE.Pattern = ";\s+"
  2450. 	gvsPATH = Trim( objRE.Replace( gvsPATH, ";" ) )
  2451. 	objRE.Pattern = ";{2,}"
  2452. 	gvsPATH = Trim( objRE.Replace( gvsPATH, ";" ) )
  2453. 	objRE.Pattern = "(^;|;$)"
  2454. 	gvsPATH = Trim( objRE.Replace( gvsPATH, "" ) )
  2455. 	Set objRE = Nothing
  2456. 	' Split PATH into array of entries
  2457. 	gvaPATH = Split( gvsPATH, ";" )
  2458. 	k = UBound( gvaPATH )
  2459. 	' Trim PATH entries
  2460. 	For i = UBound( gvaPATH ) To 0 Step -1
  2461. 		gvaPATH(i) = Trim( gvaPATH(i) )
  2462. 		' Remove empty PATH entries
  2463. 		If gvaPATH(i) = "" Then
  2464. 			For j = i To k - 1
  2465. 				gvaPATH(j) = gvaPATH(j+1)
  2466. 			Next
  2467. 			k = k - 1
  2468. 		End If
  2469. 	Next
  2470. 	' Resize PATH array to account for removed entries
  2471. 	If k < UBound( gvaPATH ) Then
  2472. 		ReDim Preserve gvaPATH(k)
  2473. 	End If
  2474. 	' Check if in WinPE
  2475. 	gvbWinPE = CheckWinPE( )
  2476. 	If gvbWinPE Then DebugMessage "", "Running in WinPE"
  2477. 	' Reset counters
  2478. 	gvcBanks     = 0
  2479. 	gvcCPU       = 0
  2480. 	gvcMemory    = 0
  2481. 	gviMemSize   = 0
  2482. 	gviMemSpeed  = 0
  2483. 	gviNumOS     = 0
  2484. 	gviMinHeight = Min( 600, window.screen.height )
  2485. 	gviMinWidth  = Min( 800, window.screen.width  )
  2486. 	' Color changes on WMI connection errors
  2487. 	clrBgErr  = "Red"
  2488. 	clrTxtErr = "White"
  2489. 	' This HTA's command line
  2490. 	gvsCommandline   = Hardware.CommandLine
  2491. 	gvsCommandlineUC = UCase( gvsCommandline )
  2492. 	' Create a list of all interface colors available, and fill the theme settings dropdowns with them
  2493. 	ListCSSColors
  2494. 	ListColors "BackgroundColor",     "blue"
  2495. 	ListColors "CaptionsColor",       "white"
  2496. 	ListColors "LinksColor",          "red"
  2497. 	ListColors "ButtonFaceColor",     "silver"
  2498. 	ListColors "ButtonCaptionsColor", "blacl"
  2499. 	ListColors "CodeColor",           "yellow"
  2500. 	' Dictionary objects for global settings
  2501. 	Set gvaDefaultsBool = CreateObject( "Scripting.Dictionary" )
  2502. 	Set gvaDefaultsStr  = CreateObject( "Scripting.Dictionary" )
  2503. 	Set gvaSettingsBool = CreateObject( "Scripting.Dictionary" )
  2504. 	Set gvaSettingsStr  = CreateObject( "Scripting.Dictionary" )
  2505. 	' Read and set defaults
  2506. 	ConfigReadDefaults
  2507. 	' Paths of helper files
  2508. 	gvsConfigFile    = Left( Self.location.pathname, Len( Self.location.pathname ) - 4 ) & ".cfg"
  2509. 	gvsDetailsFile   = gvoFSO.BuildPath( gvaSettingsStr.Item( "TEMPDIR" ), "~hardware~details.html" )
  2510. 	gvsPrintFile     = gvoFSO.BuildPath( gvaSettingsStr.Item( "TEMPDIR" ), "~hardware~print~preview.html" )
  2511. 	gvsDebugText     = ""
  2512. End Sub
  2513.  
  2514.  
  2515. Sub Inventory( )
  2516. 	Dim blnSuccess, colItems, i, objItem, objWMIService
  2517.  
  2518. 	'ComputerName.value = gvsComputer
  2519. 	gvsComputer = UCase( Trim( ComputerName.value ) )
  2520.  
  2521. 	If ComputerName.value <> UCase( gvsComputer ) Then
  2522. 		If gvsComputer <> "" Then
  2523. 			DebugMessage "", "Changing computer name from " & gvsComputer & " to " & Trim( ComputerName.value )
  2524. 		End If
  2525. 	End If
  2526.  
  2527. 	ComputerName.style.backgroundColor = "White"
  2528. 	ComputerName.style.color           = "Black"
  2529. 	ComputerName.disabled              = True
  2530.  
  2531. 	gvbIsLocalComputer = IsLocalComputer( )
  2532.  
  2533.     If ButtonRun.value = "Reset" Then
  2534.     	Reset
  2535.     Else
  2536. 	    ButtonRun.value            = "Reset"
  2537. 	    ButtonRun.accessKey        = "r"
  2538. 	    ButtonRun.title            = "Click here to clear all fields"
  2539. 	    ButtonRun.disabled         = True
  2540. 		CheckboxBIOS.disabled      = True
  2541. 		CheckboxCDROM.disabled     = True
  2542. 		CheckboxCPU.disabled       = True
  2543. 		CheckboxFDD.disabled       = True
  2544. 		CheckboxHDD.disabled       = True
  2545. 		CheckboxKeyboard.disabled  = True
  2546. 		CheckboxMouse.disabled     = True
  2547. 		CheckboxMainBoard.disabled = True
  2548. 		CheckboxMemory.disabled    = True
  2549. 		CheckboxMonitor.disabled   = True
  2550. 		CheckboxNIC.disabled       = True
  2551. 		CheckboxPorts.disabled     = True
  2552. 		CheckboxSound.disabled     = True
  2553. 		CheckboxVideo.disabled     = True
  2554. 		ButtonBasic.disabled       = True
  2555. 		ButtonPaste.disabled       = True
  2556. 		ButtonPrint.disabled       = True
  2557. 		ComputerName.disabled      = True
  2558.  
  2559. 		If Not CheckboxBIOS.Checked Then
  2560. 			BIOSHeader.style.display = "none"
  2561. 			BIOSRow.style.display    = "none"
  2562. 			BIOSFooter.style.display = "none"
  2563. 		End If
  2564. 		If Not CheckboxCDROM.Checked Then
  2565. 			CDROMHeader.style.display = "none"
  2566. 			CDROM0.style.display      = "none"
  2567. 			CDROMFooter.style.display = "none"
  2568. 		End If
  2569. 		If Not CheckboxCPU.Checked Then
  2570. 			CPUHeader.style.display = "none"
  2571. 			CPURow.style.display    = "none"
  2572. 			CPUFooter.style.display = "none"
  2573. 		End If
  2574. 		If Not CheckboxFDD.Checked Then
  2575. 			FDDHeader.style.display = "none"
  2576. 			FDD0.style.display      = "none"
  2577. 			FDDFooter.style.display = "none"
  2578. 		End If
  2579. 		If Not CheckboxHDD.Checked Then
  2580. 			HardDiskHeader.style.display = "none"
  2581. 			HardDisk0.style.display      = "none"
  2582. 			HardDiskFooter.style.display = "none"
  2583. 		End If
  2584. 		If Not CheckboxKeyboard.Checked Then
  2585. 			KeyboardHeader.style.display = "none"
  2586. 			KeyboardRow.style.display    = "none"
  2587. 			KeyboardFooter.style.display = "none"
  2588. 		End If
  2589. 		If Not CheckboxMainBoard.Checked Then
  2590. 			MainBoardHeader.style.display = "none"
  2591. 			MainBoardRow.style.display    = "none"
  2592. 			MainBoardFooter.style.display = "none"
  2593. 		End If
  2594. 		If Not CheckboxMemory.Checked Then
  2595. 			MemHeader.style.display = "none"
  2596. 			MemRow.style.display    = "none"
  2597. 			MemFooter.style.display = "none"
  2598. 		End If
  2599. 		If Not CheckboxMonitor.Checked Then
  2600. 			MonitorHeader.style.display = "none"
  2601. 			Monitor0.style.display      = "none"
  2602. 			MonitorFooter.style.display = "none"
  2603. 		End If
  2604. 		If Not CheckboxMouse.Checked Then
  2605. 			MouseHeader.style.display = "none"
  2606. 			MouseRow.style.display    = "none"
  2607. 			MouseFooter.style.display = "none"
  2608. 		End If
  2609. 		If Not CheckboxNIC.Checked Then
  2610. 			NICHeader.style.display = "none"
  2611. 			NIC0.style.display      = "none"
  2612. 			NICFooter.style.display = "none"
  2613. 		End If
  2614. 		If Not CheckboxPorts.Checked Then
  2615. 			PortsHeader.style.display = "none"
  2616. 			PortsRow.style.display    = "none"
  2617. 			PortsFooter.style.display = "none"
  2618. 		End If
  2619. 		If Not CheckboxSound.Checked Then
  2620. 			SoundHeader.style.display = "none"
  2621. 			SoundRow.style.display    = "none"
  2622. 			SoundFooter.style.display = "none"
  2623. 		End If
  2624. 		If Not CheckboxVideo.Checked Then
  2625. 			VideoHeader.style.display = "none"
  2626. 			Video0.style.display      = "none"
  2627. 			VideoFooter.style.display = "none"
  2628. 		End If
  2629.  
  2630. 		DebugMessage "", "Starting inventory"
  2631.  
  2632. 		On Error Resume Next ' REQUIRED
  2633.  
  2634. 		If gvbWinPE Then
  2635. 			gvsComputer        = UCase( InputBox( "Please enter the computer name", "Computer Name", gvsComputer ) )
  2636. 			ComputerName.value = gvsComputer
  2637. 			Set gvoWMIrootCimv2         = GetObject( "winmgmts://./root/CIMV2" )
  2638. 			Set gvoWMIrootMSWinStorage  = GetObject( "winmgmts://./root/Microsoft/Windows/Storage" )
  2639. 			Set gvoWMIrootStandardCimv2 = GetObject( "winmgmts://./root/StandardCimv2" )
  2640. 			Set gvoWMIrootWMI           = GetObject( "winmgmts://./root/WMI" )
  2641. 		Else
  2642. 			gvsComputer = ComputerName.value
  2643. 			If gvsComputer = "" Or gvsComputer = "." Then
  2644. 				gvsComputer        = GetLocalComputerName( )
  2645. 				ComputerName.value = gvsComputer
  2646. 			End If
  2647. 			Sleep 1
  2648. 			Set colItems = gvoWMIlocalCimv2.ExecQuery( "SELECT StatusCode FROM Win32_PingStatus WHERE Address='" & gvsComputer & "'" )
  2649. 			For Each objItem In colItems
  2650. 				If IsNull( objItem.StatusCode ) Or objItem.StatusCode <> 0 Then
  2651. 					On Error GoTo 0
  2652. 					MsgBox "Error while trying to ping computer " & gvsComputer, vbOKOnly, "Connection Error"
  2653. 					Reset
  2654. 					Exit Sub
  2655. 				End If
  2656. 			Next
  2657. 			Set gvoWMIrootCimv2 = GetObject( "winmgmts://" & gvsComputer & "/root/CIMV2" )
  2658. 			If Err Then
  2659. 				MsgBox "Error " & Err.Number & " while trying to get access to " & gvsComputer & ": " & Err.Description, vbOKOnly, "Remote WMI Error"
  2660. 				On Error GoTo 0
  2661. 				Reset
  2662. 				Exit Sub
  2663. 			End If
  2664. 			Set gvoWMIrootMSWinStorage  = GetObject( "winmgmts://" & gvsComputer & "/root/Microsoft/Windows/Storage" )
  2665. 			Set gvoWMIrootStandardCimv2 = GetObject( "winmgmts://" & gvsComputer & "/root/StandardCimv2" )
  2666. 			Set gvoWMIrootWMI           = GetObject( "winmgmts://" & gvsComputer & "/root/WMI" )
  2667. 		End If
  2668.  
  2669. 		' Diable WinSAT for Windows XP and older
  2670. 		If CInt( Left( CStr( gviNumOS ), 1 ) ) < 6 Then gvaDefaultsBool.Item( "NOSCORES"  ) = True
  2671. 		EnableWinSATScores
  2672.  
  2673. 		On Error Goto 0
  2674.  
  2675. 		gvsHeader = "Computer:" & vbTab & "WinPE"
  2676. 		gvsCSVTxt = gvsComputer & vbTab & CStr( gvbWinPE )
  2677.  
  2678.  
  2679. 		InventoryWinSATScores
  2680. 		InventoryCPU
  2681. 		InventoryMemory
  2682. 		InventoryFDD
  2683. 		InventoryHDD
  2684. 		InventoryCDROM
  2685. 		InventoryVideo
  2686. 		InventoryMonitor
  2687. 		InventorySound
  2688. 		InventoryNIC
  2689. 		InventoryMainBoard
  2690. 		InventoryKeyboard
  2691. 		InventoryMouse
  2692. 		InventoryPorts
  2693. 		InventoryBIOS
  2694.  
  2695. 		If CheckboxVideo.Checked Then
  2696. 			If gvaSettingsBool.Item( "DXDIAG" ) Then
  2697. 				blnSuccess = InventoryDirectX( )
  2698. 				If Not blnSuccess Then MsgBox "There was an error reading the DirectX data:" & vbCrLf & "Unable to load """ & gvaSettingsStr.Item( "XML" ) & """", vbOKOnly, "XML error"
  2699. 			End If
  2700. 			Add2CsvVideo
  2701. 		End If
  2702.  
  2703. 		If gvaSettingsBool.Item( "DEVTEST" ) Then
  2704. 			ComputerName.value = "MYPC"
  2705. 			InputDxDiag.value  = "C:\Scripts\Hardware.xml"
  2706. 		Else
  2707. 			ComputerName.value = gvsComputer
  2708. 		End If
  2709.  
  2710. 		' Write the inventory data to the hidden area named "PrintScreen".
  2711. 		' This allows printing with Ctrl+P instead of the Print button.
  2712. 		PrintScreen.innerHTML = PrintTable( )
  2713.  
  2714. 		Set colItems = document.getElementsByTagName( "input" )
  2715. 		For Each objItem In colItems
  2716. 			If objItem.type = "text" Then
  2717. 				objItem.title = objItem.value
  2718. 			End If
  2719. 		Next
  2720. 		Set colItems = Nothing
  2721.  
  2722. 		ButtonCopy.disabled  = False
  2723. 		ButtonPrint.disabled = False
  2724. 		ButtonSave.disabled  = False
  2725. 		ButtonRun.disabled   = False
  2726. 		ButtonSave.Focus( )
  2727. 	End If
  2728.  
  2729. 	DebugMessage "", "End of inventory"
  2730. End Sub
  2731.  
  2732.  
  2733. Sub InventoryBIOS( )
  2734. 	Dim colItems, objItem, objMatches, objRE
  2735. 	Dim strBIOSDate, strBIOSVersion
  2736.  
  2737. 	On Error Resume Next ' REQUIRED
  2738.  
  2739. 	If CheckBoxBIOS.Checked Then
  2740. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_BIOS WHERE PrimaryBIOS = True" )
  2741. 		If Not Err Then
  2742. 			For Each objItem In colItems
  2743. 				strBIOSVersion = objItem.SMBIOSBIOSVersion
  2744. 				strBIOSDate    = Mid( objItem.ReleaseDate, 5, 2 ) & "/" & Mid( objItem.ReleaseDate, 7, 2 ) & "/" & Left( objItem.ReleaseDate, 4 )
  2745. 				gvsBIOSSerial  = objItem.SerialNumber
  2746. 				If InStr( strBIOSVersion, ":" ) Then ' Convert 01:23:00 to 1.23.00
  2747. 					Set objRE = New RegExp
  2748. 					objRE.Pattern = "^\d+(:\d+)+$"
  2749. 					If objRE.Test( strBIOSVersion ) Then
  2750. 						strBIOSVersion = Replace( strBIOSVersion, ":", "." )
  2751. 						If Len( strBIOSVersion ) > 3 Then
  2752. 							If Left( strBIOSVersion, 1 ) = "0" And Not Left( strBIOSVersion, 2 ) = "0." Then
  2753. 								strBIOSVersion = Mid( strBIOSVersion, 2 )
  2754. 							End If
  2755. 						End If
  2756. 					End If
  2757. 				End If
  2758. 				If gvaSettingsBool.Item( "DEVTEST" ) Then strBIOSVersion = gvoRandom.Next_2( 1, 9 ) & "." & gvoRandom.Next_2( 0, 9 ) & gvoRandom.Next_2( 0, 9 )
  2759. 				BIOSManufacturer.value = objItem.Manufacturer
  2760. 				BIOSModel.value        = objItem.Name
  2761. 				BIOSVersion.value      = strBIOSVersion
  2762. 				BIOSDate.value         = strBIOSDate
  2763.  
  2764. 				ButtonDetailsBIOS.disabled = False
  2765. 			Next
  2766. 		End If
  2767.  
  2768. 		DebugMessage "", "BIOS inventory succeeded: " & CStr( Not ButtonDetailsBIOS.disabled )
  2769.  
  2770. 		Add2CsvBIOS
  2771. 	End If
  2772.  
  2773. 	On Error Goto 0
  2774. End Sub
  2775.  
  2776.  
  2777. Sub InventoryCDROM( )
  2778. 	Dim arrDeviceID, arrHardwareID, arrFirmware
  2779. 	Dim i, intIndex, intRow
  2780. 	Dim colItems, objCDROMFirmwares, objCDROMInterfaces, objCDROMModels, objCell, objItem, objTable, objTableRow
  2781. 	Dim strDeviceID, strDriveLetter, strElement, strFirmware, strInterface
  2782.  
  2783. 	If CheckboxCDROM.Checked Then
  2784. 		On Error Resume Next ' REQUIRED
  2785. 		' Find all CDROM drives without the word "virtual" in their name
  2786. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_CDROMDrive WHERE NOT Name LIKE '%Virtual%'" )
  2787. 		If Err Or IsNull( colItems ) Or colItems.Count = 0 Then
  2788. 			On Error Goto 0
  2789. 			If gvbWinPE And gvsWinDrive <> "" Then InventoryCDROMWinPE
  2790. 		Else
  2791. 			Set objCDROMFirmwares  = CreateObject( "System.Collections.Sortedlist" )
  2792. 			Set objCDROMInterfaces = CreateObject( "System.Collections.Sortedlist" )
  2793. 			Set objCDROMModels     = CreateObject( "System.Collections.Sortedlist" )
  2794. 			For Each objItem In colItems
  2795. 				' Use drive letter without colon as key for CDROM SortedLists
  2796. 				strDriveLetter = Left( objItem.Drive, 1 )
  2797. 				' Parse the PNP Device ID string to get the interface and firmware revision
  2798. 				' Example:
  2799. 				' IDE\CDROM_NEC_DVD_RW_ND-3520AW___________________3.05____\5&2E27B08F&0&0.0.0
  2800. 				' ===  <-  interface                               ====  <-  firmware revision
  2801. 				' The array arrDeviceID will contain 3 elements: "IDE",
  2802. 				' "CDROM_NEC_DVD_RW_ND-3520AW___________________3.05____" and "5&2E27B08F&0&0.0.0"
  2803. 				If InStr( objItem.DeviceID, "\" ) Then
  2804. 					arrDeviceID  = Split( Replace( objItem.DeviceID, "&amp;", "&" ), "\", 3, vbTextCompare )
  2805. 					strInterface = arrDeviceID(0)
  2806. 					strDeviceID  = arrDeviceID(1)
  2807. 					' In our example, strDeviceID will contain "CDROM_NEC_DVD_RW_ND-3520AW___________________3.05____"
  2808. 					' The array arrFirmware will contain the elements "CDROM", "NEC", "DVD", "RW", "ND-3520AW", "3.05" and ""
  2809. 					' strFirmware is assigned the value of the last non-empty element in the array
  2810. 					If InStr( strDeviceID, "_" ) Then
  2811. 						arrFirmware  = Split( strDeviceID, "_", -1, vbTextCompare )
  2812. 						If Left( strInterface, 3 ) = "USB" Then strInterface = "USB"
  2813. 						For Each strElement In arrFirmware
  2814. 							If CStr( strElement ) <> "" Then strFirmware = strElement
  2815. 						Next
  2816. 					End If
  2817. 					If gvaSettingsBool.Item( "DEVTEST" ) Then strFirmware = gvoRandom.Next_2( 1, 9 ) & "." & gvoRandom.Next_2( 0, 9 ) & gvoRandom.Next_2( 0, 9 )
  2818. 					objCDROMModels.Item( strDriveLetter )     = objItem.Name
  2819. 					objCDROMInterfaces.Item( strDriveLetter ) = strInterface
  2820. 					objCDROMFirmwares.Item( strDriveLetter )  = strFirmware
  2821. 				End If
  2822. 			Next
  2823.  
  2824.  
  2825. 			Set objTable = document.getElementById( "Results" )
  2826. 			intRow = document.getElementById( "CDROM0" ).rowIndex
  2827. 			CDROM0Index.value     = objCDROMModels.GetKey( 0 ) & ":"
  2828. 			CDROM0Model.value     = objCDROMModels.GetByIndex( 0 )
  2829. 			CDROM0Firmware.value  = objCDROMFirmwares.GetByIndex( 0 )
  2830. 			CDROM0Interface.value = objCDROMInterfaces.GetByIndex( 0 )
  2831.  
  2832. 			If objCDROMModels.Count > 1 Then
  2833. 				document.getElementById( "MultipleCDROMs" ).style.display = "inline"
  2834. 				For i = 1 To objCDROMModels.Count - 1
  2835. 					Set objTableRow   = objTable.insertRow( intRow + i )
  2836. 					objTableRow.id    = "CDROM" & i
  2837.  
  2838. 					Set objCell       = objTableRow.insertCell( 0 )
  2839. 					objCell.innerHTML = "&nbsp;"
  2840.  
  2841. 					Set objCell       = objTableRow.insertCell( 1 )
  2842. 					objCell.innerHTML = "&nbsp;"
  2843.  
  2844. 					Set objCell       = objTableRow.insertCell( 2 )
  2845. 					objCell.innerHTML = "&nbsp;"
  2846.  
  2847. 					Set objCell       = objTableRow.insertCell( 3 )
  2848. 					objCell.innerHTML = "&nbsp;"
  2849.  
  2850. 					Set objCell       = objTableRow.insertCell( 4 )
  2851. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Index"" size=""12"" value=""" & objCDROMModels.GetKey( i ) & ":"" readonly />"
  2852.  
  2853. 					Set objCell       = objTableRow.insertCell( 5 )
  2854. 					objCell.innerHTML = "&nbsp;"
  2855.  
  2856. 					Set objCell       = objTableRow.insertCell( 6 )
  2857. 					objCell.setAttribute "colSpan", 3
  2858. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Model"" size=""40"" value=""" & objCDROMModels.GetByIndex( i ) & """ readonly />"
  2859.  
  2860. 					Set objCell       = objTableRow.insertCell( 7 )
  2861. 					objCell.innerHTML = "&nbsp;"
  2862.  
  2863. 					Set objCell       = objTableRow.insertCell( 8 )
  2864. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Firmware"" size=""16"" value=""" & objCDROMFirmwares.GetByIndex( i ) & """ readonly />"
  2865.  
  2866. 					Set objCell       = objTableRow.insertCell( 9 )
  2867. 					objCell.innerHTML = "&nbsp;"
  2868.  
  2869. 					Set objCell       = objTableRow.insertCell( 10 )
  2870. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Interface"" size=""16"" value=""" & objCDROMInterfaces.GetByIndex( i ) & """ readonly />"
  2871.  
  2872. 					Set objCell      = Nothing
  2873. 					Set objTableRow  = Nothing
  2874. 				Next
  2875. 			End If
  2876.  
  2877. 			ButtonDetailsCDROM.disabled = ( objCDROMModels.Count = 0 )
  2878.  
  2879. 			DebugMessage "", "CDROM inventory succeeded: " & CStr( Not ButtonDetailsCDROM.disabled )
  2880.  
  2881. 			Set objTable           = Nothing
  2882. 			Set objCDROMModels     = Nothing
  2883. 			Set objCDROMFirmwares  = Nothing
  2884. 			Set objCDROMInterfaces = Nothing
  2885.  
  2886. 			On Error Goto 0
  2887.  
  2888. 			Add2CsvCDROM
  2889. 		End If
  2890. 	End If
  2891. End Sub
  2892.  
  2893.  
  2894. Sub InventoryCDROMWinPE( )
  2895. 	Dim arrHardwareID, arrRegKeys, arrSubKeys, arrTest
  2896. 	Dim dicDescriptions, dicFirmware, dicHardwareIDs, dicInterfaces
  2897. 	Dim colItems, objItem, objRE, objReg
  2898. 	Dim i, intIndex, j
  2899. 	Dim strDescription, strDictKey, strRegKey, strRegSubKey, strWMIQuery
  2900.  
  2901. 	Set dicDescriptions = CreateObject( "Scripting.Dictionary" )
  2902. 	Set dicFirmware     = CreateObject( "Scripting.Dictionary" )
  2903. 	Set dicHardwareIDs  = CreateObject( "Scripting.Dictionary" )
  2904. 	Set dicInterfaces   = CreateObject( "Scripting.Dictionary" )
  2905. 	Set objRE           = New RegExp
  2906.  
  2907. 	' Mount registry hive from Windows Drive
  2908. 	gvoWSHShell.Run "CMD.EXE /C REG.EXE Load HKLM\TempHive " & gvsWinDrive & "\windows\system32\config\system", 0, True
  2909.  
  2910. 	' Scan the temporary registry hive for IDE CDROM devices
  2911. 	strWMIQuery = "winmgmts:{impersonationLevel=impersonate}!//./root/default:StdRegProv"
  2912. 	Set objReg = GetObject( strWMIQuery )
  2913. 	objReg.EnumKey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\IDE", arrRegKeys
  2914. 	If Not IsNull( arrRegKeys ) Then
  2915. 		For i = 0 To UBound( arrRegKeys )
  2916. 			strRegKey = arrRegKeys(i)
  2917. 			If Left( UCase( strRegKey ), 5 ) = "CDROM" Then
  2918. 				objReg.EnumKey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\IDE\" & strRegKey, arrSubKeys
  2919. 				For Each strRegSubKey In arrSubKeys
  2920. 					objReg.GetMultiStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\IDE\" & strRegKey & "\" & strRegSubKey, "HardwareID", arrHardwareID
  2921. 					If Not IsNull( arrHardwareID ) Then
  2922. 						If InStr( UCase( arrHardwareID(0) ), "VIRTUAL" ) = 0 Then
  2923. 							If Left( UCase( arrHardwareID(0) ), 4 ) = "IDE\"  Then arrHardwareID(0) = Mid( arrHardwareID(0), 5 )
  2924. 							If Left( UCase( arrHardwareID(0) ), 5 ) = "CDROM" Then arrHardwareID(0) = Mid( arrHardwareID(0), 6 )
  2925. 							objReg.GetStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\IDE\" & strRegKey & "\" & strRegSubKey, "FriendlyName", strDescription
  2926. 							strDictKey = objRE.Replace( arrHardwareID(0), "" )
  2927. 							dicHardwareIDs.Item( strDictKey )  = arrHardwareID(0)
  2928. 							dicDescriptions.Item( strDictKey ) = strDescription
  2929. 							dicInterfaces.Item( strDictKey )   = "IDE"
  2930. 							arrTest = Split( arrHardwareID(0), "_" )
  2931. 							For j = 0 To UBound( arrTest )
  2932. 								If Not arrTest(i) = "" Then
  2933. 									dicFirmware.Item( strDictKey ) = arrTest(j)
  2934. 								End If
  2935. 							Next
  2936. 						End If
  2937. 						arrHardwareID = Null
  2938. 					End If
  2939. 				Next
  2940. 				arrSubKeys = Null
  2941. 			End If
  2942. 		Next
  2943. 		arrRegKeys = Null
  2944. 	End If
  2945.  
  2946. 	' Scan the temporary registry hive for SCSI CDROM devices
  2947. 	objReg.EnumKey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\SCSI", arrRegKeys
  2948. 	If Not IsNull( arrRegKeys ) Then
  2949. 		For Each strRegKey In arrRegKeys
  2950. 			If Left( UCase( strRegKey ), 5 ) = "CDROM" Then
  2951. 				objReg.EnumKey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\SCSI\" & strRegKey, arrSubKeys
  2952. 				For Each strRegSubKey In arrSubKeys
  2953. 					objReg.GetMultiStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\SCSI\" & strRegKey & "\" & strRegSubKey, "HardwareID", arrHardwareID
  2954. 					If Not IsNull( arrHardwareID ) Then
  2955. 						If InStr( UCase( arrHardwareID(0) ), "VIRTUAL" ) = 0 Then
  2956. 							If Left( UCase( arrHardwareID(0) ), 5 ) = "SCSI\" Then arrHardwareID(0) = Mid( arrHardwareID(0), 6 )
  2957. 							If Left( UCase( arrHardwareID(0) ), 5 ) = "CDROM" Then arrHardwareID(0) = Mid( arrHardwareID(0), 6 )
  2958. 							objReg.GetStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\SCSI\" & strRegKey & "\" & strRegSubKey, "FriendlyName", strDescription
  2959. 							strDictKey = objRE.Replace( arrHardwareID(0), "" )
  2960. 							dicHardwareIDs.Item( strDictKey )  = arrHardwareID(0)
  2961. 							dicDescriptions.Item( strDictKey ) = strDescription
  2962. 							dicInterfaces.Item( strDictKey )   = "SCSI"
  2963. 							arrTest = Split( arrHardwareID(0), "_" )
  2964. 							For i = 0 To UBound( arrTest )
  2965. 								If Not arrTest(i) = "" Then
  2966. 									dicFirmware.Item( strDictKey ) = arrTest(i)
  2967. 								End If
  2968. 							Next
  2969. 						End If
  2970. 						arrHardwareID = Null
  2971. 					End If
  2972. 				Next
  2973. 				arrSubKeys = Null
  2974. 			End If
  2975. 		Next
  2976. 		arrRegKeys = Null
  2977. 	End If
  2978.  
  2979. 	' Show the results
  2980. 	If dicHardwareIDs.Count > 0 Then
  2981. 		CDROM0Index.value     = dicDescriptions.Keys(0)
  2982. 		CDROM0Model.value     = dicDescriptions(0)
  2983. 		CDROM0Firmware.value  = dicFirmware(0)
  2984. 		CDROM0Interface.value = dicInterfaces(0)
  2985.  
  2986. 		If objCDROMModels.Count > 1 Then
  2987. 			MultipleCDROMs.style.display = "inline"
  2988. 			Set objTable = document.getElementById( "Results" )
  2989. 			intRow = document.getElementById( "CDROM0" ).rowIndex
  2990. 			For i = 1 To objCDROMModels.Count - 1
  2991. 				Set objTableRow   = objTable.insertRow( intRow + i )
  2992. 				objTableRow.id    = "CDROM" & i
  2993. 				Set objCell       = objTableRow.insertCell( 0 )
  2994. 				objCell.innerHTML = "&nbsp;"
  2995. 				Set objCell       = objTableRow.insertCell( 1 )
  2996. 				objCell.innerHTML = "&nbsp;"
  2997. 				Set objCell       = objTableRow.insertCell( 2 )
  2998. 				objCell.innerHTML = "&nbsp;"
  2999. 				Set objCell       = objTableRow.insertCell( 3 )
  3000. 				objCell.innerHTML = "&nbsp;"
  3001. 				Set objCell       = objTableRow.insertCell( 4 )
  3002. 				objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Index"" size=""12"" value=""" & dicDescriptions.Keys(i) & ":"" readonly />"
  3003. 				Set objCell       = objTableRow.insertCell( 5 )
  3004. 				objCell.innerHTML = "&nbsp;"
  3005. 				Set objCell       = objTableRow.insertCell( 6 )
  3006. 				objcell.setAttribute "colSpan", 3
  3007. 				objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Model"" size=""40"" value=""" & dicDescriptions(i) & """ readonly />"
  3008. 				Set objCell       = objTableRow.insertCell( 7 )
  3009. 				objCell.innerHTML = "&nbsp;"
  3010. 				Set objCell       = objTableRow.insertCell( 8 )
  3011. 				objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Firmware"" size=""16"" value=""" & dicFirmware(i) & """ readonly />"
  3012. 				Set objCell       = objTableRow.insertCell( 9 )
  3013. 				objCell.innerHTML = "&nbsp;"
  3014. 				Set objCell       = objTableRow.insertCell( 10 )
  3015. 				objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Interface"" size=""16"" value=""" & dicInterfaces(i) & """ readonly />"
  3016. 				Set objCell      = Nothing
  3017. 				Set objTableRow  = Nothing
  3018. 			Next
  3019. 			Set objTable = Nothing
  3020. 		End If
  3021. 	End If
  3022.  
  3023. 	DebugMessage "", "CDROM inventory succeeded: " & CStr( Not ButtonDetailsCDROM.disabled )
  3024.  
  3025. 	' Unmount temporary registry hive
  3026. 	gvoWSHShell.Run "CMD.EXE /C REG.EXE Unload HKLM\TempHive", 0, True
  3027. 	Set dicDescriptions = Nothing
  3028. 	Set dicFirmware     = Nothing
  3029. 	Set dicHardwareIDs  = Nothing
  3030. 	Set dicInterfaces   = Nothing
  3031. 	Set objRE           = Nothing
  3032.  
  3033. 	Add2CsvCDROM
  3034. End Sub
  3035.  
  3036.  
  3037. Sub InventoryCPU( )
  3038. 	Dim colItems, objItem
  3039.  
  3040. 	If CheckBoxCPU.Checked Then
  3041. 		On Error Resume Next ' REQUIRED
  3042.  
  3043. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_Processor" )
  3044. 		If Not Err Then
  3045. 			gvcCPU = colItems.Count
  3046. 			CPUNumber.value = gvcCPU
  3047. 			If gvcCPU > 1 Then MultipleCPU.InnerHTML  = "s"
  3048. 			For Each objItem In colItems
  3049. 				CPUModel.value  = Trim( objItem.Name )
  3050. 				CPUSpeed.value  = objItem.CurrentClockSpeed
  3051. 				CPUSocket.value = objItem.SocketDesignation
  3052. 			Next
  3053. 			ButtonDetailsCPU.disabled = False
  3054. 		End If
  3055.  
  3056. 		On Error Goto 0
  3057.  
  3058. 		DebugMessage "", "CPU inventory succeeded: " & CStr( Not ButtonDetailsCPU.disabled )
  3059.  
  3060. 		Add2CsvCPU
  3061. 	End If
  3062. End Sub
  3063.  
  3064.  
  3065. Function InventoryDirectX( )
  3066. 	Dim blnLoaded, i
  3067. 	Dim colItems, colNodes, objItem, objNode, xmlDoc
  3068. 	Dim strDxDiag, strQuery, strSysDir
  3069.  
  3070. 	strSysDir = gvoWSHShell.ExpandEnvironmentStrings( "%Windir%\System32" )
  3071. 	strDxDiag = gvoFSO.BuildPath( strSysDir, "DxDiag.exe" )
  3072.  
  3073. 	' Delete old XML file if it exists, unless specified otherwise
  3074. 	If Not gvaSettingsBool.Item( "KEEPXML" ) Then
  3075. 		If gvoFSO.FileExists( gvaSettingsStr.Item( "XML" ) ) Then gvoFSO.DeleteFile gvaSettingsStr.Item( "XML" ), True
  3076. 	End If
  3077.  
  3078. 	' Run DXDIAG.EXE, if required, and save results in XML file
  3079. 	If gvoFSO.FileExists( gvaSettingsStr.Item( "XML" ) ) Then
  3080. 		If Not gvaSettingsBool.Item( "KEEPXML" ) Then
  3081. 			gvoFSO.DeleteFile gvaSettingsStr.Item( "XML" ), True
  3082. 			Sleep 2
  3083. 			gvoWSHShell.Run strDxDiag & " /whql:off /x " & gvaSettingsStr.Item( "XML" ), 7, False
  3084. 		End If
  3085. 	Else
  3086. 		gvoWSHShell.Run strDxDiag & " /whql:off /x " & gvaSettingsStr.Item( "XML" ), 7, False
  3087. 	End If
  3088.  
  3089. 	' Wait until XML file is created, 5 minutes maximum
  3090. 	For i = 1 To 150
  3091. 		Sleep 1
  3092. 		If gvoFSO.FileExists( gvaSettingsStr.Item( "XML" ) ) Then Exit For
  3093. 		Sleep 1
  3094. 	Next
  3095.  
  3096. 	' Wait for DXDIAG to close, 30 seconds maximum
  3097. 	Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_Process WHERE Caption='DxDiag.exe'" )
  3098. 	For i = 1 To 5
  3099. 		If colItems.count = 0 Then Exit For
  3100. 		Sleep 6
  3101. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_Process WHERE Caption='DxDiag.exe'" )
  3102. 	Next
  3103.  
  3104. 	' Open the XML file created by DXDIAG
  3105. 	Set xmlDoc = CreateObject( "Microsoft.XMLDOM" )
  3106. 	xmlDoc.Async = "False"
  3107. 	blnLoaded = xmlDoc.Load( gvaSettingsStr.Item( "XML" ) )
  3108. 	If Not blnLoaded Then
  3109. 		' Retry 5 times maximum, with 6 seconds interval
  3110. 		For i = 1 To 15
  3111. 			Sleep 2
  3112. 			blnLoaded = xmlDoc.Load( gvaSettingsStr.Item( "XML" ) )
  3113. 			If blnLoaded Then Exit For
  3114. 		Next
  3115. 		Sleep 2
  3116. 		MsgBox "Process DxDiag.exe still running", vbOKOnly, "DxDiag error"
  3117. 	End If
  3118.  
  3119. 	If blnLoaded Then
  3120. 		ReDim gvaVideo( 4, 0 )
  3121.  
  3122. 		strQuery = "/DxDiag/DisplayDevices/DisplayDevice/DisplayMemory"
  3123. 		Set colNodes = xmlDoc.selectNodes( strQuery )
  3124. 		i = 0
  3125. 		For Each objNode in colNodes
  3126. 			ReDim Preserve gvaVideo( 4, i )
  3127. 			gvaVideo( 0, i ) = Trim( Replace( objNode.text, "MB", "" ) )
  3128. 			i = i + 1
  3129. 		Next
  3130.  
  3131. 		strQuery = "/DxDiag/DisplayDevices/DisplayDevice/CurrentMode"
  3132. 		Set colNodes = xmlDoc.selectNodes( strQuery )
  3133. 		i = 0
  3134. 		For Each objNode in colNodes
  3135. 			gvaVideo( 1, i ) = Trim( objNode.text )
  3136. 			i = i + 1
  3137. 		Next
  3138.  
  3139. 		strQuery = "/DxDiag/DisplayDevices/DisplayDevice/MonitorName"
  3140. 		Set colNodes = xmlDoc.selectNodes( strQuery )
  3141. 		i = 0
  3142. 		For Each objNode in colNodes
  3143. 			gvaVideo( 2, i ) = Trim( objNode.text )
  3144. 			i = i + 1
  3145. 		Next
  3146.  
  3147. 		strQuery = "/DxDiag/DisplayDevices/DisplayDevice/MonitorModel"
  3148. 		Set colNodes = xmlDoc.selectNodes( strQuery )
  3149. 		i = 0
  3150. 		For Each objNode in colNodes
  3151. 			gvaVideo( 3, i ) = Trim( objNode.text )
  3152. 			i = i + 1
  3153. 		Next
  3154.  
  3155. 		strQuery = "/DxDiag/DisplayDevices/DisplayDevice/CardName"
  3156. 		Set colNodes = xmlDoc.selectNodes( strQuery )
  3157. 		i = 0
  3158. 		For Each objNode in colNodes
  3159. 			gvaVideo( 4, i ) = Trim( objNode.text )
  3160. 			i = i + 1
  3161. 		Next
  3162.  
  3163. 		InventoryDirectX = True
  3164. 	Else
  3165. 		InventoryDirectX = False
  3166. 	End If
  3167.  
  3168. 	' Clean up
  3169. 	Set colNodes = Nothing
  3170. 	Set xmlDoc   = Nothing
  3171.  
  3172. 	DebugMessage "", "DirectX inventory succeeded: " & CStr( InventoryDirectX )
  3173. End Function
  3174.  
  3175.  
  3176. Sub InventoryFDD( )
  3177. 	Dim cntAllFloppy, cntIntFloppy, cntUSBFloppy, i, intRow
  3178. 	Dim colItems, colItems2, objCell, objFDDCapacities, objFDDDescriptions, objFDDInterfaces, objItem, objItem2, objRE, objTable, objTableRow
  3179. 	Dim strDriveLetter, strInterface, strQuery
  3180.  
  3181. 	If CheckboxFDD.Checked Then
  3182. 		On Error Resume Next ' REQUIRED
  3183.  
  3184. 		strInterface = "Unknown"
  3185. 		cntAllFloppy = 0
  3186. 		cntIntFloppy = 0
  3187. 		cntUSBFloppy = 0
  3188.  
  3189. 		' Count total number of floppy disk drives
  3190. 		strQuery = "SELECT * FROM Win32_PnPEntity WHERE PNPClass='FloppyDisk'"
  3191. 		Set colItems = gvoWMIrootCimv2.ExecQuery( strQuery )
  3192. 		If Not Err Then cntAllFloppy = colItems.Count
  3193. 		' Count number of USB-attached floppy disk drives
  3194. 		strQuery = "SELECT * FROM Win32_PnPEntity WHERE PNPDeviceID LIKE 'USBSTOR%FLOPPY%'"
  3195. 		Set colItems = gvoWMIrootCimv2.ExecQuery( strQuery )
  3196. 		If Not Err Then cntUSBFloppy = colItems.Count
  3197. 		' Count number of internal floppy drive connectors
  3198. 		strQuery = "SELECT * FROM Win32_PortConnector"
  3199. 		Set colItems = gvoWMIrootCimv2.ExecQuery( strQuery )
  3200. 		If Not Err Then
  3201. 			For Each objItem In colItems
  3202. 				If objItem.PortType <> Null Then
  3203. 					For i = 0 To Len( objItem.PortType ) - 1
  3204. 						If objItem.PortType(i) = 89 Or objItem.PortType(i) = 91 Then
  3205. 							cntIntFloppy = cntIntFloppy + 1
  3206. 						End If
  3207. 					Next
  3208. 				End If
  3209. 			Next
  3210. 		End If
  3211. 		' Check if all floppy drives have identical interface types; if not, too bad, it is impossible to link a specific floppy drive to a specific interface
  3212. 		If cntAllFloppy = cntUSBFloppy Then
  3213. 			strInterface = "USB"
  3214. 		ElseIf cntUSBFloppy = 0 And cntIntFloppy >= cntAllFloppy Then
  3215. 			strInterface = "Flatcable"
  3216. 		End If
  3217. 		' Find all floppy disk drives
  3218. 		strQuery = "SELECT * FROM Win32_LogicalDisk WHERE DriveType=2 AND MediaType IS NOT NULL AND MediaType != 0 AND MediaType != 11 AND MediaType != 12" 
  3219. 		Set colItems = gvoWMIrootCimv2.ExecQuery( strQuery )
  3220. 		If colItems.Count > 0 And Not Err Then
  3221. 			Set objFDDCapacities   = CreateObject( "System.Collections.Sortedlist" )
  3222. 			Set objFDDDescriptions = CreateObject( "System.Collections.Sortedlist" )
  3223. 			Set objFDDInterfaces   = CreateObject( "System.Collections.Sortedlist" )
  3224. 			Set objRE = New RegExp
  3225. 			For Each objItem In colItems
  3226. 				If Trim( "" & objItem.DeviceId ) <> "" Then
  3227. 					strDriveLetter = Left( objItem.DeviceId, 1 )
  3228. 					'Set colItems2 = objWMIService.ExecQuery( "SELECT * FROM MSFT_Volume WHERE DriveLetter=""" & strDriveLetter & """" )
  3229. 					objRE.Pattern    = "[\d\.]+\s*[MK]B$"
  3230. 					objRE.IgnoreCase = True
  3231. 					If objRE.Test( GetMediaType( objItem.MediaType ) ) Then
  3232. 						objFDDCapacities.Item( strDriveLetter ) = objRE.Execute( GetMediaType( objItem.MediaType ) )(0)
  3233. 					Else
  3234. 						objFDDCapacities.Item( strDriveLetter ) = "Unknown"
  3235. 					End If
  3236. 					objFDDDescriptions.Item( strDriveLetter ) = objItem.Description
  3237. 					objFDDInterfaces.Item( strDriveLetter )   = strInterface
  3238. 				End If
  3239. 			Next
  3240.  
  3241. 			FDD0DeviceID.value    = objFDDDescriptions.GetKey( 0 ) & ":"
  3242. 			FDD0Description.value = objFDDDescriptions.GetByIndex( 0 )
  3243. 			FDD0Capacity.value    = objFDDCapacities.GetByIndex( 0 )
  3244. 			FDD0Interface.value   = objFDDInterfaces.GetByIndex( 0 )
  3245.  
  3246. 			If objFDDDescriptions.Count > 1 Then
  3247. 				document.getElementById( "MultipleFDDs" ).style.display = "inline"
  3248. 				Set objTable = document.getElementById( "Results" )
  3249. 				intRow = document.getElementById( "FDD0" ).rowIndex
  3250. 				For i = 1 To objFDDDescriptions.Count - 1
  3251. 					Set objTableRow   = objTable.insertRow( intRow + i )
  3252. 					objTableRow.id    = "FDD" & i
  3253. 					Set objCell       = objTableRow.insertCell( 0 )
  3254. 					objCell.innerHTML = "&nbsp;"
  3255. 					Set objCell       = objTableRow.insertCell( 1 )
  3256. 					objCell.innerHTML = "&nbsp;"
  3257. 					Set objCell       = objTableRow.insertCell( 2 )
  3258. 					objCell.innerHTML = "&nbsp;"
  3259. 					Set objCell       = objTableRow.insertCell( 3 )
  3260. 					objCell.innerHTML = "&nbsp;"
  3261. 					Set objCell       = objTableRow.insertCell( 4 )
  3262. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""FDD" & i & "DeviceID"" size=""12"" value=""" & objFDDDescriptions.GetKey( i ) & ":"" readonly />"
  3263. 					Set objCell       = objTableRow.insertCell( 5 )
  3264. 					objCell.innerHTML = "&nbsp;"
  3265. 					Set objCell       = objTableRow.insertCell( 6 )
  3266. 					objcell.setAttribute "colSpan", 3
  3267. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""FDD" & i & "Description"" size=""40"" value=""" & objFDDDescriptions.GetByIndex( i ) & """ readonly />"
  3268. 					Set objCell       = objTableRow.insertCell( 7 )
  3269. 					objCell.innerHTML = "&nbsp;"
  3270. 					Set objCell       = objTableRow.insertCell( 8 )
  3271. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""FDD" & i & "Capacity"" size=""16"" value=""" & objFDDCapacities.GetByIndex( i ) & """ readonly />"
  3272. 					Set objCell       = objTableRow.insertCell( 9 )
  3273. 					objCell.innerHTML = "&nbsp;"
  3274. 					Set objCell       = objTableRow.insertCell( 10 )
  3275. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""FDD" & i & "Interface"" size=""16"" value=""" & objFDDInterfaces.GetByIndex( i ) & """ readonly />"
  3276. 					Set objCell       = Nothing
  3277. 					Set objTableRow   = Nothing
  3278. 				Next
  3279. 				Set objTable = Nothing
  3280. 			End If
  3281.  
  3282. 			Set objFDDDescriptions = Nothing
  3283. 			Set objFDDInterfaces   = Nothing
  3284.  
  3285. 			ButtonDetailsFDD.disabled = False
  3286. 		End If
  3287.  
  3288. 		On Error GoTo 0
  3289.  
  3290. 		DebugMessage "", "FDD inventory succeeded: " & CStr( Not ButtonDetailsFDD.disabled )
  3291.  
  3292. 		Add2CsvFDD
  3293. 	End If
  3294. End Sub
  3295.  
  3296.  
  3297. Sub InventoryHDD( )
  3298. 	Dim i, intRow
  3299. 	Dim colItems, objCell, objHDDInterfaces, objHDDModels, objHDDSizes, objItem, objTable, objTableRow
  3300. 	Dim strQuery
  3301.  
  3302. 	If CheckboxHDD.Checked Then
  3303. 		On Error Resume Next ' REQUIRED
  3304.  
  3305. 		strQuery = "SELECT * FROM MSFT_PhysicalDisk"
  3306. 		Set colItems = gvoWMIrootMSWinStorage.ExecQuery( strQuery )
  3307. 		If Not Err Then
  3308. 			' Using SortedList instead of array because there may be "gaps" in the list of disk indexes
  3309. 			Set objHDDInterfaces = CreateObject( "System.Collections.Sortedlist" )
  3310. 			Set objHDDModels     = CreateObject( "System.Collections.Sortedlist" )
  3311. 			Set objHDDSizes      = CreateObject( "System.Collections.Sortedlist" )
  3312. 			For Each objItem In colItems
  3313. 				If gvaSettingsBool.Item( "USBSTOR" ) Or Not GetBusType( objItem.BusType ) = "USB" Then
  3314. 					If gvaSettingsBool.Item( "VIRTUAL" ) Or InStr( LCase( objItem.FriendlyName ), "virtual" ) = 0 Then
  3315. 						objHDDModels.Item( CInt( objItem.DeviceID ) )     = objItem.FriendlyName
  3316. 						objHDDSizes.Item( CInt( objItem.DeviceID ) )      = Round( objItem.Size / GB )
  3317. 						objHDDInterfaces.Item( CInt( objItem.DeviceID ) ) = GetBusType( objItem.BusType )
  3318. 					End If
  3319. 				End If
  3320. 			Next
  3321.  
  3322. 			HardDisk0Index.value     = objHDDModels.GetKey( 0 ) & ":"
  3323. 			HardDisk0Model.value     = objHDDModels.GetByIndex( 0 )
  3324. 			HardDisk0Size.value      = objHDDSizes.GetByIndex( 0 )
  3325. 			HardDisk0Interface.value = objHDDInterfaces.GetByIndex( 0 )
  3326. 			ButtonDetailsHDD.disabled = False
  3327.  
  3328. 			If objHDDModels.Count > 1 Then
  3329. 				document.getElementById( "MultipleHDUs" ).style.display = "inline"
  3330. 				Set objTable = document.getElementById( "Results" )
  3331. 				intRow = document.getElementById( "HardDisk0" ).rowIndex
  3332. 				For i = 1 To objHDDModels.Count - 1
  3333. 					Set objTableRow   = objTable.insertRow( intRow + i )
  3334. 					objTableRow.id    = "HardDisk" & i
  3335. 					Set objCell       = objTableRow.insertCell( 0 )
  3336. 					objCell.innerHTML = "&nbsp;"
  3337. 					Set objCell       = objTableRow.insertCell( 1 )
  3338. 					objCell.innerHTML = "&nbsp;"
  3339. 					Set objCell       = objTableRow.insertCell( 2 )
  3340. 					objCell.innerHTML = "&nbsp;"
  3341. 					Set objCell       = objTableRow.insertCell( 3 )
  3342. 					objCell.innerHTML = "&nbsp;"
  3343. 					Set objCell       = objTableRow.insertCell( 4 )
  3344. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""HardDisk" & i & "Index"" size=""12"" value=""" & objHDDModels.GetKey( i ) & """ readonly />"
  3345. 					Set objCell       = objTableRow.insertCell( 5 )
  3346. 					objCell.innerHTML = "&nbsp;"
  3347. 					Set objCell       = objTableRow.insertCell( 6 )
  3348. 					objCell.setAttribute "colSpan", 3
  3349. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""HardDisk" & i & "Model"" size=""40"" value=""" & objHDDModels.GetByIndex( i ) & """ readonly />"
  3350. 					Set objCell       = objTableRow.insertCell( 7 )
  3351. 					objCell.innerHTML = "&nbsp;"
  3352. 					Set objCell       = objTableRow.insertCell( 8 )
  3353. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""HardDisk" & i & "Size"" size=""16"" value=""" & objHDDSizes.GetByIndex( i ) & """ readonly />"
  3354. 					Set objCell       = objTableRow.insertCell( 9 )
  3355. 					objCell.innerHTML = "&nbsp;"
  3356. 					Set objCell       = objTableRow.insertCell( 10 )
  3357. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""HardDisk" & i & "Interface"" size=""16"" value=""" & objHDDInterfaces.GetByIndex( i ) & """ readonly />"
  3358. 					Set objCell       = Nothing
  3359. 					Set objTableRow   = Nothing
  3360. 				Next
  3361. 				Set objTable = Nothing
  3362. 			End If
  3363.  
  3364. 			Set objHDDInterfaces = Nothing
  3365. 			Set objHDDModels     = Nothing
  3366. 			Set objHDDSizes      = Nothing
  3367. 		End If
  3368.  
  3369. 		On Error Goto 0
  3370.  
  3371. 		DebugMessage "", "HDD inventory succeeded: " & CStr( Not ButtonDetailsHDD.disabled )
  3372.  
  3373. 		Add2CsvHDD
  3374. 	End If
  3375. End Sub
  3376.  
  3377.  
  3378. Sub InventoryKeyboard( )
  3379. 	Dim arrConnectorTypes, arrHardwareTypes
  3380. 	Dim blnHideFkeys
  3381. 	Dim intButtons, intConnectorType, intCount, intFkeys, intLEDs
  3382. 	Dim colItems, objItem
  3383. 	Dim strConnectorType, strKbdPNP, strMouseModel, strMouseType
  3384.  
  3385. 	If CheckboxKeyboard.checked Then
  3386. 		' Enumeration of connector and hardware types
  3387. 		arrConnectorTypes = Array( "I8042", "Serial", "USB" )
  3388. 		ReDim Preserve arrDeviceInterfaces( 162 )
  3389. 		arrDeviceInterfaces( 160 ) = "Bus mouse DB-9"
  3390. 		arrDeviceInterfaces( 161 ) = "Bus mouse micro-DIN"
  3391. 		arrDeviceInterfaces( 162 ) = "USB"
  3392.  
  3393. 		On Error Resume Next ' REQUIRED
  3394.  
  3395. 		blnHideFkeys = Not gvbIsElevated
  3396.  
  3397. 		' Check for keyboard details in root/WMI - this may fail on access denied errors when not running with elevated privileges
  3398. 		intCount  = 0
  3399. 		strKbdPNP = ""
  3400. 		Set colItems = gvoWMIrootWMI.ExecQuery( "SELECT * FROM MSKeyboard_PortInformation WHERE Active = True" )
  3401. 		If Not Err Then
  3402. 			intCount = colItems.Count
  3403. 			If intCount > 1 Then
  3404. 				Set colItems = gvoWMIrootWMI.ExecQuery( "SELECT * FROM MSKeyboard_PortInformation WHERE Active = True AND Instancename LIKE 'HID\\%'" )
  3405. 				intCount = colItems.Count
  3406. 				If colItems.Count = 0 Then
  3407. 					Set colItems = gvoWMIrootWMI.ExecQuery( "SELECT * FROM MSKeyboard_PortInformation WHERE Active = True AND Instancename LIKE '%&%'" )
  3408. 				End If
  3409. 			End If
  3410. 			For Each objItem In colItems
  3411. 				intFkeys  = 0
  3412. 				intLEDs   = 0
  3413. 				strKbdPNP = Split( objItem.InstanceName, "\" )(1)
  3414. 				intFkeys  = objItem.FunctionKeys
  3415. 				intLEDs   = objItem.Indicators
  3416. 				KeyboardFkLEDs.value = intFkeys & " F-keys; " & intLEDs & " LEDs"
  3417. 				intConnectorType = objItem.ConnectorType
  3418. 				If Not IsEmpty( intConnectorType ) Then
  3419. 					strConnectorType = arrConnectorTypes( intConnectorType )
  3420. 					KeyboardConnector.value = strConnectorType
  3421. 				End If
  3422. 				blnHideFkeys = ( intFkeys = 0 And intLEDs = 0 )
  3423. 			Next
  3424. 			ButtonDetailsKeyboard.disabled = False
  3425. 		End If
  3426.  
  3427. 		If strKbdPNP = "" Then
  3428. 			' Check for keyboard details in root/CIMV2 - this is less likely to fail on access denied errors
  3429. 			intCount = 0
  3430. 			Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_Keyboard" )
  3431. 			If Not Err Then
  3432. 				intCount = colItems.Count
  3433. 				If intCount > 1 Then
  3434. 					Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_Keyboard WHERE NOT PNPDeviceID LIKE 'ACPI\\%'" )
  3435. 					intCount = colItems.Count
  3436. 					If colItems.Count = 0 Then
  3437. 						Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_Keyboard" )
  3438. 					End If
  3439. 				End If
  3440. 				For Each objItem In colItems
  3441. 					If KeyboardModel.value  = "" Then KeyboardModel.value = objItem.Description
  3442. 					If KeyboardType.value   = ""  Then KeyboardType.value  = objItem.Name
  3443. 					If KeyboardFkLEDs.value = "" Then
  3444. 						intFkeys = objItem.NumberOfFunctionkeys
  3445. 						If Not IsEmpty( intFkeys ) And intFkeys > 0 Then KeyboardFkLEDs.value = intFkeys & " F-keys"
  3446. 					End If
  3447. 					KeyboardModel.value = objItem.Description
  3448. 					KeyboardType.value  = objItem.Name
  3449. 					If KeyboardConnector.value = "" Then
  3450. 						strConnectorType = Split( objItem.PNPDeviceID, "\" )(0)
  3451. 						KeyboardConnector.value = strConnectorType
  3452. 					End If
  3453. 				Next
  3454. 				ButtonDetailsKeyboard.disabled = False
  3455. 			End If
  3456. 		Else
  3457. 			Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_Keyboard WHERE PNPDeviceID LIKE '%\\" & strKbdPNP & "\\%'" )
  3458. 			If Not Err Then
  3459. 				For Each objItem In colItems
  3460. 					KeyboardModel.value = objItem.Description
  3461. 					KeyboardType.value  = objItem.Name
  3462. 				Next
  3463. 				ButtonDetailsKeyboard.disabled = False
  3464. 			End If
  3465. 		End If
  3466.  
  3467. 		If blnHideFkeys Then 
  3468. 			' If not running with elevated privileges, this field contains nonsense
  3469. 			KeyboardHeaderFkLEDs.style.visibility = "hidden"
  3470. 			KeyboardFkLEDs.style.visibility       = "hidden"
  3471. 		Else
  3472. 			KeyboardHeaderFkLEDs.style.visibility = "visible"
  3473. 			KeyboardFkLEDs.style.visibility       = "visible"
  3474. 		End if
  3475.  
  3476. 		On Error Goto 0
  3477.  
  3478. 		DebugMessage "", "Keyboard inventory succeeded: " & CStr( Not ButtonDetailsKeyboard.disabled )
  3479.  
  3480. 		Add2CsvKbd
  3481. 	End If
  3482. End Sub
  3483.  
  3484.  
  3485. Sub InventoryMainBoard( )
  3486. 	Dim colItems, objItem, strMBVersion
  3487.  
  3488. 	If CheckboxMainBoard.Checked Then
  3489. 		On Error Resume Next ' REQUIRED
  3490.  
  3491. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_BaseBoard" )
  3492. 		If Not Err Then
  3493. 			For Each objItem In colItems
  3494. 				If gvaSettingsBool.Item( "DEVTEST" ) Then
  3495. 					strMBVersion = gvoRandom.Next_2( 1, 9 ) & "." & gvoRandom.Next_2( 0, 9 ) & gvoRandom.Next_2( 0, 9 )
  3496. 				Else
  3497. 					strMBVersion = objItem.Version
  3498. 				End If
  3499. 				MBManufacturer.value = objItem.Manufacturer
  3500. 				MBModel.value        = objItem.Product
  3501. 				MBVersion.value      = strMBVersion
  3502. 			Next
  3503. 			ButtonDetailsMainBoard.disabled = False
  3504. 		End If
  3505.  
  3506. 		On Error Goto 0
  3507.  
  3508. 		ChassisType.value = GetChassis( )
  3509.  
  3510. 		Add2CsvMainBoard
  3511. 	End If
  3512.  
  3513. 	On Error GoTo 0
  3514.  
  3515. 	DebugMessage "", "Main Board inventory succeeded: " & CStr( Not ButtonDetailsMainBoard.disabled )
  3516. End Sub
  3517.  
  3518.  
  3519. Sub InventoryMemory( )
  3520. 	Dim colItems, objItem
  3521.  
  3522. 	If CheckboxMemory.Checked Then
  3523. 		On Error Resume Next ' REQUIRED
  3524.  
  3525. 		' Capacity filter intended for HP/COMPAQ EVO models
  3526. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_PhysicalMemory WHERE Capacity > 524288" )
  3527. 		If Not Err Then
  3528. 			For Each objItem in colItems
  3529. 				gvcMemory = gvcMemory + 1
  3530. 				gviMemSize = gviMemSize + objItem.Capacity
  3531. 				If gviMemSpeed = 0 Or objItem.Speed < gviMemSpeed Then gviMemSpeed = objItem.Speed
  3532. 			Next
  3533. 			MemoryModules.value = gvcMemory
  3534. 			MemorySize.value    = Round( gviMemSize / MB )
  3535.  
  3536. 			Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_PhysicalMemoryArray" )
  3537. 			For Each objItem In colItems
  3538. 				If objItem.MemoryDevices > gvcBanks Then gvcBanks = objItem.MemoryDevices
  3539. 			Next
  3540. 			ButtonDetailsMemory.disabled = False
  3541. 		End If
  3542.  
  3543. 		On Error Goto 0
  3544.  
  3545. 		MemoryBanks.value = gvcBanks
  3546.  
  3547. 		MemoryFormfactor.value = GetMemoryFormFactor( )
  3548.  
  3549. 		MemorySpeed.value = gviMemSpeed
  3550.  
  3551. 		DebugMessage "", "Memory inventory succeeded: " & CStr( Not ButtonDetailsMemory.disabled )
  3552.  
  3553. 		Add2CsvMemory
  3554. 	End If
  3555. End Sub
  3556.  
  3557.  
  3558. Sub InventoryMonitor( )
  3559. 	Dim arrMonitorDescriptions( ), arrMonitorHardwareIDs( ), arrMonitorManufacturers( ), arrMonitorSerialNumbers( )
  3560. 	Dim i, intHeight, intIndex, intRow, intWidth, numRatio
  3561. 	Dim colItems, colItems2, objCell, objItem, objItem2, objMatches, objRE, objTable, objTableRow, objWMIService
  3562. 	Dim strInstanceName, strKey, strManufactureName, strQuery, strQuery2, strSerialNumberID, strSerialNumberLength, strSize, strUserFriendlyName
  3563.  
  3564. 	If CheckboxMonitor.Checked Then
  3565. 		'On Error Resume Next ' REQUIRED
  3566.  
  3567. 		ButtonDetailsMonitor.disabled = False
  3568.  
  3569. 		' Use WmiMonitorID to get some details for all monitors
  3570. 		strQuery = "SELECT * FROM WmiMonitorID"
  3571. 		Set objWMIService = GetObject( "winmgmts://" & gvsComputer & "/root/WMI" )
  3572. 		Set colItems      = objWMIService.ExecQuery( strQuery )
  3573. 		If colItems.Count > 0 Then
  3574. 			ReDim arrMonitorDescriptions( colItems.Count - 1 )
  3575. 			ReDim arrMonitorHardwareIDs( colItems.Count - 1 )
  3576. 			ReDim arrMonitorManufacturers( colItems.Count - 1 )
  3577. 			ReDim arrMonitorSerialNumbers( colItems.Count - 1 )
  3578. 		End If
  3579. 		intIndex = 0
  3580. 		For Each objItem In colItems
  3581. 			strInstanceName = UCase( objItem.InstanceName )
  3582. 			arrMonitorHardwareIDs( intIndex ) = strInstanceName
  3583. 			strUserFriendlyName = Chain( objItem.UserFriendlyName )
  3584. 			arrMonitorDescriptions( intIndex ) = strUserFriendlyName
  3585. 			strManufactureName = GetMonitorManufacturerFullName( Chain( objItem.ManufacturerName ) )
  3586. 			arrMonitorManufacturers( intIndex ) = strManufactureName
  3587. 			strSerialNumberID = Chain( objItem.SerialNumberID )
  3588. 			If gvaSettingsBool.Item( "DEVTEST" ) Then
  3589. 				strSerialNumberID = GetRandomString( strSerialNumberLength )
  3590. 			Else
  3591. 				strSerialNumberID = Chain( objItem.SerialNumberID )
  3592. 			End If
  3593. 			arrMonitorSerialNumbers( intIndex ) = strSerialNumberID
  3594. 			' Get monitor dimensions for this monitor
  3595. 			strQuery2 = "SELECT * FROM WmiMonitorBasicDisplayParams WHERE InstanceName='" & Replace( strInstanceName, "\", "\\" )& "'"
  3596. 			Set colItems2 = objWMIService.ExecQuery( strQuery2 )
  3597. 			If Not Err Then
  3598. 				If colItems2.Count = 1 Then
  3599. 					For Each objItem2 in colItems2
  3600. 						intHeight   = objItem2.MaxVerticalImageSize
  3601. 						intWidth    = objitem2.MaxHorizontalImageSize
  3602. 						If intHeight * intWidth > 0 Then
  3603. 							numRatio = intWidth / intHeight
  3604. 							If gvaSettingsBool.Item( "CM" ) Then
  3605. 								strSize = " (" & intWidth  & " x " & intHeight & " cm"
  3606. 							Else
  3607. 								strSize = " (" & CInt( Sqr( ( intWidth * intWidth ) + ( intHeight * intHeight ) ) / 2.54 ) & """"
  3608. 							End If
  3609. 							If numRatio >= 1.45 Then
  3610. 								strSize = strSize & " widescreen"
  3611. 							End If
  3612. 							strSize = strSize & ")"
  3613. 							arrMonitorDescriptions( intIndex ) = arrMonitorDescriptions( intIndex ) & strSize
  3614. 						End If
  3615. 					Next
  3616. 				End If
  3617. 			End If
  3618. 			intIndex = intIndex + 1
  3619. 		Next
  3620.  
  3621. 		If UBound( arrMonitorDescriptions ) >= 0 Then
  3622. 			document.getElementById( "MultipleMonitors" ).style.display = "inline"
  3623.  
  3624. 			MonitorIndex0.value        = 0
  3625. 			MonitorModel0.value        = arrMonitorDescriptions(0)
  3626. 			MonitorManufacturer0.value = arrMonitorManufacturers(0)
  3627. 			MonitorSerial0.value       = arrMonitorSerialNumbers(0)
  3628.  
  3629. 			If UBound( arrMonitorDescriptions ) > 0 Then
  3630. 				Set objTable = document.getElementById( "Results" )
  3631. 				intRow = document.getElementById( "Monitor0" ).rowIndex
  3632. 				For i = 1 To UBound( arrMonitorDescriptions )
  3633. 					Set objTableRow   = objTable.insertRow( intRow + i )
  3634. 					objTableRow.id    = "Monitor" & i
  3635. 					Set objCell       = objTableRow.insertCell( 0 )
  3636. 					objCell.innerHTML = "&nbsp;"
  3637. 					Set objCell       = objTableRow.insertCell( 1 )
  3638. 					objCell.innerHTML = "&nbsp;"
  3639. 					Set objCell       = objTableRow.insertCell( 2 )
  3640. 					objCell.innerHTML = "&nbsp;"
  3641. 					Set objCell       = objTableRow.insertCell( 3 )
  3642. 					objCell.innerHTML = "&nbsp;"
  3643. 					Set objCell       = objTableRow.insertCell( 4 )
  3644. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""MonitorIndex" & i & """ size=""12"" value=""" & i & """ readonly />"
  3645. 					Set objCell       = objTableRow.insertCell( 5 )
  3646. 					objCell.innerHTML = "&nbsp;"
  3647. 					Set objCell       = objTableRow.insertCell( 6 )
  3648. 					objcell.setAttribute "colSpan", 3
  3649. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""MonitorModel" & i & """ size=""40"" value="""" readonly />"
  3650. 					Set objCell       = objTableRow.insertCell( 7 )
  3651. 					' next line of code required because of doublequote in value
  3652. 					document.GetElementById( "MonitorModel" & i ).value = arrMonitorDescriptions(i)
  3653. 					objCell.innerHTML = "&nbsp;"
  3654. 					Set objCell       = objTableRow.insertCell( 8 )
  3655. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""MonitorManufacturer" & i & """ size=""16"" value=""" & arrMonitorManufacturers(i) & """ readonly />"
  3656. 					Set objCell       = objTableRow.insertCell( 9 )
  3657. 					objCell.innerHTML = "&nbsp;"
  3658. 					Set objCell       = objTableRow.insertCell( 10 )
  3659. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""MonitorSerial" & i & """ size=""16"" value=""" & arrMonitorSerialNumbers(i) & """ readonly />"
  3660. 					Set objCell       = Nothing
  3661. 					Set objTableRow   = Nothing
  3662. 				Next
  3663. 				Set objTable = Nothing
  3664. 			End If
  3665. 		End If
  3666.  
  3667. 		DebugMessage "", "Monitor inventory succeeded: " & CStr( Not ButtonDetailsMonitor.disabled )
  3668.  
  3669. 		On Error Goto 0
  3670. 	End If
  3671. End Sub
  3672.  
  3673.  
  3674. Sub InventoryMouse( )
  3675. 	Dim arrConnectorTypes, arrDeviceInterfaces, arrHardwareTypes, arrPointingTypes
  3676. 	Dim intButtons, intConnectorType, intCount, intMouseType
  3677. 	Dim colItems, objItem
  3678. 	Dim strConnectorType, strMouseModel, strMouseType
  3679.  
  3680. 	If CheckboxMouse.checked Then
  3681. 		' Enumeration of connector and hardware types
  3682. 		arrConnectorTypes = Array( "PS/2", "Serial","USB" )
  3683. 		arrHardwareTypes  = Array( "Standard Mouse", "Standard Pointer", "Standard Absolute Pointer", "Tablet", "Touch Screen", "Pen", "Track Ball" )
  3684. 		ReDim Preserve arrHardwareTypes( 256 )
  3685. 		arrHardwareTypes( 256 ) = "Other"
  3686. 		arrPointingTypes  = Array( "Unknown", "Other", "Unknown", "Mouse", "Trackball", "Track Point", "Glide Point", "Touch Pad", "Touch Screen", "Mouse - Optical Sensor" )
  3687. 		arrDeviceInterfaces = Array( "Unknown", "Other", "Unknown", "Serial", "PS/2", "Infrared", "HP-HIL", "Bus mouse", "ADB (Apple Desktop Bus)" )
  3688. 		ReDim Preserve arrDeviceInterfaces( 162 )
  3689. 		arrDeviceInterfaces( 160 ) = "Bus mouse DB-9"
  3690. 		arrDeviceInterfaces( 161 ) = "Bus mouse micro-DIN"
  3691. 		arrDeviceInterfaces( 162 ) = "USB"
  3692.  
  3693. 		On Error Resume Next ' REQUIRED
  3694.  
  3695. 		' Check for mouse details in root/CIMV2 - this is not likely to fail on access denied errors
  3696. 		intCount = 0
  3697. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_PointingDevice" )
  3698. 		If Not Err Then
  3699. 			intCount = colItems.Count
  3700. 			If intCount > 1 Then
  3701. 				Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_PointingDevice WHERE NOT PNPDeviceID LIKE 'ACPI\\%'" )
  3702. 				intCount = colItems.Count
  3703. 				If colItems.Count = 0 Then
  3704. 					Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_PointingDevice" )
  3705. 				End If
  3706. 			End If
  3707. 			For Each objItem In colItems
  3708. 				intButtons       = objItem.NumberOfButtons
  3709. 				intMouseType     = objItem.PointingType
  3710. 				strMouseType     = arrPointingTypes( intMouseType )
  3711. 				intConnectorType = objItem.DeviceInterface
  3712. 				strConnectorType = arrDeviceInterfaces( intConnectorType )
  3713. 				strMouseModel = objItem.Description
  3714. 				MouseButtons.value = intButtons
  3715. 				MouseType.value    = strMouseType
  3716. 				MouseModel.value   = strMouseModel
  3717. 				MouseConn.value    = strConnectorType
  3718. 			Next
  3719. 			ButtonDetailsMouse.disabled = False
  3720. 		End If
  3721.  
  3722. 		' Check for additional mouse details in root/WMI - this may fail on access denied errors when not running with elevated privileges
  3723. 		intCount = 0
  3724. 		Set colItems = gvoWMIrootWMI.ExecQuery( "SELECT * FROM MSMouse_PortInformation WHERE Active = True" )
  3725. 		If Not Err Then
  3726. 			intCount = colItems.Count
  3727. 			If intCount > 1 Then
  3728. 				Set colItems = gvoWMIrootWMI.ExecQuery( "SELECT * FROM MSMouse_PortInformation WHERE Active = True AND Instancename LIKE 'HID\\%'" )
  3729. 				intCount = colItems.Count
  3730. 				If intCount = 0 Then
  3731. 					Set colItems = gvoWMIrootWMI.ExecQuery( "SELECT * FROM MSMouse_PortInformation WHERE Active = True AND Instancename LIKE '%&%'" )
  3732. 				End If
  3733. 			End If
  3734. 			For Each objItem In colItems
  3735. 				intButtons = objItem.Buttons
  3736. 				intButtons = Max( MouseButtons.value, intButtons )
  3737. 				If Not gvbIsElevated And intButtons = 0 Then 
  3738. 					' If not running with elevated privileges, this field contains nonsense
  3739. 					MouseButtonsHeader.style.visibility = "hidden"
  3740. 					MouseButtons.style.visibility       = "hidden"
  3741. 				Else
  3742. 					MouseButtonsHeader.style.visibility = "visible"
  3743. 					MouseButtons.style.visibility       = "visible"
  3744. 					MouseButtons.value = intButtons
  3745. 				End If
  3746. 				intConnectorType = objItem.ConnectorType
  3747. 				strConnectorType = arrConnectorTypes( intConnectorType )
  3748. 				strMouseModel    = MouseModel.value
  3749. 				MouseModel.value   = strMouseModel
  3750. 				MouseConn.value    = strConnectorType
  3751. 			Next
  3752. 			ButtonDetailsMouse.disabled = False
  3753. 		End If
  3754.  
  3755. 		On Error Goto 0
  3756.  
  3757. 		DebugMessage "", "Mouse inventory succeeded: " & CStr( Not ButtonDetailsMouse.disabled )
  3758.  
  3759. 		Add2CsvMouse
  3760. 	End If
  3761. End Sub
  3762.  
  3763.  
  3764. Sub InventoryNIC( )
  3765. 	Dim arrNICPhysicalMedia(19)
  3766. 	Dim i, intIndex, intRandom, intRow
  3767. 	Dim colItems, objCell, objItem, objMACAddresses, objNICPhysMedia, objNICProductNames, objNICSpeeds, objTable, objTableRow
  3768. 	Dim strKey, strMACAddress, strQuery, strSpeed
  3769.  
  3770. 	arrNICPhysicalMedia( 0 )  = "Unspecified"
  3771. 	arrNICPhysicalMedia( 1 )  = "Wireless LAN"
  3772. 	arrNICPhysicalMedia( 2 )  = "Cable Modem"
  3773. 	arrNICPhysicalMedia( 3 )  = "Phone Line"
  3774. 	arrNICPhysicalMedia( 4 )  = "Power Line"
  3775. 	arrNICPhysicalMedia( 5 )  = "DSL"
  3776. 	arrNICPhysicalMedia( 6 )  = "FC"
  3777. 	arrNICPhysicalMedia( 7 )  = "1394"
  3778. 	arrNICPhysicalMedia( 8 )  = "Wireless WAN"
  3779. 	arrNICPhysicalMedia( 9 )  = "Native 802.11"
  3780. 	arrNICPhysicalMedia( 10 ) = "BlueTooth"
  3781. 	arrNICPhysicalMedia( 11 ) = "Infiniband"
  3782. 	arrNICPhysicalMedia( 12 ) = "WiMAX"
  3783. 	arrNICPhysicalMedia( 13 ) = "UWB"
  3784. 	arrNICPhysicalMedia( 14 ) = "802.3"
  3785. 	arrNICPhysicalMedia( 15 ) = "802.5"
  3786. 	arrNICPhysicalMedia( 16 ) = "IRDA"
  3787. 	arrNICPhysicalMedia( 17 ) = "Wired WAN"
  3788. 	arrNICPhysicalMedia( 18 ) = "Wired Connection Oriented WAN"
  3789. 	arrNICPhysicalMedia( 19 ) = "Other"
  3790.  
  3791. 	If CheckBoxNIC.Checked Then
  3792. 		On Error Resume Next ' REQUIRED
  3793. 		strQuery = "SELECT * FROM MSFT_NetAdapter"
  3794. 		Set colItems = gvoWMIrootStandardCimv2.ExecQuery( strQuery )
  3795. 		If Not Err Then
  3796. 			Set objMACAddresses    = CreateObject( "System.Collections.Sortedlist" )
  3797. 			Set objNICProductNames = CreateObject( "System.Collections.Sortedlist" )
  3798. 			Set objNICSpeeds       = CreateObject( "System.Collections.Sortedlist" )
  3799. 			Set objNICPhysMedia    = CreateObject( "System.Collections.Sortedlist" )
  3800. 			intIndex = 0
  3801. 			For Each objItem In colItems
  3802. 				If gvaSettingsBool.Item( "DEVTEST" ) Then
  3803. 					strMACAddress = ""
  3804. 					For i = 1 To 16
  3805. 						intRandom = gvoRandom.Next_2( 48, 63 )
  3806. 						If intRandom > 57 Then intRandom = intRandom + 7
  3807. 						strMACAddress = strMACAddress + Chr( intRandom )
  3808. 					Next
  3809. 					objMACAddresses.Item( intIndex ) = strMACAddress
  3810. 				Else
  3811. 					objMACAddresses.Item( intIndex ) = objItem.PermanentAddress
  3812. 				End If
  3813. 				objNICProductNames.Item( intIndex ) = objItem.DriverDescription
  3814. 				objNICSpeeds.Item( intIndex ) = objItem.Speed
  3815. 				If objNICSpeeds.Item( intIndex ) >= 1000000000 Then
  3816. 					strSpeed = " (" & ( objNICSpeeds.Item( intIndex ) / 1000000000 ) & " Gb/s)"
  3817. 				ElseIf objNICSpeeds.Item( intIndex ) >= 1000000 Then
  3818. 					strSpeed = " (" & ( objNICSpeeds.Item( intIndex ) / 1000000 ) & " Mb/s)"
  3819. 				ElseIf objNICSpeeds.Item( intIndex ) >= 1000 Then
  3820. 					strSpeed = " (" & ( objNICSpeeds.Item( intIndex ) / 1000 ) & " kb/s)"
  3821. 				Else
  3822. 					strSpeed = ""
  3823. 				End If
  3824. 				objNICSpeeds.Item( intIndex ) = objNICSpeeds.Item( intIndex ) & strSpeed
  3825. 				objNICPhysMedia.Item( intIndex ) = arrNICPhysicalMedia( objItem.NdisPhysicalMedium )
  3826. 				intIndex = intIndex + 1
  3827. 			Next
  3828.  
  3829. 			strKey            = objMACAddresses.GetKey( 0 )
  3830. 			NICIndex0.value   = strKey
  3831. 			NICModel0.value   = objNICProductNames.Item( strKey ) & " (" & objNICPhysMedia.Item( strKey ) & ")"
  3832. 			MACAddress0.value = objMACAddresses.Item( strKey )
  3833. 			NICSpeed0.value   = objNICSpeeds.Item( strKey )
  3834.  
  3835. 			If objMACAddresses.Count > 1 Then
  3836. 				MultipleNICs.style.display = "inline"
  3837. 				Set objTable = document.getElementById( "Results" )
  3838. 				intRow = document.getElementById( "NIC0" ).rowIndex
  3839. 				For i = 1 To objMACAddresses.Count - 1
  3840. 					strKey = objMACAddresses.GetKey( i )
  3841. 					Set objTableRow   = objTable.insertRow( intRow + i )
  3842. 					objTableRow.id    = "NIC" & i
  3843. 					Set objCell       = objTableRow.insertCell( 0 )
  3844. 					objCell.innerHTML = "&nbsp;"
  3845. 					Set objCell       = objTableRow.insertCell( 1 )
  3846. 					objCell.innerHTML = "&nbsp;"
  3847. 					Set objCell       = objTableRow.insertCell( 2 )
  3848. 					objCell.innerHTML = "&nbsp;"
  3849. 					Set objCell       = objTableRow.insertCell( 3 )
  3850. 					objCell.innerHTML = "&nbsp;"
  3851. 					Set objCell       = objTableRow.insertCell( 4 )
  3852. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""NICIndex" & i & """ size=""12"" value=""" & strKey & """ readonly />"
  3853. 					Set objCell       = objTableRow.insertCell( 5 )
  3854. 					objCell.innerHTML = "&nbsp;"
  3855. 					Set objCell       = objTableRow.insertCell( 6 )
  3856. 					objcell.setAttribute "colSpan", 3
  3857. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""NICModel" & i & """ size=""40"" value=""" & objNICProductNames.Item( strKey ) & " (" & objNICPhysMedia.Item( strKey ) & ")"" readonly />"
  3858. 					Set objCell       = objTableRow.insertCell( 7 )
  3859. 					objCell.innerHTML = "&nbsp;"
  3860. 					Set objCell       = objTableRow.insertCell( 8 )
  3861. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""MACAddress" & i & """ size=""16"" value=""" & objMACAddresses.Item( strKey ) & """ readonly />"
  3862. 					Set objCell       = objTableRow.insertCell( 9 )
  3863. 					objCell.innerHTML = "&nbsp;"
  3864. 					Set objCell       = objTableRow.insertCell( 10 )
  3865. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""NICSpeed" & i & """ size=""16"" value=""" & objNICSpeeds.Item( strKey ) & """ readonly />"
  3866. 					Set objCell       = Nothing
  3867. 					Set objTableRow   = Nothing
  3868. 				Next
  3869. 			End If
  3870. 			Set objtable           = Nothing
  3871. 			Set objMACAddresses    = Nothing
  3872. 			Set objNICProductNames = Nothing
  3873. 			Set objNICSpeeds       = Nothing
  3874.  
  3875. 			ButtonDetailsNIC.disabled = False
  3876. 		End If
  3877. 		On Error Goto 0
  3878.  
  3879. 		DebugMessage "", "NIC inventory succeeded: " & CStr( Not ButtonDetailsNIC.disabled )
  3880.  
  3881. 		Add2CsvNIC
  3882. 	End If
  3883. End Sub
  3884.  
  3885.  
  3886. Sub InventoryPorts( )
  3887. 	Dim cntAGP, cntFireWire, cntOther, cntParallel, cntPCI, cntPCIE, cntSerial, cntUSB, cntUSB3, colItems, objItem
  3888. 	cntAGP      = 0
  3889. 	cntFireWire = 0
  3890. 	cntOther    = 0
  3891. 	cntParallel = 0
  3892. 	cntPCI      = 0
  3893. 	cntPCIE     = 0
  3894. 	cntSerial   = 0
  3895. 	cntUSB      = 0
  3896. 	cntUSB3     = 0
  3897.  
  3898. 	If CheckBoxPorts.Checked Then
  3899. 		On Error Resume Next ' REQUIRED
  3900. 		' Check for USB controllers
  3901. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_USBController" )
  3902. 		If Not Err Then cntUSB = colItems.Count
  3903. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_USBController WHERE Name LIKE '%USB 3%'" )
  3904. 		If Not Err Then
  3905. 			cntUSB3 = colItems.Count
  3906. 			cntUSB  = cntUSB - cntUSB3
  3907. 			ButtonDetailsPorts.disabled = False
  3908. 		End If
  3909. 		If cntUSB3 > 0 Then
  3910. 			USB.value = cntUSB & " + " & cntUSB3 & " x USB3"
  3911. 		Else
  3912. 			USB.value = cntUSB
  3913. 		End If
  3914. 		' Count FireWire ports
  3915. 		Set colItems = gvoWMIrootCimv2.Execquery( "SELECT * FROM Win32_1394ControllerDevice" )
  3916. 		If Not Err Then
  3917. 			cntFireWire = colItems.Count
  3918. 			ButtonDetailsPorts.disabled = False
  3919. 		End If
  3920. 		FireWire.value = cntFireWire
  3921. 		' Count parallel ports
  3922. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_ParallelPort" )
  3923. 		If Not Err Then
  3924. 			cntParallel = colItems.Count
  3925. 			ButtonDetailsPorts.disabled = False
  3926. 		End If
  3927. 		' Count serial ports
  3928. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_SerialPort" )
  3929. 		If Not Err Then
  3930. 			cntSerial = colItems.Count
  3931. 			ButtonDetailsPorts.disabled = False
  3932. 		End If
  3933. 		If cntParallel > 0 And cntSerial > 0 Then
  3934. 			Legacy.value = cntParallel & "x Parallel, " & cntSerial & "x Serial"
  3935. 		ElseIf cntSerial > 0 Then
  3936. 			Legacy.value = cntSerial & " Serial"
  3937. 		ElseIf cntParallel > 0 Then
  3938. 			Legacy.value = cntParallel & " Parallel"
  3939. 		Else
  3940. 			Legacy.value = 0
  3941. 		End If
  3942. 		' Count system slots (PCI/AGP)
  3943. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT SlotDesignation FROM Win32_SystemSlot" )
  3944. 		If Not Err Then
  3945. 			For Each objItem In colItems
  3946. 				If Left( objItem.SlotDesignation, 3 ) = "AGP" Then cntAGP = cntAGP + 1
  3947. 				If Left( objItem.SlotDesignation, 3 ) = "PCI" Then
  3948. 					If Left( objItem.SlotDesignation, 4 ) = "PCIE" Then
  3949. 						cntPCIE = cntPCIE + 1
  3950. 					Else
  3951. 						cntPCI = cntPCI + 1
  3952. 					End If
  3953. 				End If
  3954. 				If InStr( "AGPCI", Left( objItem.SlotDesignation, 3 ) ) = 0 Then cntOther = cntOther + 1
  3955. 			Next
  3956. 			ButtonDetailsPorts.disabled = False
  3957. 		End If
  3958. 		On Error Goto 0
  3959. 		Slots.value = cntPCI & " x PCI, " & cntPCIE & " x PCIE, " & cntAGP & " x AGP"
  3960. 		gvsSlots    = cntPCI &   "xPCI "  & cntPCIE &   "xPCIE "  & cntAGP &   "xAGP"
  3961. 		If cntOther > 0 Then
  3962. 			Slots.value = Slots.value & ", " & cntOther & " x Other"
  3963. 			gvsSlots    = gvsSlots    & " "  & cntOther & "xOther"
  3964. 		End If
  3965.  
  3966. 		DebugMessage "", "Ports inventory succeeded: " & CStr( Not ButtonDetailsPorts.disabled )
  3967.  
  3968. 		Add2CsvPorts
  3969. 	End If
  3970. End Sub
  3971.  
  3972.  
  3973. Sub InventorySound( )
  3974. 	Dim arrKeys, arrSubKeys, arrSubSubKeys, arrSubSubSubKeys
  3975. 	Dim blnRegValFound
  3976. 	Dim h, i, j, k
  3977. 	Dim colItems, objItem, objReg
  3978. 	Dim strDescription1, strDescription2, strKey, strQuery
  3979. 	If CheckBoxSound.Checked Then
  3980. 		' First search the registry for the ACTIVE sound card: it should have a key
  3981. 		' like "HKLM\SYSTEM\CurrentControlSet\Enum\*AUDIO\*\*\Device Parameters\"
  3982. 		' and then its name can be found at the end of the string value
  3983. 		' "HKLM\SYSTEM\CurrentControlSet\Enum\*AUDIO\*\*\DeviceDesc"
  3984. 		' after the last semicolon.
  3985. 		' If the registry contains multiple *AUDIO keys, only the last one is used.
  3986. 		blnRegValFound = True
  3987. 		Set objReg = GetObject( "winmgmts:{impersonationLevel=impersonate}!//" & gvsComputer & "/root/default:StdRegProv" )
  3988. 		objReg.EnumKey HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Enum", arrKeys
  3989. 		For h = 0 To UBound( arrKeys )
  3990. 			If UCase( Right( arrKeys(h), 5 ) ) = "AUDIO" Then
  3991. 				gvsAudioRegKey = UCase( arrKeys(h) )
  3992. 				strKey = "SYSTEM\CurrentControlSet\Enum\" & arrKeys(h)
  3993. 				blnRegValFound = blnRegValFound And objReg.EnumKey( HKEY_LOCAL_MACHINE, strKey, arrSubKeys )
  3994. 				For i = 0 To UBound( arrSubKeys )
  3995. 					strKey = "SYSTEM\CurrentControlSet\Enum\" & arrKeys(h) & "\" & arrSubKeys(i)
  3996. 					blnRegValFound = blnRegValFound And objReg.EnumKey( HKEY_LOCAL_MACHINE, strKey, arrSubSubKeys )
  3997. 					For j = 0 To UBound( arrSubSubKeys )
  3998. 						strKey = "SYSTEM\CurrentControlSet\Enum\" & arrKeys(h) & "\" & arrSubKeys(i) & "\" & arrSubSubKeys(j)
  3999. 						blnRegValFound = blnRegValFound And objReg.EnumKey( HKEY_LOCAL_MACHINE, strKey, arrSubSubSubKeys )
  4000. 						For k = 0 To UBound( arrSubSubSubKeys )
  4001. 							If arrSubSubSubKeys(k) = "Device Parameters" Then
  4002. 								blnRegValFound = blnRegValFound And objReg.GetStringValue( HKEY_LOCAL_MACHINE, strKey, "DeviceDesc", strDescription1 )
  4003. 								If blnRegValFound Then
  4004. 									strDescription2 = Mid( strDescription, InStrRev( strDescription1, ";" ) + 1 )
  4005. 								End If
  4006. 							End If
  4007. 						Next
  4008. 					Next
  4009. 				Next
  4010. 			End If
  4011. 		Next
  4012. 		Set objReg = Nothing
  4013.  
  4014. 		On Error Resume Next ' REQUIRED
  4015. 		strQuery = "SELECT * FROM Win32_SoundDevice"
  4016. 		' Append the name of the ACTIVE sound card, if found, to the query
  4017. 		If blnRegValFound Then strQuery = strQuery & " WHERE Name=""" & strDescription2 & """"
  4018. 		Set colItems = gvoWMIrootCimv2.ExecQuery( strQuery )
  4019. 		If Err Or IsNull( colItems ) Or colItems.Count = 0 Then
  4020. 			If gvbWinPE And gvsWinDrive <> "" Then InventorySoundWinPE
  4021. 		Else
  4022. 			For Each objItem In colItems
  4023. 				SoundCardManufacturer.value = objItem.Manufacturer
  4024. 				SoundCardModel.value        = objItem.ProductName
  4025. 			Next
  4026. 			ButtonDetailsSound.disabled = False
  4027. 		End If
  4028. 		On Error Goto 0
  4029.  
  4030. 		DebugMessage "", "Sound Devices inventory succeeded: " & CStr( Not ButtonDetailsSound.disabled )
  4031.  
  4032. 		Add2CsvSound
  4033. 	End If
  4034. End Sub
  4035.  
  4036.  
  4037. Sub InventorySoundWinPE( )
  4038. 	Dim arrRegKeys, arrSubKeys, arrSubSubKeys, arrTest
  4039. 	Dim blnFoundHardwareManufacturer
  4040. 	Dim i
  4041. 	Dim dicSoundCards, objReg
  4042. 	Dim strAudioDescription, strAudioManufacturer, strKey, strRegKey, strSubKey
  4043.  
  4044. 	' Mount registry hive from Windows Drive
  4045. 	gvoWSHShell.Run "CMD.EXE /C REG.EXE Load HKLM\TempHive " & gvsWinDrive & "\windows\system32\config\system", 0, True
  4046.  
  4047. 	' Scan the temporary registry hive for sound cards
  4048. 	Set dicSoundCards = CreateObject( "Scripting.Dictionary" )
  4049. 	Set objReg        = GetObject( "winmgmts:{impersonationLevel=impersonate}!//./root/default:StdRegProv" )
  4050. 	objReg.EnumKey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\HDAudio", arrRegKeys
  4051. 	If Not IsNull( arrRegKeys ) Then
  4052. 		For Each strRegKey In arrRegKeys
  4053. 			objReg.EnumKey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\HDAudio\" & strRegKey, arrSubKeys
  4054. 			If Not IsNull( arrSubKeys ) Then
  4055. 				For Each strSubKey In arrSubKeys
  4056. 					objReg.Enumkey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\HDAudio\" & strRegKey & "\" & strSubKey, arrSubSubKeys
  4057. 					If Not IsNull( arrSubSubKeys ) Then
  4058. 						strAudioDescription  = Null
  4059. 						strAudioManufacturer = Null
  4060. 						objReg.GetStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\HDAudio\" & strRegKey & "\" & strSubKey, "DeviceDesc", strAudioDescription
  4061. 						objReg.GetStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\HDAudio\" & strRegKey & "\" & strSubKey, "Mfg", strAudioManufacturer
  4062. 						If Not IsNull( strAudioDescription ) And Not IsNull( strAudioManufacturer ) Then
  4063. 							If InStr( strAudioDescription, ";" ) Then
  4064. 								arrTest              = Split( strAudioDescription, ";" )
  4065. 								strAudioDescription  = arrTest( UBound( arrTest ) )
  4066. 							End If
  4067. 							If InStr( strAudioManufacturer, ";" ) Then
  4068. 								arrTest              = Split( strAudioManufacturer, ";" )
  4069. 								strAudioManufacturer = arrTest( UBound( arrTest ) )
  4070. 							End If
  4071. 							dicSoundCards.Item( Trim( strAudioManufacturer ) ) = Trim( strAudioDescription )
  4072. 						End If
  4073. 					End If
  4074. 				Next
  4075. 			End If
  4076. 		Next
  4077. 	End If
  4078. 	Set objReg = Nothing
  4079.  
  4080. 	' Unmount registry hive
  4081. 	gvoWSHShell.Run "CMD.EXE /C REG.EXE Unload HKLM\TempHive", 0, True
  4082.  
  4083. 	' Search the results, preferably for a true hardware manufacturer
  4084. 	strAudioDescription          = ""
  4085. 	strAudioManufacturer         = ""
  4086. 	blnFoundHardwareManufacturer = False
  4087. 	For Each strKey in dicSoundCards.Keys
  4088. 		If UCase( strKey ) <> "MICROSOFT" Then
  4089. 			strAudioManufacturer         = strKey
  4090. 			strAudioDescription          = dicSoundCards.Item( strKey )
  4091. 			blnFoundHardwareManufacturer = True
  4092. 		End If
  4093. 	Next
  4094. 	If Not blnFoundHardwareManufacturer Then
  4095. 		For Each strKey in dicSoundCards.Keys
  4096. 			strAudioManufacturer = strKey
  4097. 			strAudioDescription  = dicSoundCards.Item( strKey )
  4098. 		Next
  4099. 	End If
  4100. 	Set dicSoundCards = Nothing
  4101.  
  4102. 	SoundCardManufacturer.value = strAudioManufacturer
  4103. 	SoundCardModel.value        = strAudioDescription
  4104.  
  4105. 	ButtonDetailsSound.disabled = Not blnFoundHardwareManufacturer
  4106.  
  4107. 	DebugMessage "", "Sound Devices inventory succeeded: " & CStr( Not ButtonDetailsSound.disabled )
  4108. End Sub
  4109.  
  4110.  
  4111. Sub InventoryVideo( )
  4112. 	Dim arrVideoMemories( ), arrVideoModels( ), arrVideoModes( )
  4113. 	Dim i, intIndex, intRow, intVidMem
  4114. 	Dim colItems, objCell, objItem, objReg, objTable, objTableRow
  4115.  
  4116. 	If CheckboxVideo.Checked Then
  4117. 		On Error Resume Next ' REQUIRED
  4118. 		' WHERE clauses to exclude Citrix or other virtual video devices, based on input by Steve Robertson
  4119. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_VideoController WHERE AdapterRAM IS NOT NULL AND InstalledDisplayDrivers IS NOT NULL" )
  4120. 		If Err Or IsNull( colItems ) Or colItems.Count = 0 Then
  4121. 			If gvbWinPE And gvsWinDrive <> "" Then
  4122. 				On Error Goto 0
  4123. 				ButtonDetailsVideo.disabled = True
  4124. 				InventoryVideoWinPE
  4125. 			End If
  4126. 		Else
  4127. 			ReDim arrVideoMemories( colItems.Count - 1 )
  4128. 			ReDim arrVideoModels( colItems.Count - 1 )
  4129. 			ReDim arrVideoModes( colItems.Count - 1 )
  4130. 			intIndex  = 0
  4131. 			intVidMem = 0
  4132. 			For Each objItem in colItems
  4133. 				arrVideoMemories( intIndex ) = Round( objItem.AdapterRAM / MB )
  4134. 				arrVideoModels( intIndex ) = objItem.Name
  4135. 				arrVideoModes( intIndex )  = objItem.VideoModeDescription
  4136. 				' Correct video RAM if 4GB or more and for internal devices
  4137. 				intVidMem = GetVideoRAM( arrVideoModels( intIndex ) )
  4138. 				If intVidMem > 0 Then
  4139. 					arrVideoMemories( intIndex ) = intVidMem
  4140. 				End If
  4141. 				intIndex = intIndex + 1
  4142. 			Next
  4143.  
  4144. 			VideoIndex0.value  = 0
  4145. 			VideoModel0.value  = arrVideoModels(0)
  4146. 			VideoMemory0.value = arrVideoMemories(0)
  4147. 			VideoMode0.value   = arrVideoModes(0)
  4148.  
  4149. 			If UBound( arrVideoModels ) > 0 Then
  4150. 				Set objTable = document.getElementById( "Results" )
  4151. 				intRow = document.getElementById( "Video0" ).rowIndex
  4152. 				For i = 1 To UBound( arrVideoModels )
  4153. 					Set objTableRow   = objTable.insertRow( intRow + i )
  4154. 					objTableRow.id    = "Video" & i
  4155. 					Set objCell       = objTableRow.insertCell( 0 )
  4156. 					objCell.innerHTML = "&nbsp;"
  4157. 					Set objCell       = objTableRow.insertCell( 1 )
  4158. 					objCell.innerHTML = "&nbsp;"
  4159. 					Set objCell       = objTableRow.insertCell( 2 )
  4160. 					objCell.innerHTML = "&nbsp;"
  4161. 					Set objCell       = objTableRow.insertCell( 3 )
  4162. 					objCell.innerHTML = "&nbsp;"
  4163. 					Set objCell       = objTableRow.insertCell( 4 )
  4164. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoIndex" & i & """ size=""12"" value=""" & i & """ readonly />"
  4165. 					Set objCell       = objTableRow.insertCell( 5 )
  4166. 					objCell.innerHTML = "&nbsp;"
  4167. 					Set objCell       = objTableRow.insertCell( 6 )
  4168. 					objCell.setAttribute "colSpan", 3
  4169. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoModel" & i & """ size=""40"" value=""" & arrVideoModels(i) & """ readonly />"
  4170. 					Set objCell       = objTableRow.insertCell( 7 )
  4171. 					objCell.innerHTML = "&nbsp;"
  4172. 					Set objCell       = objTableRow.insertCell( 8 )
  4173. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoMemory" & i & """ size=""16"" value=""" & arrVideoMemories(i) & """ readonly />"
  4174. 					Set objCell       = objTableRow.insertCell( 9 )
  4175. 					objCell.innerHTML = "&nbsp;"
  4176. 					Set objCell       = objTableRow.insertCell( 10 )
  4177. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoMode" & i & """ size=""16"" value=""" & arrVideoModes(i) & """ readonly />"
  4178. 					Set objCell       = Nothing
  4179. 					Set objTableRow   = Nothing
  4180. 				Next
  4181. 			End If
  4182. 			Set objTable = Nothing
  4183.  
  4184. 			ButtonDetailsVideo.disabled = False
  4185. 		End If
  4186.  
  4187. 		DebugMessage "", "Video inventory succeeded: " & CStr( Not ButtonDetailsVideo.disabled )
  4188.  
  4189. 		On Error Goto 0
  4190. 	End If
  4191. End Sub
  4192.  
  4193.  
  4194. Sub InventoryVideoWinPE( )
  4195. 	Dim arrRegKeys, arrSubKeys
  4196. 	Dim i, intIndex, intRow
  4197. 	Dim dicVideoCards, objCell, objReg, objtable, objTableRow
  4198. 	Dim strDictKey, strRegKey, strVideoDescription, strVideoService
  4199.  
  4200. 	' Mount registry hive from Windows Drive
  4201. 	gvoWSHShell.Run "CMD.EXE /C REG.EXE Load HKLM\TempHive " & gvsWinDrive & "\windows\system32\config\system", 0, True
  4202.  
  4203. 	' Scan the temporary registry hive for video cards
  4204. 	Set dicVideoCards = CreateObject( "Scripting.Dictionary" )
  4205. 	Set objReg        = GetObject( "winmgmts:{impersonationLevel=impersonate}!//./root/default:StdRegProv" )
  4206. 	objReg.EnumKey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Control\Video", arrRegKeys
  4207. 	If Not IsNull( arrRegKeys ) Then
  4208. 		For Each strRegKey In arrRegKeys
  4209. 			objReg.GetStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Control\Video\" & strRegKey & "\Video", "Service", strVideoService
  4210. 			If strVideoService <> "" And UCase( strVideoService ) <> "VGA" Then ' Ignore standard VGA driver
  4211. 				objReg.GetStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Services\" & strVideoService & "\Device0", "Device Description", strVideoDescription
  4212. 				If Left( strVideoDescription, 3 ) <> "RDP" Then ' Ignore RDP video drivers
  4213. 					dicVideoCards.Item( strVideoService ) = strVideoDescription
  4214. 				End If
  4215. 			End If
  4216. 		Next
  4217. 	End If
  4218.  
  4219. 	' Unmount registry hive
  4220. 	gvoWSHShell.Run "CMD.EXE /C REG.EXE Unload HKLM\TempHive", 0, True
  4221.  
  4222. 	VideoIndex0.value  = 0
  4223. 	VideoModel0.value  = dicVideoCards.Item(0)
  4224. 	VideoMemory0.value = "?"
  4225. 	VideoMode0.value   = "?"
  4226.  
  4227. 	If dicVideoCards.Count > 1 then
  4228. 		Set objTable = document.getElementById( "Results" )
  4229. 		intRow = document.getElementById( "Video0" ).rowIndex
  4230. 		For i = 1 To dicVideoCards.Count - 1
  4231. 			strDictKey = dicVideoCards.Keys(i)
  4232. 			Set objTableRow   = objTable.insertRow( intRow + i )
  4233. 			objTableRow.id    = "Video" & i
  4234. 			Set objCell       = objTableRow.insertCell( 0 )
  4235. 			objCell.innerHTML = "&nbsp;"
  4236. 			Set objCell       = objTableRow.insertCell( 1 )
  4237. 			objCell.innerHTML = "&nbsp;"
  4238. 			Set objCell       = objTableRow.insertCell( 2 )
  4239. 			objCell.innerHTML = "&nbsp;"
  4240. 			Set objCell       = objTableRow.insertCell( 3 )
  4241. 			objCell.innerHTML = "&nbsp;"
  4242. 			Set objCell       = objTableRow.insertCell( 4 )
  4243. 			objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoIndex" & i & """ size=""12"" value=""" & i & """ readonly />"
  4244. 			Set objCell       = objTableRow.insertCell( 5 )
  4245. 			objCell.innerHTML = "&nbsp;"
  4246. 			Set objCell       = objTableRow.insertCell( 6 )
  4247. 			objcell.setAttribute "colSpan", 3
  4248. 			objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoModel" & i & """ size=""40"" value=""" & dicVideoCards.Item( strDictKey ) & """ readonly />"
  4249. 			Set objCell       = objTableRow.insertCell( 7 )
  4250. 			objCell.innerHTML = "&nbsp;"
  4251. 			Set objCell       = objTableRow.insertCell( 8 )
  4252. 			objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoMemory" & i & """ size=""16"" value=""?"" readonly />"
  4253. 			Set objCell       = objTableRow.insertCell( 9 )
  4254. 			objCell.innerHTML = "&nbsp;"
  4255. 			Set objCell       = objTableRow.insertCell( 10 )
  4256. 			objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoMode" & i & """ size=""16"" value=""?"" readonly />"
  4257. 			Set objCell       = Nothing
  4258. 			Set objTableRow   = Nothing
  4259.  
  4260. 			ButtonDetailsVideo.disabled = True
  4261. 		Next
  4262. 	End If
  4263. 	Set objReg        = Nothing
  4264. 	Set dicVideoCards = Nothing
  4265.  
  4266. 	DebugMessage "", "Video inventory succeeded: " & CStr( Not ButtonDetailsVideo.disabled )
  4267. End Sub
  4268.  
  4269.  
  4270. Sub InventoryWinSATScores( )
  4271. 	Dim colItems, objItem
  4272. 	sngCPU    = -1
  4273. 	sngDisk   = -1
  4274. 	sngMemory = -1
  4275. 	sngTotal  = -1
  4276. 	sngVideo  = -1
  4277. 	If Not gvaSettingsBool.Item( "NOSCORES" ) And Not gvbWinPE Then
  4278. 		On Error Resume Next ' REQUIRED
  4279. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_WinSAT Where TimeTaken=""MostRecentAssessment""" )
  4280. 		If Not Err Then
  4281. 			For Each objItem in colItems
  4282. 				sngCPU    = objItem.CPUScore
  4283. 				sngDisk   = objItem.DiskScore
  4284. 				sngVideo  = objItem.GraphicsScore
  4285. 				sngMemory = objItem.MemoryScore
  4286. 				sngTotal  = objItem.WinSPRLevel
  4287. 			Next
  4288. 		End If
  4289. 		If CheckboxCPU.Checked       Then CPUScore.value      = sngCPU
  4290. 		If CheckboxHDD.Checked       Then DiskScore.value     = sngDisk
  4291. 		If CheckboxMainBoard.Checked Then WinSATScore.value   = sngTotal
  4292. 		If CheckboxMemory.Checked    Then MemoryScore.value   = sngMemory
  4293. 		If CheckboxVideo.Checked     Then GraphicsScore.value = sngVideo
  4294. 		On Error Goto 0
  4295.  
  4296. 		If sngCPU < 1 Then
  4297. 			MsgBox "If WinSAT scores remain empty, run the command ""winsat.exe formal"" once in an elevated console.", vbOKOnly + vbInformation, "Enable WinSAT scores"
  4298. 		End If
  4299. 	End If
  4300.  
  4301. 	DebugMessage "", "WinSat scores inventory succeeded: " & CStr( CBool( sngCPU > -1 ) )
  4302.  
  4303. 	Set colItems = Nothing
  4304. End Sub
  4305.  
  4306.  
  4307. Function IsAdmin( showMessage )
  4308.     ' Based on code by Denis St-Pierre
  4309.     Dim intAnswer, intButtons, intPlatformHTA, intPlatformWin, intRC
  4310.     Dim colItems, objItem, objUAC
  4311.     Dim strCommandLine, strHTA, strMsg, strTitle
  4312.  
  4313.     gvbIsElevated = False
  4314.     On Error Resume Next ' REQUIRED
  4315.     gvbIsElevated = ( gvoWSHShell.Run( "CMD /C OPENFILES > NUL 2>&1", 7, True ) = 0 )
  4316.     If Err Then intRC = 1
  4317.     On Error Goto 0
  4318.  
  4319.     If ( InStr( UCase( Hardware.CommandLine ), "/NOADMIN" ) > 0 ) Or gvbWinPE Then
  4320.     	IsAdmin = True
  4321.     Else
  4322.     	IsAdmin = False
  4323. 		intPlatformHTA = CInt( Right( window.navigator.platform, 2 ) )
  4324. 	    If gvoFSO.FolderExists( gvoWSHShell.ExpandEnvironmentStrings( "%windir%\SysWOW64" ) ) Then
  4325. 			intPlatformWin = 64
  4326. 		Else
  4327. 			intPlatformWin = 32
  4328. 		End If
  4329. 	    If gvbIsElevated Then
  4330. 	    	intRC = 0
  4331. 	    	IsAdmin = True
  4332. 	    Else
  4333. 	    	intRC = 1
  4334. 			If showMessage Then
  4335. 				strTitle   = "Elevated Privileges Recommended"
  4336. 		   		intButtons = vbYesNoCancel + vbInformation + vbApplicationModal
  4337. 				strMsg     = "This HTA works best with elevated privileges." & vbCrLf _
  4338. 				           & "Without elevated privileges, the HTA won't have access to all WMI namespaces, i.e. some details will be missed." & vbCrLf & vbCrLf _
  4339. 				           & "Running this HTA as administrator is recommended." & vbCrLf & vbCrLf & vbCrLf & vbcrlf
  4340. 				If intPlatformHTA = 32 And intPlatformWin = 64 Then
  4341. 					strMsg = strMsg _
  4342. 				           & "This HTA is running in a 32-bit MSHTA process (%windir%\SysWOW64\mshta.exe) on 64-bit Windows." & vbCrLf & vbCrLf _
  4343. 				           & "Add the path to the proper (64-bit) MSHTA to this HTA's command line:" & vbCrLf & vbCrLf
  4344. 				Else
  4345. 					strMsg = strMsg _
  4346. 				           & "Note: On some 64-bit systems, you may still get this message, whether running with elevated privileges or not." & vbCrLf & vbCrLf _
  4347. 				           & "Usually this is caused by HTAs being incorrectly associated with the 32-bit MSHTA version (%windir%\SysWOW64\mshta.exe)." & vbCrLf & vbCrLf _
  4348. 				           & "In that case, either use the ""/NOADMIN"" command line switch, or add the path to the proper (64-bit) MSHTA to this HTA's command line:" & vbCrLf & vbCrLf
  4349. 				End If
  4350. 				strMsg     = strMsg _
  4351. 				           & """%windir%\system32\mshta.exe"" """
  4352. 				If InStr( UCase( Hardware.CommandLine ), "/DEVTEST" ) Then
  4353. 					strMsg = strMsg & "C:\Scripts\Hardware.hta"
  4354. 				Else
  4355. 					strMsg = strMsg & Self.location.pathname
  4356. 				End if
  4357. 				strMsg     = strMsg _
  4358. 				           & """" & vbCrLf & vbCrLf & vbCrLf & vbCrLf _
  4359.  				           & "Do you want to elevate privileges now?" & vbCrLf & vbCrLf _
  4360. 				           & "Yes:"    & vbtab & "Restart the HTA with elevated privileges" & vbCrLf _
  4361. 				           & "No:"     & vbTab & "Continue without elevated privileges"     & vbCrLf _
  4362. 				           & "Cancel:" & vbTab & "Abort"
  4363. 				intAnswer  = MsgBox( strMsg, intButtons, strTitle )
  4364. 				If intAnswer = vbYes Then
  4365. 					strHTA = Self.location.pathname
  4366. 					strCommandLine = Hardware.CommandLine
  4367. 					' Strip HTA file name or path from command line
  4368. 					If InStr( strCommandLine, """" & strHTA & """" ) = 1 Then
  4369. 						strCommandLine = Mid( strCommandLine, Len( strHTA ) + 3 )
  4370. 					ElseIf InStr( strCommandLine, strHTA ) = 1 Then
  4371. 						strCommandLine = Mid( strCommandLine, Len( strHTA ) + 1 )
  4372. 					ElseIf InStr( strCommandLine, """" & gvoFSO.GetFileName( strHTA ) & """" ) = 1 Then
  4373. 						strCommandLine = Mid( strCommandLine, Len( strHTA ) + 3 )
  4374. 					ElseIf InStr( strCommandLine, gvoFSO.GetFileName( strHTA ) ) = 1 Then
  4375. 						strCommandLine = Mid( strCommandLine, Len( strHTA ) + 1 )
  4376. 					ElseIf InStr( strCommandLine, gvoFSO.GetFileName( strHTA ) ) > 0 Then
  4377. 						strCommandLine = Mid( strCommandLine, InStr( strHTA ) + Len( strHTA ) + 1 )
  4378. 						If Left( strCommandLine, 1 ) = """" Then strCommandLine = Mid( strCommandLine, 2 )
  4379. 					Else
  4380. 						' Error: do nothing, the HTA will close
  4381. 					End If
  4382. 					strCommandLine = Replace( Trim( strCommandLine ), """", """""" )
  4383. 					If InStr( UCase( strCommandLine ), "/TEMPDIR:" ) = -1 Then
  4384. 						strCommandLine = "/TEMPDIR:""" & gvaSettingsStr.Item( "TEMPDIR" ) & """ " & strCommandLine
  4385. 					End If
  4386. 					If InStr( UCase( strCommandLine ), "/NOADMIN" ) = -1 Then
  4387. 						strCommandLine = "/NOADMIN " & strCommandLine
  4388. 					End If
  4389.  
  4390. 					' If we don't have elevated privileges yet, and Chrome is the default browser, make sure Chrome is active before elevating this HTA's privileges.
  4391. 					' Failing to do so will block Chrome from opening new unelevated tabs or windows after the first elevated window is opened.
  4392. 					If Not gvbIsElevated And InStr( UCase( gvsDefaultBrowserName ), "CHROME" ) Then
  4393. 						Set colItems = gvoWMIlocalCimv2.ExecQuery( "SELECT * FROM Win32_Process WHERE ExecutablePath='" & Replace( gvsDefaultBrowserPath, "\", "\\" ) & "'" )
  4394. 						If colItems.Count = 0 Then
  4395. 							gvoWSHShell.Run """" & gvsDefaultBrowserPath & """", 7, False
  4396. 						End If
  4397. 						Set colItems = Nothing
  4398. 					End If
  4399.  
  4400. 					' Elevate privileges
  4401. 					Set objUAC = CreateObject( "Shell.Application" )
  4402. 					objUAC.ShellExecute "MSHTA.EXE", """" & strHTA & """ " & strCommandLine, "", "runas", 1
  4403. 					Set objUAC = Nothing
  4404. 					window.close True
  4405. 				ElseIf intAnswer = vbNo Then
  4406. 					IsAdmin = True
  4407. 				End If
  4408. 			End If
  4409. 		End If
  4410. 		On Error GoTo 0
  4411.     End If
  4412. End Function
  4413.  
  4414.  
  4415. Function IsLocalComputer( )
  4416. 	' Check if specified computer is the local computer
  4417. 	IsLocalComputer = False
  4418. 	gvsComputer = CheckComputerName( ComputerName.value )
  4419. 	If gvsComputer = "" Then Exit Function
  4420. 	If gvbWinPE Then
  4421. 		IsLocalComputer                     = True
  4422. 		gvaSettingsBool.Item( "DXDIAG"    ) = False
  4423. 		gvaSettingsBool.Item( "DMIDECODE" ) = False
  4424. 	ElseIf ( gvsComputer = GetLocalComputerName( ) ) Or ( gvsComputer = "LOCALHOST" ) Or ( gvsComputer = "127.0.0.1" ) Or ( gvsComputer = "::1" ) Then
  4425. 		IsLocalComputer                   = True
  4426. 		gvaSettingsStr.Item( "COMPUTER" ) = gvsComputer
  4427. 	Else
  4428. 		IsLocalComputer                     = False
  4429. 		gvaSettingsBool.Item( "DXDIAG"    ) = False
  4430. 		gvaSettingsBool.Item( "DMIDECODE" ) = False
  4431. 		gvaSettingsStr.Item( "COMPUTER" )   = gvsComputer
  4432. 	End If
  4433. 	ConfigUpdateStatus
  4434. End Function
  4435.  
  4436.  
  4437. Sub ListColors( myDropdown, myPreselected )
  4438. 	' Populate a dropdown list with colors available in CSS
  4439. 	Dim i, objDropdown, objOption, strColor
  4440. 	Set objDropdown = document.getElementById( myDropdown )
  4441. 	objDropdown.innerHTML = ""
  4442. 	On Error Resume Next ' REQUIRED
  4443. 	For Each strColor In gvaCSSColors.Keys
  4444. 		Set objOption = document.createElement( "OPTION" )
  4445. 		objOption.text                  = strColor
  4446. 		objOption.value                 = LCase( strColor )
  4447. 		objOption.selected              = ( LCase( myPreselected ) = LCase( strColor ) )
  4448. 		objOption.style.backgroundColor = LCase( strColor )
  4449. 		objOption.style.color           = gvaCSSColors.Item( strColor )
  4450. 		If Not Err Then objDropdown.Add( objOption )
  4451. 		Set objOption = Nothing
  4452. 	Next
  4453. 	On Error Goto 0
  4454. 	Set objDropdown = Nothing
  4455. End Sub
  4456.  
  4457.  
  4458. Sub ListCSSColors( )
  4459. 	' List of available CSS colors by W3Schools.com:
  4460. 	' http://www.w3schools.com/colors/colors_names.asp
  4461. 	' Contrasting text colors calculated with code by Brian Suda:
  4462. 	' https://24ways.org/2010/calculating-color-contrast/
  4463. 	On Error Resume Next ' REQUIRED
  4464. 	Set gvaCSSColors = Nothing
  4465. 	On Error Goto 0
  4466. 	Set gvaCSSColors = CreateObject( "Scripting.Dictionary" )
  4467. 	gvaCSSColors.Item( "AliceBlue" )            = "black"
  4468. 	gvaCSSColors.Item( "AntiqueWhite" )         = "black"
  4469. 	gvaCSSColors.Item( "Aqua" )                 = "black"
  4470. 	gvaCSSColors.Item( "Aquamarine" )           = "black"
  4471. 	gvaCSSColors.Item( "Azure" )                = "black"
  4472. 	gvaCSSColors.Item( "Beige" )                = "black"
  4473. 	gvaCSSColors.Item( "Bisque" )               = "black"
  4474. 	gvaCSSColors.Item( "Black" )                = "white"
  4475. 	gvaCSSColors.Item( "BlanchedAlmond" )       = "black"
  4476. 	gvaCSSColors.Item( "Blue" )                 = "white"
  4477. 	gvaCSSColors.Item( "BlueViolet" )           = "white"
  4478. 	gvaCSSColors.Item( "Brown" )                = "white"
  4479. 	gvaCSSColors.Item( "BurlyWood" )            = "black"
  4480. 	gvaCSSColors.Item( "CadetBlue" )            = "black"
  4481. 	gvaCSSColors.Item( "Chartreuse" )           = "black"
  4482. 	gvaCSSColors.Item( "Chocolate" )            = "white"
  4483. 	gvaCSSColors.Item( "Coral" )                = "black"
  4484. 	gvaCSSColors.Item( "CornflowerBlue" )       = "black"
  4485. 	gvaCSSColors.Item( "Cornsilk" )             = "black"
  4486. 	gvaCSSColors.Item( "Crimson" )              = "white"
  4487. 	gvaCSSColors.Item( "Cyan" )                 = "black"
  4488. 	gvaCSSColors.Item( "DarkBlue" )             = "white"
  4489. 	gvaCSSColors.Item( "DarkCyan" )             = "white"
  4490. 	gvaCSSColors.Item( "DarkGoldenRod" )        = "black"
  4491. 	gvaCSSColors.Item( "DarkGray" )             = "black"
  4492. 	gvaCSSColors.Item( "DarkGrey" )             = "black"
  4493. 	gvaCSSColors.Item( "DarkGreen" )            = "white"
  4494. 	gvaCSSColors.Item( "DarkKhaki" )            = "black"
  4495. 	gvaCSSColors.Item( "DarkMagenta" )          = "white"
  4496. 	gvaCSSColors.Item( "DarkOliveGreen" )       = "white"
  4497. 	gvaCSSColors.Item( "DarkOrange" )           = "black"
  4498. 	gvaCSSColors.Item( "DarkOrchid" )           = "white"
  4499. 	gvaCSSColors.Item( "DarkRed" )              = "white"
  4500. 	gvaCSSColors.Item( "DarkSalmon" )           = "black"
  4501. 	gvaCSSColors.Item( "DarkSeaGreen" )         = "black"
  4502. 	gvaCSSColors.Item( "DarkSlateBlue" )        = "white"
  4503. 	gvaCSSColors.Item( "DarkSlateGray" )        = "white"
  4504. 	gvaCSSColors.Item( "DarkSlateGrey" )        = "white"
  4505. 	gvaCSSColors.Item( "DarkTurquoise" )        = "black"
  4506. 	gvaCSSColors.Item( "DarkViolet" )           = "white"
  4507. 	gvaCSSColors.Item( "DeepPink" )             = "white"
  4508. 	gvaCSSColors.Item( "DeepSkyBlue" )          = "black"
  4509. 	gvaCSSColors.Item( "DimGray" )              = "white"
  4510. 	gvaCSSColors.Item( "DimGrey" )              = "white"
  4511. 	gvaCSSColors.Item( "DodgerBlue" )           = "white"
  4512. 	gvaCSSColors.Item( "FireBrick" )            = "white"
  4513. 	gvaCSSColors.Item( "FloralWhite" )          = "black"
  4514. 	gvaCSSColors.Item( "ForestGreen" )          = "white"
  4515. 	gvaCSSColors.Item( "Fuchsia" )              = "white"
  4516. 	gvaCSSColors.Item( "Gainsboro" )            = "black"
  4517. 	gvaCSSColors.Item( "GhostWhite" )           = "black"
  4518. 	gvaCSSColors.Item( "Gold" )                 = "black"
  4519. 	gvaCSSColors.Item( "GoldenRod" )            = "black"
  4520. 	gvaCSSColors.Item( "Gray" )                 = "black"
  4521. 	gvaCSSColors.Item( "Grey" )                 = "black"
  4522. 	gvaCSSColors.Item( "Green" )                = "white"
  4523. 	gvaCSSColors.Item( "GreenYellow" )          = "black"
  4524. 	gvaCSSColors.Item( "HoneyDew" )             = "black"
  4525. 	gvaCSSColors.Item( "HotPink" )              = "black"
  4526. 	gvaCSSColors.Item( "IndianRed" )            = "white"
  4527. 	gvaCSSColors.Item( "Indigo" )               = "white"
  4528. 	gvaCSSColors.Item( "Ivory" )                = "black"
  4529. 	gvaCSSColors.Item( "Khaki" )                = "black"
  4530. 	gvaCSSColors.Item( "Lavender" )             = "black"
  4531. 	gvaCSSColors.Item( "LavenderBlush" )        = "black"
  4532. 	gvaCSSColors.Item( "LawnGreen" )            = "black"
  4533. 	gvaCSSColors.Item( "LemonChiffon" )         = "black"
  4534. 	gvaCSSColors.Item( "LightBlue" )            = "black"
  4535. 	gvaCSSColors.Item( "LightCoral" )           = "black"
  4536. 	gvaCSSColors.Item( "LightCyan" )            = "black"
  4537. 	gvaCSSColors.Item( "LightGoldenRodYellow" ) = "black"
  4538. 	gvaCSSColors.Item( "LightGray" )            = "black"
  4539. 	gvaCSSColors.Item( "LightGrey" )            = "black"
  4540. 	gvaCSSColors.Item( "LightGreen" )           = "black"
  4541. 	gvaCSSColors.Item( "LightPink" )            = "black"
  4542. 	gvaCSSColors.Item( "LightSalmon" )          = "black"
  4543. 	gvaCSSColors.Item( "LightSeaGreen" )        = "black"
  4544. 	gvaCSSColors.Item( "LightSkyBlue" )         = "black"
  4545. 	gvaCSSColors.Item( "LightSlateGray" )       = "black"
  4546. 	gvaCSSColors.Item( "LightSlateGrey" )       = "black"
  4547. 	gvaCSSColors.Item( "LightSteelBlue" )       = "black"
  4548. 	gvaCSSColors.Item( "LightYellow" )          = "black"
  4549. 	gvaCSSColors.Item( "Lime" )                 = "black"
  4550. 	gvaCSSColors.Item( "LimeGreen" )            = "black"
  4551. 	gvaCSSColors.Item( "Linen" )                = "black"
  4552. 	gvaCSSColors.Item( "Magenta" )              = "white"
  4553. 	gvaCSSColors.Item( "Maroon" )               = "white"
  4554. 	gvaCSSColors.Item( "MediumAquaMarine" )     = "black"
  4555. 	gvaCSSColors.Item( "MediumBlue" )           = "white"
  4556. 	gvaCSSColors.Item( "MediumOrchid" )         = "black"
  4557. 	gvaCSSColors.Item( "MediumPurple" )         = "black"
  4558. 	gvaCSSColors.Item( "MediumSeaGreen" )       = "black"
  4559. 	gvaCSSColors.Item( "MediumSlateBlue" )      = "white"
  4560. 	gvaCSSColors.Item( "MediumSpringGreen" )    = "black"
  4561. 	gvaCSSColors.Item( "MediumTurquoise" )      = "black"
  4562. 	gvaCSSColors.Item( "MediumVioletRed" )      = "white"
  4563. 	gvaCSSColors.Item( "MidnightBlue" )         = "white"
  4564. 	gvaCSSColors.Item( "MintCream" )            = "black"
  4565. 	gvaCSSColors.Item( "MistyRose" )            = "black"
  4566. 	gvaCSSColors.Item( "Moccasin" )             = "black"
  4567. 	gvaCSSColors.Item( "NavajoWhite" )          = "black"
  4568. 	gvaCSSColors.Item( "Navy" )                 = "white"
  4569. 	gvaCSSColors.Item( "OldLace" )              = "black"
  4570. 	gvaCSSColors.Item( "Olive" )                = "white"
  4571. 	gvaCSSColors.Item( "OliveDrab" )            = "white"
  4572. 	gvaCSSColors.Item( "Orange" )               = "black"
  4573. 	gvaCSSColors.Item( "OrangeRed" )            = "white"
  4574. 	gvaCSSColors.Item( "Orchid" )               = "black"
  4575. 	gvaCSSColors.Item( "PaleGoldenRod" )        = "black"
  4576. 	gvaCSSColors.Item( "PaleGreen" )            = "black"
  4577. 	gvaCSSColors.Item( "PaleTurquoise" )        = "black"
  4578. 	gvaCSSColors.Item( "PaleVioletRed" )        = "black"
  4579. 	gvaCSSColors.Item( "PapayaWhip" )           = "black"
  4580. 	gvaCSSColors.Item( "PeachPuff" )            = "black"
  4581. 	gvaCSSColors.Item( "Peru" )                 = "black"
  4582. 	gvaCSSColors.Item( "Pink" )                 = "black"
  4583. 	gvaCSSColors.Item( "Plum" )                 = "black"
  4584. 	gvaCSSColors.Item( "PowderBlue" )           = "black"
  4585. 	gvaCSSColors.Item( "Purple" )               = "white"
  4586. 	gvaCSSColors.Item( "RebeccaPurple" )        = "white"
  4587. 	gvaCSSColors.Item( "Red" )                  = "white"
  4588. 	gvaCSSColors.Item( "RosyBrown" )            = "black"
  4589. 	gvaCSSColors.Item( "RoyalBlue" )            = "white"
  4590. 	gvaCSSColors.Item( "SaddleBrown" )          = "white"
  4591. 	gvaCSSColors.Item( "Salmon" )               = "black"
  4592. 	gvaCSSColors.Item( "SandyBrown" )           = "black"
  4593. 	gvaCSSColors.Item( "SeaGreen" )             = "white"
  4594. 	gvaCSSColors.Item( "SeaShell" )             = "black"
  4595. 	gvaCSSColors.Item( "Sienna" )               = "white"
  4596. 	gvaCSSColors.Item( "Silver" )               = "black"
  4597. 	gvaCSSColors.Item( "SkyBlue" )              = "black"
  4598. 	gvaCSSColors.Item( "SlateBlue" )            = "white"
  4599. 	gvaCSSColors.Item( "SlateGray" )            = "white"
  4600. 	gvaCSSColors.Item( "SlateGrey" )            = "white"
  4601. 	gvaCSSColors.Item( "Snow" )                 = "black"
  4602. 	gvaCSSColors.Item( "SpringGreen" )          = "black"
  4603. 	gvaCSSColors.Item( "SteelBlue" )            = "white"
  4604. 	gvaCSSColors.Item( "Tan" )                  = "black"
  4605. 	gvaCSSColors.Item( "Teal" )                 = "white"
  4606. 	gvaCSSColors.Item( "Thistle" )              = "black"
  4607. 	gvaCSSColors.Item( "Tomato" )               = "black"
  4608. 	gvaCSSColors.Item( "Turquoise" )            = "black"
  4609. 	gvaCSSColors.Item( "Violet" )               = "black"
  4610. 	gvaCSSColors.Item( "Wheat" )                = "black"
  4611. 	gvaCSSColors.Item( "White" )                = "black"
  4612. 	gvaCSSColors.Item( "WhiteSmoke" )           = "black"
  4613. 	gvaCSSColors.Item( "Yellow" )               = "black"
  4614. 	gvaCSSColors.Item( "YellowGreen" )          = "black"
  4615. End Sub
  4616.  
  4617.  
  4618. Function Max( num1, num2 )
  4619. 	If CInt( num1 ) > CInt( num2 ) Then
  4620. 		Max = CInt( num1 )
  4621. 	Else
  4622. 		Max = CInt( num2 )
  4623. 	End If
  4624. End Function
  4625.  
  4626.  
  4627. Function Min( num1, num2 )
  4628. 	If CInt( num1 ) < CInt( num2 ) Then
  4629. 		Min = CInt( num1 )
  4630. 	Else
  4631. 		Min = CInt( num2 )
  4632. 	End If
  4633. End Function
  4634.  
  4635.  
  4636. Sub OnClick_CheckboxDMIDecode( )
  4637. 	If gvbWinPE Then
  4638. 		CheckboxDMIDecode.checked  = False
  4639. 		CheckboxDMIDecode.disabled = True
  4640. 	End If
  4641. End Sub
  4642.  
  4643.  
  4644. Sub OnClick_CheckboxDxDiag( )
  4645. 	If gvbWinPE Then
  4646. 		CheckboxDxDiag.checked   = False
  4647. 		CheckboxDxDiag.disabled  = True
  4648. 		CheckboxKeepXML.checked  = False
  4649. 		CheckboxKeepXML.disabled = True
  4650. 	End If
  4651. 	CheckboxKeepXML.checked  = CheckboxKeepXML.checked And CheckboxDxDiag.checked
  4652. 	If CheckboxDxDiag.checked Then
  4653. 		TablerowKeepXML.style.display       = "table-row"
  4654. 		TablerowKeepXML.style.visibility    = "visible"
  4655. 		TablerowDxDiagPath.style.display    = "table-row"
  4656. 		TablerowDxDiagPath.style.visibility = "visible"
  4657. 	Else
  4658. 		gvaSettingsStr.Item( "XML" )        = gvaDefaultsStr.Item( "XML" )
  4659. 		TablerowKeepXML.style.display       = "none"
  4660. 		TablerowKeepXML.style.visibility    = "collapse"
  4661. 		TablerowDxDiagPath.style.display    = "none"
  4662. 		TablerowDxDiagPath.style.visibility = "collapse"
  4663. 	End If
  4664. 	InputDxDiag.value = gvaSettingsStr.Item( "XML" )
  4665. End Sub
  4666.  
  4667.  
  4668. Sub PasteFromClipboard
  4669. 	Dim strText
  4670. 	On Error Resume Next ' REQUIRED
  4671. 	strText = Document.ParentWindow.ClipboardData.GetData( "text" )
  4672. 	If Err Then
  4673. 		MsgBox "An error occurred while trying to paste data from the clipboard:" & vbCrLf & vbCrLf & Err.Description, vbOKOnly, "Clipboard Error"
  4674. 	Else
  4675. 		If Not IsNull( strText ) Then ComputerName.value = strText
  4676. 	End If
  4677. 	On Error Goto 0
  4678. End Sub
  4679.  
  4680.  
  4681. Sub Print( )
  4682. 	' Build an HTML table with the results, to allow printing
  4683. 	Dim arrData, arrHeader, i, j, objPrintFile, strHTML, strTable
  4684.  
  4685. 	' Create a temporary HTML file and open it in the default browser
  4686. 	strHTML = "<html>" _
  4687. 	        & "<head>" _
  4688. 	        & "<title>Basic Hardware Inventory " & Hardware.Version & " - &copy; 2005 - " & COPYRIGHTS_YEAR & " Rob van der Woude</title>" & vbCrLf _
  4689. 	        & "<style type=""text/css"">"          & vbCrLf _
  4690. 	        & ".Odd { background-color: silver; }" & vbCrLf _
  4691. 	        & "</style>"    & vbCrLf _
  4692. 	        & "</head>"     & vbCrLf _
  4693. 	        & "<body>"      & vbCrLf _
  4694. 	        & PrintTable( )          _
  4695. 	        & "</body>"     & vbCrLf _
  4696. 	        & "</html>"     & vbCrLf
  4697.  
  4698. 	Set objPrintFile = gvoFSO.CreateTextFile( gvsPrintFile )
  4699. 	objPrintFile.Write( strHTML )
  4700. 	objPrintFile.Close
  4701. 	Set objPrintFile = Nothing
  4702. 	gvoWSHShell.Run gvsPrintFile, 7, False
  4703. End Sub
  4704.  
  4705.  
  4706. Function PrintTable( )
  4707. 	Dim arrData, arrHeader, i, strClass, strTable
  4708. 	strTable  = "<table style=""border: 1px solid black; width: 100%;"">" & vbCrLf
  4709. 	strTable  = strTable _
  4710. 	          & "<thead style=""font-weight: bold; font-size: 120%; display: table-header-group; page-break-before: always;"">" & vbCrLf _
  4711. 	          & "<tr class=""Odd"" style=""page-break-inside: avoid;"">" & vbCrLf _
  4712. 	          & "    <th style=""page-break-inside: avoid; border: 1px solid black;"">Component</th>" & vbCrLf _
  4713. 	          & "    <th style=""page-break-inside: avoid; border: 1px solid black;"">Value</th>"     & vbCrLf _
  4714. 	          & "</tr>"    & vbCrLf _
  4715. 	          & "</thead>" & vbCrLf _
  4716. 	          & "<tbody>"  & vbCrLf
  4717. 	arrData   = Split( gvsCSVTxt, vbTab, -1, 1 )
  4718. 	arrHeader = Split( gvsHeader, vbTab, -1, 1 )
  4719. 	For i = 0 To Min( UBound( arrHeader ), UBound( arrData ) )
  4720. 		If i Mod 2 = 0 Then
  4721. 			strClass = ""
  4722. 		Else
  4723. 			strClass = " class=""Odd"""
  4724. 		End If
  4725. 		strTable = strTable _
  4726. 		         & "<tr" & strClass & " style=""page-break-inside: avoid;"">" & vbCrLf _
  4727. 		         & "    <th style=""page-break-inside: avoid; border: 1px solid black; text-align: left; padding: 5px;"">" & arrHeader(i) & "</th>" & vbCrLf _
  4728. 		         & "    <td style=""page-break-inside: avoid; border: 1px solid black; text-align: left; padding: 5px;"">" & arrData(i)   & "</td>" & vbCrLf _
  4729. 		         & "</tr>" & vbCrLf
  4730. 	Next
  4731. 	strTable = strTable _
  4732. 	         & "</tbody>" & vbCrLf _
  4733. 	         & "</table>" & vbCrLf
  4734. 	PrintTable = strTable
  4735. End Function
  4736.  
  4737.  
  4738. Sub Reset( )
  4739. 	window_onunload
  4740. 	Location.Reload True
  4741. End Sub
  4742.  
  4743.  
  4744. Sub SaveSettings( )
  4745. 	ConfigSaveChanges
  4746. 	ConfigSaveFile
  4747. 	ConfigUpdateStatus
  4748. 	ShowMain
  4749. End Sub
  4750.  
  4751.  
  4752. Function SaveTabDelimited( )
  4753. 	Dim objFile, strFile, strMsg, strWinPE
  4754. 	SaveTabDelimited = ""
  4755. 	If gvbWinPE Then
  4756. 		strWinPE = ".WinPE."
  4757. 	Else
  4758. 		strWinPE = "."
  4759. 	End If
  4760. 	If gvaSettingsStr.Item( "SAVE" ) = "*" Or gvaSettingsStr.Item( "SAVE" ) = "" Then
  4761. 		strFile = gvoFSO.BuildPath( gvoFSO.GetParentFolderName( Self.location.pathname ), "Hardware." & gvaDefaultsStr.Item( "COMPUTER" ) & strWinPE & Replace( Replace( TimeStamp( ), ":", "" ), " ", "_" ) & ".txt" )
  4762. 	ElseIf Right( gvaSettingsStr.Item( "SAVE" ), 2 ) = "\*" Then
  4763. 		strFile = Left( gvaSettingsStr.Item( "SAVE" ), Len( gvaSettingsStr.Item( "SAVE" ) ) - 1 ) & "Hardware." & gvaDefaultsStr.Item( "COMPUTER" ) & strWinPE & TimeStamp( ) & ".txt"
  4764. 	Else
  4765. 		strFile = gvaSettingsStr.Item( "SAVE" )
  4766. 	End If
  4767. 	If InStr( gvaSettingsStr.Item( "SAVE" ), "\" ) = -1 Then
  4768. 		strFile = gvoFSO.BuildPath( gvoFSO.GetParentFolderName( Self.location.pathname ), strFile )
  4769. 	End If
  4770. 	If strFile <> "" Then
  4771. 		If Left( strFile, 1 )  = """" Then strFile = Mid( strFile, 2 )
  4772. 		If Right( strFile, 1 ) = """" Then strFile = Left( strFile, Len( strFile ) - 1 )
  4773. 	End If
  4774. 	With gvoFSO
  4775. 		If .FolderExists( .GetParentFolderName( strFile ) ) Then
  4776. 			On Error Resume Next ' REQUIRED
  4777. 			strFile = .GetAbsolutePathName( strFile )
  4778. 			Set objFile = .CreateTextFile( strFile, True, False )
  4779. 			If Err Then
  4780. 				strMsg = "Error #" & Err.Number & " while trying to save the results to """ & strFile & """:"
  4781. 				strMsg = strMsg & vbCrLf & Err.Description
  4782. 				MsgBox strMsg, vbOKOnly, "File Save Error"
  4783. 				strFile = ""
  4784. 			Else
  4785. 				objFile.WriteLine gvsHeader
  4786. 				objFile.WriteLine gvsCSVTxt
  4787. 				objFile.Close
  4788. 				If Not gvbSilent Then MsgBox "File """ & strFile & """ successfully saved.", vbOKOnly, "File Saved"
  4789. 			End If
  4790. 			Set objFile = Nothing
  4791. 			On Error Goto 0
  4792. 		Else
  4793. 			MsgBox "Folder """ & .GetParentFolderName( strFile ) & """ does not exist.", vbOKOnly, "File save error"
  4794. 			strFile = ""
  4795. 		End If
  4796. 	End With
  4797. 	SaveTabDelimited = strFile
  4798. End Function
  4799.  
  4800.  
  4801. Sub SetCustomColor( myDropdown )
  4802. 	Dim arrCustomColors, colElements, objDropdown, objElement, objOption
  4803. 	arrCustomColors = Split( gvaSettingsStr.Item( "CUSTOMCOLORS" ), ";" )
  4804. 	Set objDropdown = document.getElementById( myDropdown )
  4805. 	For Each objOption In objDropdown.options
  4806. 		If objOption.selected Then
  4807. 			Select Case myDropdown
  4808. 				Case "BackgroundColor":
  4809. 					document.body.style.backgroundColor = arrCustomColors(0)
  4810. 				Case "CaptionsColor":
  4811. 					document.body.style.color = arrCustomColors(1)
  4812. 				Case "LinksColor":
  4813. 					Set colElements = document.getElementsByTagName( "a" )
  4814. 					For Each objElement In colElements
  4815. 						objElement.style.color = arrCustomColors(2)
  4816. 					Next
  4817. 					Set colElements = Nothing
  4818. 				Case "ButtonFaceColor":
  4819. 					Set colElements = document.getElementsByTagName( "input" )
  4820. 					For Each objElement In colElements
  4821. 						If objElement.type = "button" Then
  4822. 							objElement.style.backgroundColor = arrCustomColors(3)
  4823. 						End If
  4824. 					Next
  4825. 					Set colElements = Nothing
  4826. 				Case "ButtonCaptionsColor":
  4827. 					Set colElements = document.getElementsByTagName( "input" )
  4828. 					For Each objElement In colElements
  4829. 						If objElement.type = "button" Then
  4830. 							objElement.style.color = arrCustomColors(4)
  4831. 						End If
  4832. 					Next
  4833. 					Set colElements = Nothing
  4834. 				Case "CodeColor":
  4835. 					Set colElements = document.getElementsByTagName( "code" )
  4836. 					For Each objElement In colElements
  4837. 						objElement.style.color = arrCustomColors(5)
  4838. 					Next
  4839. 					Set colElements = Nothing
  4840. 			End Select
  4841. 		End If
  4842. 	Next
  4843. 	Set objDropdown = Nothing
  4844. End Sub
  4845.  
  4846.  
  4847. Sub SetCustomTheme( )
  4848. 	Dim objOption, strCustomColors
  4849. 	ThemeBlue.checked   = False
  4850. 	ThemeBW.checked     = False
  4851. 	ThemeRed.checked    = False
  4852. 	ThemeCustom.checked = True
  4853. 	gvaSettingsStr.Item( "THEME" ) = "ThemeCustom"
  4854. 	For Each objOption In BackgroundColor.options
  4855. 		If objOption.selected Then strCustomColors = objOption.value
  4856. 	Next
  4857. 	For Each objOption In CaptionsColor.options
  4858. 		If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  4859. 	Next
  4860. 	For Each objOption In LinksColor.options
  4861. 		If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  4862. 	Next
  4863. 	For Each objOption In ButtonFaceColor.options
  4864. 		If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  4865. 	Next
  4866. 	For Each objOption In ButtonCaptionsColor.options
  4867. 		If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  4868. 	Next
  4869. 	For Each objOption In CodeColor.options
  4870. 		If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  4871. 	Next
  4872. 	gvaSettingsStr.Item( "CUSTOMCOLORS" ) = LCase( strCustomColors )
  4873. End Sub
  4874.  
  4875.  
  4876. Sub SetTheme( )
  4877. 	If ThemeBW.checked Then
  4878. 		If gvaSettingsStr.Item( "THEME" ) = "ThemeBlue" Then
  4879. 			Exit Sub
  4880. 		Else
  4881. 			gvaSettingsStr.Item( "THEME" ) = "ThemeBlue"
  4882. 		End If
  4883. 	ElseIf ThemeBW.checked Then
  4884. 		If gvaSettingsStr.Item( "THEME" ) = "ThemeBW" Then
  4885. 			Exit Sub
  4886. 		Else
  4887. 			gvaSettingsStr.Item( "THEME" ) = "ThemeBW"
  4888. 		End If
  4889. 	ElseIf ThemeCustom.checked Then
  4890. 		gvaSettingsStr.Item( "THEME" ) = "ThemeCustom"
  4891. 	ElseIf ThemeDark.checked Then
  4892. 		If gvaSettingsStr.Item( "THEME" ) = "ThemeDark" Then
  4893. 			Exit Sub
  4894. 		Else
  4895. 			gvaSettingsStr.Item( "THEME" ) = "ThemeDark"
  4896. 		End If
  4897. 	ElseIf ThemeRed.checked Then
  4898. 		If gvaSettingsStr.Item( "THEME" ) = "ThemeRed" Then
  4899. 			Exit Sub
  4900. 		Else
  4901. 			gvaSettingsStr.Item( "THEME" ) = "ThemeRed"
  4902. 		End If
  4903. 	ElseIf Not gvaSettingsStr.Item( "THEME" ) = "ThemeBW" Then
  4904. 		gvaSettingsStr.Item( "THEME" ) = "ThemeBW"
  4905. 	End If
  4906. End Sub
  4907.  
  4908.  
  4909. Sub ShowCredits( )
  4910. 	MainScreen.style.display     = "none"
  4911. 	SettingsScreen.style.display = "none"
  4912. 	HelpScreen.style.display     = "none"
  4913. 	CreditsScreen.style.display  = "block"
  4914. 	Back.style.display           = "block"
  4915. End Sub
  4916.  
  4917.  
  4918. Sub ShowDonate( )
  4919. 	gvoWSHShell.Run "https://www.robvanderwoude.com/donate.php", 7, False
  4920. End Sub
  4921.  
  4922.  
  4923. Sub ShowHelp( )
  4924. 	MainScreen.style.display     = "none"
  4925. 	SettingsScreen.style.display = "none"
  4926. 	HelpScreen.style.display     = "block"
  4927. 	CreditsScreen.style.display  = "none"
  4928. 	Back.style.display           = "block"
  4929. End Sub
  4930.  
  4931.  
  4932. Sub ShowMain( )
  4933. 	MainScreen.style.display     = "block"
  4934. 	SettingsScreen.style.display = "none"
  4935. 	HelpScreen.style.display     = "none"
  4936. 	CreditsScreen.style.display  = "none"
  4937. 	Back.style.display           = "none"
  4938. End Sub
  4939.  
  4940.  
  4941. Sub ShowSettings( )
  4942. 	MainScreen.style.display     = "none"
  4943. 	SettingsScreen.style.display = "block"
  4944. 	HelpScreen.style.display     = "none"
  4945. 	CreditsScreen.style.display  = "none"
  4946. 	Back.style.display           = "none"
  4947. 	ButtonEditCfg.disabled = Not gvoFSO.FileExists( gvsConfigFile )
  4948. 	If gvaSettingsBool.Item( "DEVTEST" ) Then
  4949. 		InputDxDiag.value  = "C:\Scripts\Hardware.xml"
  4950. 	End If
  4951. 	If InputDxDiag.value = "" Then
  4952. 		ButtonDeleteXML.disabled = True
  4953. 	Else
  4954. 		If gvoFSO.FileExists( InputDxDiag.value ) Then
  4955. 			ButtonDeleteXML.disabled = False
  4956. 		Else
  4957. 			ButtonDeleteXML.disabled = True
  4958. 		End If
  4959. 	End If
  4960. 	ButtonReset.disabled = ConfigTestIfDefault( )
  4961. End Sub
  4962.  
  4963.  
  4964. Sub Sleep( seconds )
  4965. 	Dim objShell, strCmd
  4966. 	Set objShell = CreateObject( "Wscript.Shell" )
  4967. 	strCmd = "%COMSPEC% /C PING -n " & seconds & " localhost > NUL 2>&1"
  4968. 	objShell.Run strCmd, 0, 1
  4969. 	Set objShell = Nothing
  4970. End Sub
  4971.  
  4972.  
  4973. Function TextFromHTML( myURL )
  4974. 	Dim objHTTP
  4975. 	TextFromHTML = ""
  4976. 	On Error Resume Next ' REQUIRED
  4977. 	Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" )
  4978. 	objHTTP.Open "GET", myURL
  4979. 	objHTTP.Send
  4980. 	If Err Then gvbConnected = False
  4981. 	' Check if the result was valid, and if so return the result
  4982. 	If objHTTP.Status = 200 Then TextFromHTML = objHTTP.ResponseText
  4983. 	Set objHTTP = Nothing
  4984. 	On Error Goto 0
  4985. End Function
  4986.  
  4987.  
  4988. Function TimeStamp( )
  4989. 	TimeStamp = Year( Now ) _
  4990. 	          & "-" _
  4991. 	          & Right( "0" & Month(  Now ), 2 ) _
  4992. 	          & "-" _
  4993. 	          & Right( "0" & Day(    Now ), 2 ) _
  4994. 	          & " " _
  4995. 	          & Right( "0" & Hour(   Now ), 2 ) _
  4996. 	          & ":" _
  4997. 	          & Right( "0" & Minute( Now ), 2 ) _
  4998. 	          & ":" _
  4999. 	          & Right( "0" & Second( Now ), 2 )
  5000. End Function
  5001.  
  5002.  
  5003. Sub ValidateZoomFactor( )
  5004. 	Dim intZoomFactor, objRE
  5005. 	intZoomFactor = Trim( InputZoomFactor.value )
  5006. 	Set objRE = New RegExp
  5007. 	objRE.Pattern = "[^\d]"
  5008. 	objRE.Global  = True
  5009. 	If Not objRE.Replace( intZoomFactor, "" ) = intZoomFactor Then
  5010. 		intZoomFactor = objRE.Replace( intZoomFactor, "" )
  5011. 	End If
  5012. 	Set objRE = Nothing
  5013. 	If intZoomFactor > 250 Then
  5014. 		intZoomFactor = 250
  5015. 	End If
  5016. 	If Not intZoomFactor = InputZoomFactor.value Then
  5017. 		InputZoomFactor.value = intZoomFactor
  5018. 	End If
  5019. End Sub
  5020.  
  5021.  
  5022. Sub window_onunload
  5023. 	On Error Resume Next ' REQUIRED
  5024. 	' Delete DxDiag's XML file if it exists, unless /KEEPXML switch was used
  5025. 	If gvaSettingsBool.Item( "DXDIAG" ) Then
  5026. 		If Not gvaSettingsBool.Item( "KEEPXML" ) Then
  5027. 			If Trim( gvaSettingsStr.Item( "XML" ) ) <> "" Then
  5028. 				If gvoFSO.FileExists( gvaSettingsStr.Item( "XML" ) ) Then
  5029. 					gvoFSO.DeleteFile gvaSettingsStr.Item( "XML" ), True
  5030. 				End If
  5031. 			End If
  5032. 		End If
  5033. 	End If
  5034. 	' Delete temporary files
  5035. 	With gvoFSO
  5036. 		If .FileExists( gvsDetailsFile ) Then .DeleteFile gvsDetailsFile, True
  5037. 		If .FileExists( gvsPrintFile )   Then .DeleteFile gvsPrintFile,   True
  5038. 	End With
  5039. 	' "Gracefully" close objects
  5040. 	Set gvaCSSColors             = Nothing
  5041. 	Set gvaDefaultsBool          = Nothing
  5042. 	Set gvaSettingsBool          = Nothing
  5043. 	Set gvaSettingsStr           = Nothing
  5044. 	Set gvoFSO                   = Nothing
  5045. 	Set gvoWMIlocalCimv2         = Nothing
  5046. 	Set gvoWMIrootCimv2          = Nothing
  5047. 	Set gvoWMIrootMSWinStorage   = Nothing
  5048. 	Set gvoWMIrootStandardCimv2  = Nothing
  5049. 	Set gvoWMIrootWMI            = Nothing
  5050. 	Set gvoWSHShell              = Nothing
  5051. 	Set gvoHDDInterfaces         = Nothing
  5052. 	Set gvoRandom                = Nothing
  5053. 	On Error Goto 0
  5054. End Sub
  1. </script>
  2.  
  3. <body onhelp="vbscript:ShowHelp" onkeydown="vbscript:CheckKey">
  4.  
  5. <div align="center">
  6.  
  7. <div id="MainScreen" class="DontPrint">
  8.  
  9. <table>
  10. <tr>
  11.     <td><input id="ButtonPaste" class="Button" type="button" value="Paste" onclick="vbscript:PasteFromClipboard" title="Click here to paste a remote computer name from the clipboard into the Computer Name field. Then click the [Go] button to start the inventory." /></td>
  12.     <td>&nbsp;</td>
  13.     <td><strong>Computer:</strong></td>
  14.     <td>&nbsp;</td>
  15.     <td><input id="ComputerName" size="20" type="text" oncontextmenu="javascript:this.select();" title="Paste or type a remote computer name, or leave this field blank to query the local computer. Then click the [Go] button to start the inventory." onkeypress="vbscript:CheckKey" /></td>
  16.     <td>&nbsp;</td>
  17.     <td><input id="ButtonBasic" class="Button" type="button" value="Basic" onclick="vbscript:Basic" title="Click this button to toggle between Basic and Full Inventory." accesskey="b" /></td>
  18.     <td>&nbsp;</td>
  19.     <td><input id="ButtonRun" class="Button" type="button" value="Go" onclick="vbscript:Inventory" title="Click here to start the inventory" accesskey="g" /></td>
  20. </tr>
  21. </table>
  22.  
  23. <table id="Results" class="Center">
  24. <thead>
  25. <tr>
  26.     <td colspan="17">&nbsp;</td>
  27. </tr>
  28. </thead>
  29. <tbody>
  30. <tr id="CPUHeader">
  31.     <td colspan="4">&nbsp;</td>
  32.     <td>Number:</td>
  33.     <td>&nbsp;&nbsp;</td>
  34.     <td colspan="3">Model:</td>
  35.     <td>&nbsp;&nbsp;</td>
  36.     <td>Speed (MHz):</td>
  37.     <td>&nbsp;&nbsp;</td>
  38.     <td>Socket:</td>
  39.     <td>&nbsp;&nbsp;</td>
  40.     <td class="Scores" title="This read-only field will display the Windows System Assessment Tool (WinSAT) CPU score.">Score:</td>
  41.     <td class="Scores">&nbsp;</td>
  42.     <td>&nbsp;</td>
  43. </tr>
  44. <tr id="CPURow">
  45.     <td><input type="checkbox" id="CheckboxCPU" checked title="Deselect this checkbox if you want to exclude the processor(s) from the inventory." /></td>
  46.     <td><label for="CheckboxCPU">&nbsp;&nbsp;</label></td>
  47.     <th class="Left"><label for="CheckboxCPU">CPU<span id="MultipleCPUs" style="display: none;">s</span>:</label></th>
  48.     <td>&nbsp;&nbsp;</td>
  49.     <td><input type="text" oncontextmenu="javascript:this.select();" id="CPUNumber" size="12" readonly title="This read-only field will display the number of (logical) processors found. For processors with hyperthreading the displayed number will be twice the number of physical processors." /></td>
  50.     <td>&nbsp;&nbsp;</td>
  51.     <td colspan="3"><input type="text" oncontextmenu="javascript:this.select();" id="CPUModel"  size="40" readonly title="This read-only field will display the processor type." /></td>
  52.     <td>&nbsp;&nbsp;</td>
  53.     <td><input type="text" oncontextmenu="javascript:this.select();" id="CPUSpeed"  size="16" readonly title="This read-only field will display the processor clock speed in MHz." /></td>
  54.     <td>&nbsp;&nbsp;</td>
  55.     <td><input type="text" oncontextmenu="javascript:this.select();" id="CPUSocket" size="16" readonly title="This read-only field will display the processor socket type." /></td>
  56.     <td>&nbsp;&nbsp;</td>
  57.     <td class="Scores"><input type="text" oncontextmenu="javascript:this.select();" id="CPUScore" size="3" readonly title="This read-only field will display the Windows System Assessment Tool (WinSAT) CPU score." style="text-align: right;" /></td>
  58.     <td class="Scores">&nbsp;</td>
  59.     <td><input id="ButtonDetailsCPU" class="Button" type="button" value=" Details " onclick="vbscript:DetailsCPU" title="Click here to display more processor details in a separate window." /></td>
  60. </tr>
  61. <tr id="CPUFooter">
  62.     <td colspan="14">&nbsp;</td>
  63.     <td class="Scores">&nbsp;</td>
  64.     <td class="Scores">&nbsp;</td>
  65.     <td>&nbsp;</td>
  66. </tr>
  67. <tr id="MemHeader">
  68.     <td colspan="4">&nbsp;</td>
  69.     <td>Banks:</td>
  70.     <td>&nbsp;</td>
  71.     <td>Modules:</td>
  72.     <td>&nbsp;</td>
  73.     <td>Total (MB):</td>
  74.     <td>&nbsp;</td>
  75.     <td>Speed (ns):</td>
  76.     <td>&nbsp;</td>
  77.     <td>Form Factor:</td>
  78.     <td>&nbsp;&nbsp;</td>
  79.     <td class="Scores" title="This read-only field will display the Windows System Assessment Tool (WinSAT) Memory Score.">Score:</td>
  80.     <td class="Scores">&nbsp;</td>
  81.     <td>&nbsp;</td>
  82. </tr>
  83. <tr id="MemRow">
  84.     <td><input type="checkbox" id="CheckboxMemory" checked title="Deselect this checkbox if you want to exclude the memory from the inventory." /></td>
  85.     <td><label for="CheckboxMemory">&nbsp;&nbsp;</label></td>
  86.     <th class="Left"><label for="CheckboxMemory">Memory:</label></th>
  87.     <td>&nbsp;</td>
  88.     <td><input type="text" oncontextmenu="javascript:this.select();" id="MemoryBanks" size="12" readonly title="This read-only field will display the number of memory banks (sockets total)." /></td>
  89.     <td>&nbsp;</td>
  90. 	<td><input type="text" oncontextmenu="javascript:this.select();" id="MemoryModules" size="16" readonly title="This read-only field will display the number of memory modules (sockets used)." /></td>
  91. 	<td>&nbsp;</td>
  92.    	<td><input type="text" oncontextmenu="javascript:this.select();" id="MemorySize" size="16" readonly title="This read-only field will display the total amount of physical memory in MB." /></td>
  93.     <td>&nbsp;</td>
  94.     <td><input type="text" oncontextmenu="javascript:this.select();" id="MemorySpeed" size="16" readonly title="This read-only field will display the memory speed in ns." /></td>
  95.     <td>&nbsp;</td>
  96.     <td><input type="text" oncontextmenu="javascript:this.select();" id="MemoryFormFactor" size="16" readonly title="This read-only field will display the memory modules' form factor." /></td>
  97.     <td>&nbsp;</td>
  98.     <td class="Scores"><input type="text" oncontextmenu="javascript:this.select();" id="MemoryScore" size="3" readonly title="This read-only field will display the Windows System Assessment Tool (WinSAT) Memory Score." style="text-align: right;" /></td>
  99.     <td class="Scores">&nbsp;</td>
  100.     <td><input id="ButtonDetailsMemory" class="Button" type="button" value=" Details " onclick="vbscript:DetailsMemory" title="Click here to display more memory details in a separate window." /></td>
  101. </tr>
  102. <tr id="MemFooter">
  103.     <td colspan="14">&nbsp;</td>
  104.     <td class="Scores" colspan="2">&nbsp;</td>
  105.     <td>&nbsp;</td>
  106. </tr>
  107. <tr id="HardDiskHeader">
  108.     <td colspan="4">&nbsp;</td>
  109.     <td>Disk #:</td>
  110.     <td>&nbsp;</td>
  111.     <td colspan="3">Model:</td>
  112.     <td>&nbsp;</td>
  113.     <td>Size (GB):</td>
  114.     <td>&nbsp;</td>
  115.     <td>Interface:</td>
  116.     <td>&nbsp;</td>
  117.     <td class="Scores" title="This read-only field will display the Windows System Assessment Tool (WinSAT) Disk Score.">Score:</td>
  118.     <td class="Scores">&nbsp;</td>
  119.     <td>&nbsp;</td>
  120. </tr>
  121. <tr id="HardDisk0">
  122.     <td><input type="checkbox" id="CheckboxHDD" checked title="Deselect this checkbox if you want to exclude the harddisk(s) from the inventory." /></td>
  123.     <td><label for="CheckboxHDD">&nbsp;&nbsp;</label></td>
  124.     <th class="Left"><label for="CheckboxHDD">Harddisk<span id="MultipleHDUs" style="display: none;">s</span>:</label></th>
  125.     <td>&nbsp;</td>
  126.     <td><input type="text" oncontextmenu="javascript:this.select();" id="HardDisk0Index"     size="12" readonly title="This read-only field will display the disk number (zero based: 0...3)." /></td>
  127.     <td>&nbsp;</td>
  128.     <td colspan="3"><input type="text" oncontextmenu="javascript:this.select();" id="HardDisk0Model"     size="40" readonly title="This read-only field will display the harddisk model." /></td>
  129.     <td>&nbsp;</td>
  130.     <td><input type="text" oncontextmenu="javascript:this.select();" id="HardDisk0Size"      size="16" readonly title="This read-only field will display the harddisk size (capacity) in GB." /></td>
  131.     <td>&nbsp;</td>
  132.     <td><input type="text" oncontextmenu="javascript:this.select();" id="HardDisk0Interface" size="16" readonly title="This read-only field will display the harddisk's interface type (IDE/SCSI/S-ATA)." /></td>
  133.     <td>&nbsp;</td>
  134.     <td class="Scores"><input type="text" oncontextmenu="javascript:this.select();" id="DiskScore" size="3" readonly title="This read-only field will display the Windows System Assessment Tool (WinSAT) Disk Score." style="text-align: right;" /></td>
  135.     <td class="Scores">&nbsp;</td>
  136.     <td><input id="ButtonDetailsHDD" class="Button" type="button" value=" Details " onclick="vbscript:DetailsHDD" title="Click here to display more harddisk details in a separate window." /></td>
  137. </tr>
  138. <tr id="HardDiskFooter">
  139.     <td colspan="14">&nbsp;</td>
  140.     <td class="Scores" colspan="2">&nbsp;</td>
  141.     <td>&nbsp;</td>
  142. </tr>
  143. <tr id="CDROMHeader">
  144.     <td colspan="4">&nbsp;</td>
  145.     <td>Drive:</td>
  146.     <td>&nbsp;</td>
  147.     <td colspan="3">Model:</td>
  148.     <td>&nbsp;</td>
  149.     <td>Firmware:</td>
  150.     <td>&nbsp;</td>
  151.     <td>Interface:</td>
  152.     <td>&nbsp;</td>
  153.     <td class="Scores" colspan="2">&nbsp;</td>
  154.     <td>&nbsp;</td>
  155. </tr>
  156. <tr id="CDROM0">
  157.     <td><input type="checkbox" id="CheckboxCDROM" checked title="Deselect this checkbox if you want to exclude the CD/DVD-ROM drive(s) from the inventory." /></td>
  158.     <td><label for="CheckboxCDROM">&nbsp;&nbsp;</label></td>
  159.     <th class="Left"><label for="CheckboxCDROM">CDROM<span id="MultipleCDROMs" style="display: none;">s</span>:</label></th>
  160.     <td>&nbsp;</td>
  161.     <td><input type="text" oncontextmenu="javascript:this.select();" id="CDROM0Index"     size="12" readonly title="This read-only field will display the CD/DVD-ROM drive letter." /></td>
  162.     <td>&nbsp;</td>
  163.     <td colspan="3"><input type="text" oncontextmenu="javascript:this.select();" id="CDROM0Model"     size="40" readonly title="This read-only field will display the CD/DVD-ROM drive model." /></td>
  164.     <td>&nbsp;</td>
  165.     <td><input type="text" oncontextmenu="javascript:this.select();" id="CDROM0Firmware"  size="16" readonly title="This read-only field will display the CD/DVD-ROM drive's firmware revision number." /></td>
  166.     <td>&nbsp;</td>
  167.     <td><input type="text" oncontextmenu="javascript:this.select();" id="CDROM0Interface" size="16" readonly title="This read-only field will display the CD/DVD-ROM drive's interface type (IDE/SCSI/S-ATA)." /></td>
  168.     <td>&nbsp;</td>
  169.     <td class="Scores" colspan="2">&nbsp;</td>
  170.     <td><input id="ButtonDetailsCDROM" class="Button" type="button" value=" Details " onclick="vbscript:DetailsCDROM" title="Click here to display more CD/DVD-ROM details in a separate window." /></td>
  171. </tr>
  172. <tr id="CDROMFooter">
  173.     <td colspan="14">&nbsp;</td>
  174.     <td class="Scores" colspan="2">&nbsp;</td>
  175.     <td>&nbsp;</td>
  176. </tr>
  177. <tr id="FDDHeader">
  178.     <td colspan="4">&nbsp;</td>
  179.     <td>Drive:</td>
  180.     <td>&nbsp;</td>
  181.     <td colspan="3">Description:</td>
  182.     <td>&nbsp;</td>
  183.     <td>Capacity:</td>
  184.     <td>&nbsp;</td>
  185.     <td>Interface:</td>
  186.     <td>&nbsp;</td>
  187.     <td class="Scores" colspan="2">&nbsp;</td>
  188.     <td>&nbsp;</td>
  189. </tr>
  190. <tr id="FDD0">
  191.     <td><input type="checkbox" id="CheckboxFDD" checked title="Deselect this checkbox if you want to exclude floppy drives from the inventory." /></td>
  192.     <td><label for="CheckboxFDD">&nbsp;&nbsp;</label></td>
  193.     <th class="Left"><label for="CheckboxFDD">Floppy disk<span id="MultipleFDDs" style="display: none;">s</span>:</label></th>
  194.     <td>&nbsp;</td>
  195.     <td><input type="text" oncontextmenu="javascript:this.select();" id="FDD0DeviceID" size="12" readonly title="This read-only field will display the floppy drive letter." /></td>
  196.     <td>&nbsp;</td>
  197.     <td colspan="3"><input type="text" oncontextmenu="javascript:this.select();" id="FDD0Description" size="40" readonly title="This read-only field will display the floppy drive description." /></td>
  198.     <td>&nbsp;</td>
  199.     <td><input type="text" oncontextmenu="javascript:this.select();" id="FDD0Capacity" size="16" readonly title="This read-only field will display the floppy drive capacity." /></td>
  200.     <td>&nbsp;</td>
  201.     <td><input type="text" oncontextmenu="javascript:this.select();" id="FDD0Interface" size="16" readonly title="This read-only field will display the floppy drive's interface type (USB/Flatcable)." /></td>
  202.     <td>&nbsp;</td>
  203.     <td class="Scores" colspan="2">&nbsp;</td>
  204.     <td><input id="ButtonDetailsFDD" class="Button" type="button" value=" Details " onclick="vbscript:DetailsFDD" title="Click here to display more floppy drive details in a separate window." /></td>
  205. </tr>
  206. <tr id="FDDFooter">
  207.     <td colspan="14">&nbsp;</td>
  208.     <td class="Scores" colspan="2">&nbsp;</td>
  209.     <td>&nbsp;</td>
  210. </tr>
  211. <tr id="VideoHeader">
  212.     <td colspan="4">&nbsp;</td>
  213.     <td>Video #:</td>
  214.     <td>&nbsp;</td>
  215.     <td colspan="3">Model:</td>
  216.     <td>&nbsp;</td>
  217.     <td>Memory (MB):</td>
  218.     <td>&nbsp;</td>
  219.     <td>Resolution:</td>
  220.     <td>&nbsp;</td>
  221.     <td class="Scores" title="This read-only field will display the Windows System Assessment Tool (WinSAT) Graphics Score.">Score:</td>
  222.     <td class="Scores">&nbsp;</td>
  223.     <td>&nbsp;</td>
  224. </tr>
  225. <tr id="Video0">
  226.     <td><input type="checkbox" id="CheckboxVideo" checked title="Deselect this checkbox if you want to exclude the display adapter(s) from the inventory." /></td>
  227.     <td><label for="CheckboxVideo">&nbsp;&nbsp;</label></td>
  228.     <th class="Left"><label for="CheckboxVideo">Video:</label></th>
  229.     <td>&nbsp;</td>
  230.     <td><input type="text" oncontextmenu="javascript:this.select();" id="VideoIndex0"  size="12" readonly title="This read-only field will display the (logical) display adapter number (zero based)." /></td>
  231.     <td>&nbsp;</td>
  232.     <td colspan="3"><input type="text" oncontextmenu="javascript:this.select();" id="VideoModel0"  size="40" readonly title="This read-only field will display the display adapter model." /></td>
  233.     <td>&nbsp;</td>
  234.     <td><input type="text" oncontextmenu="javascript:this.select();" id="VideoMemory0" size="16" readonly title="This read-only field will display the amount of video memory in MB." /></td>
  235.     <td>&nbsp;</td>
  236.     <td><input type="text" oncontextmenu="javascript:this.select();" id="VideoMode0"   size="16" readonly title="This read-only field will display the current video mode." /></td>
  237.     <td>&nbsp;</td>
  238.     <td class="Scores"><input type="text" oncontextmenu="javascript:this.select();" id="GraphicsScore" size="3" readonly title="This read-only field will display the Windows System Assessment Tool (WinSAT) Graphics Score." style="text-align: right;" /></td>
  239.     <td class="Scores">&nbsp;</td>
  240.     <td><input id="ButtonDetailsVideo" class="Button" type="button" value=" Details " onclick="vbscript:DetailsVideo" title="Click here to display more display adapter details in a separate window." /></td>
  241. </tr>
  242. <tr id="VideoFooter">
  243.     <td colspan="14">&nbsp;</td>
  244.     <td class="Scores" colspan="2">&nbsp;</td>
  245.     <td>&nbsp;</td>
  246. </tr>
  247. <tr id="MonitorHeader">
  248.     <td colspan="4">&nbsp;</td>
  249.     <td>Monitor #:</td>
  250.     <td>&nbsp;</td>
  251.     <td id="MonitorModelCaption" colspan="3">Model:</td>
  252.     <td>&nbsp;</td>
  253.     <td>Manufacturer:</td>
  254.     <td>&nbsp;</td>
  255.     <td>Serial #:</td>
  256.     <td>&nbsp;</td>
  257.     <td class="Scores" colspan="2">&nbsp;</td>
  258.     <td>&nbsp;</td>
  259. </tr>
  260. <tr id="Monitor0">
  261.     <td><input type="checkbox" id="CheckboxMonitor" checked title="Deselect this checkbox if you want to exclude the monitor(s) from the inventory." /></td>
  262.     <td><label for="CheckboxMonitor">&nbsp;&nbsp;</label></td>
  263.     <th class="Left"><label for="CheckboxMonitor">Monitor<span id="MultipleMonitors" style="display: none;">s</span>:</labe></th>
  264.     <td>&nbsp;</td>
  265.     <td><input type="text" oncontextmenu="javascript:this.select();" id="MonitorIndex0"        size="12" readonly title="This read-only field will display the monitor number (zero based)." /></td>
  266.     <td>&nbsp;</td>
  267.     <td colspan="3"><input type="text" oncontextmenu="javascript:this.select();" id="MonitorModel0"        size="40" readonly title="This read-only field will display the monitor model." /></td>
  268.     <td>&nbsp;</td>
  269.     <td><input type="text" oncontextmenu="javascript:this.select();" id="MonitorManufacturer0" size="16" readonly title="This read-only field will display the monitor manufacturer." /></td>
  270.     <td>&nbsp;</td>
  271.     <td><input type="text" oncontextmenu="javascript:this.select();" id="MonitorSerial0"       size="16" readonly title="This read-only field will display the monitor serial number." /></td>
  272.     <td>&nbsp;</td>
  273.     <td class="Scores" colspan="2">&nbsp;</td>
  274.     <td><input id="ButtonDetailsMonitor" class="Button" type="button" value=" Details " onclick="vbscript:DetailsMonitor" title="Click here to display more monitor details in a separate window." /></td>
  275. </tr>
  276. <tr id="MonitorFooter">
  277.     <td colspan="14">&nbsp;</td>
  278.     <td class="Scores" colspan="2">&nbsp;</td>
  279.     <td>&nbsp;</td>
  280. </tr>
  281. <tr id="SoundHeader">
  282.     <td colspan="6">&nbsp;</td>
  283.     <td colspan="3">Model:</td>
  284.     <td>&nbsp;</td>
  285.     <td>Manufacturer:</td>
  286.     <td colspan="3">&nbsp;</td>
  287.     <td class="Scores" colspan="2">&nbsp;</td>
  288.     <td>&nbsp;</td>
  289. </tr>
  290. <tr id="SoundRow">
  291.     <td><input type="checkbox" id="CheckboxSound" checked title="Deselect this checkbox if you want to exclude the sound card from the inventory." /></td>
  292.     <td><label for="CheckboxSound">&nbsp;</label></td>
  293.     <th class="Left"><label for="CheckboxSound">Sound:</label></th>
  294.     <td colspan="3">&nbsp;</td>
  295.     <td colspan="3"><input type="text" oncontextmenu="javascript:this.select();" id="SoundCardModel" size="40" readonly title="This read-only field will display the sound card model." /></td>
  296.     <td>&nbsp;</td>
  297.     <td><input type="text" oncontextmenu="javascript:this.select();" id="SoundCardManufacturer" size="16" readonly title="This read-only field will display the name of the sound card manufacturer." /></td>
  298.     <td colspan="3">&nbsp;</td>
  299.     <td class="Scores" colspan="2">&nbsp;</td>
  300.     <td><input id="ButtonDetailsSound" class="Button" type="button" value=" Details " onclick="vbscript:DetailsSound" title="Click here to display more sound card details in a separate window." /></td>
  301. </tr>
  302. <tr id="SoundFooter">
  303.     <td colspan="14">&nbsp;</td>
  304.     <td class="Scores" colspan="2">&nbsp;</td>
  305.     <td>&nbsp;</td>
  306. </tr>
  307. <tr id="NICHeader">
  308.     <td colspan="4">&nbsp;</td>
  309.     <td>NIC #:</td>
  310.     <td>&nbsp;</td>
  311.     <td colspan="3">Model (and physical medium):</td>
  312.     <td>&nbsp;</td>
  313.     <td>MAC Address:</td>
  314.     <td>&nbsp;</td>
  315.     <td>Speed:</td>
  316.     <td>&nbsp;</td>
  317.     <td class="Scores" colspan="2">&nbsp;</td>
  318.     <td>&nbsp;</td>
  319. </tr>
  320. <tr id="NIC0">
  321.     <td><input type="checkbox" id="CheckboxNIC" checked title="Deselect this checkbox if you want to exclude the network adapter(s) from the inventory." /></td>
  322.     <td><label for="CheckboxNIC">&nbsp;&nbsp;</label></td>
  323.     <th class="Left"><label for="CheckboxNIC">NIC<span id="MultipleNICs" style="display: none;">s</span>:</label></th>
  324.     <td>&nbsp;</td>
  325.     <td><input type="text" oncontextmenu="javascript:this.select();" id="NICIndex0"   size="12" readonly title="This read-only field will display the network adapter number (zero based: 0...3)." /></td>
  326.     <td>&nbsp;</td>
  327.     <td colspan="3"><input type="text" oncontextmenu="javascript:this.select();" id="NICModel0"   size="40" readonly title="This read-only field will display the network adapter model." /></td>
  328.     <td>&nbsp;</td>
  329.     <td><input type="text" oncontextmenu="javascript:this.select();" id="MACAddress0" size="16" readonly title="This read-only field will display the network adapter's MAC address." /></td>
  330.     <td>&nbsp;</td>
  331.     <td><input type="text" oncontextmenu="javascript:this.select();" id="NICSpeed0"   size="16" readonly title="This read-only field will display the network adapter's link speed in kB/s." /></td>
  332.     <td>&nbsp;</td>
  333.     <td class="Scores" colspan="2">&nbsp;</td>
  334.     <td><input id="ButtonDetailsNIC" class="Button" type="button" value=" Details " onclick="vbscript:DetailsNIC" title="Click here to display more network adapter details in a separate window." /></td>
  335. </tr>
  336. <tr id="NICFooter">
  337.     <td colspan="14">&nbsp;</td>
  338.     <td class="Scores" colspan="2">&nbsp;</td>
  339.     <td>&nbsp;</td>
  340. </tr>
  341. <tr id="MainBoardHeader">
  342.     <td colspan="4">&nbsp;</td>
  343.     <td>Chassis:</td>
  344.     <td>&nbsp;</td>
  345.     <td colspan="3">Model:</td>
  346.     <td>&nbsp;</td>
  347.     <td>Manufacturer:</td>
  348.     <td>&nbsp;</td>
  349.     <td>Version:</td>
  350.     <td>&nbsp;</td>
  351.     <td class="Scores" title="This read-only field will display the Windows System Assessment Tool (WinSAT) Total Score for the computer.">Score:</td>
  352.     <td class="Scores">&nbsp;</td>
  353.     <td>&nbsp;</td>
  354. </tr>
  355. <tr id="MainBoardRow">
  356.     <td><input type="checkbox" id="CheckboxMainBoard" checked title="Deselect this checkbox if you want to exclude the main board and system enclosure from the inventory." /></td>
  357.     <td><label for="CheckboxMainBoard">&nbsp;</label></td>
  358.     <th class="Left"><label for="CheckboxMainBoard">Main Board:</label></th>
  359.     <td>&nbsp;</td>
  360.     <td><input type="text" oncontextmenu="javascript:this.select();" id="ChassisType"    size="12" readonly title="This read-only field will display the computer's chassis type." /></td>
  361.     <td>&nbsp;</td>
  362.     <td colspan="3"><input type="text" oncontextmenu="javascript:this.select();" id="MBModel"        size="40" readonly title="This read-only field will display the main board type." /></td>
  363.     <td>&nbsp;</td>
  364.     <td><input type="text" oncontextmenu="javascript:this.select();" id="MBManufacturer" size="16" readonly title="This read-only field will display the name of the main board manufacturer." /></td>
  365.     <td>&nbsp;</td>
  366.     <td><input type="text" oncontextmenu="javascript:this.select();" id="MBVersion"      size="16" readonly title="This read-only field will display the main board version." /></td>
  367.     <td>&nbsp;</td>
  368.     <td class="Scores"><input type="text" oncontextmenu="javascript:this.select();" id="WinSATScore" size="3" readonly title="This read-only field will display the Windows System Assessment Tool (WinSAT) Total Score for the computer." style="text-align: right;" /></td>
  369.     <td class="Scores">&nbsp;</td>
  370.     <td><input id="ButtonDetailsMainBoard" class="Button" type="button" value=" Details " onclick="vbscript:DetailsMainBoard" title="Click here to display more main board and system enclosure details." /></td>
  371. </tr>
  372. <tr id="MainBoardFooter">
  373.     <td colspan="14">&nbsp;</td>
  374.     <td class="Scores" colspan="2">&nbsp;</td>
  375.     <td>&nbsp;</td>
  376. </tr>
  377. <tr id="KeyboardHeader">
  378.     <td colspan="4">&nbsp;</td>
  379.     <td id="KeyboardHeaderFkLEDs">F-keys &amp; LEDs</td>
  380.     <td>&nbsp;</td>
  381.     <td colspan="3">Keyboard Model:</td>
  382.     <td>&nbsp;</td>
  383.     <td>Keyboard Type:</td>
  384.     <td>&nbsp;</td>
  385.     <td>Connector:</td>
  386.     <td>&nbsp;</td>
  387.     <td class="Scores" colspan="2">&nbsp;</td>
  388.     <td>&nbsp;</td>
  389. </tr>
  390. <tr id="KeyboardRow">
  391.     <td><input type="checkbox" id="CheckboxKeyboard" checked title="Deselect this checkbox if you want to exclude the keyboard from the inventory." /></td>
  392.     <td><label for="CheckboxKeyboard">&nbsp;</label></td>
  393.     <th class="Left"><label for="CheckboxKeyboard">Keyboard:</label></th>
  394.     <td>&nbsp;</td>
  395.     <td><input type="text" oncontextmenu="javascript:this.select();" id="KeyboardFkLEDs"    size="12" readonly title="This read-only field will display the number of function keys and LEDs (elevated privileges required)." /></td>
  396.     <td>&nbsp;</td>
  397.     <td colspan="3"><input type="text" oncontextmenu="javascript:this.select();" id="KeyboardModel"     size="40" readonly title="This read-only field will display the keyboard model." /></td>
  398.     <td>&nbsp;</td>
  399.     <td><input type="text" oncontextmenu="javascript:this.select();" id="KeyboardType"      size="16" readonly title="This read-only field will display the keyboard type." /></td>
  400.     <td>&nbsp;</td>
  401.     <td><input type="text" oncontextmenu="javascript:this.select();" id="KeyboardConnector" size="16" readonly title="This read-only field will display the keyboard connector." /></td>
  402.     <td>&nbsp;</td>
  403.     <td class="Scores" colspan="2">&nbsp;</td>
  404.     <td><input id="ButtonDetailsKeyboard" class="Button" type="button" value=" Details " onclick="vbscript:DetailsKeyboard" title="Click here to display more keyboard details." /></td>
  405. </tr>
  406. <tr id="KeyboardFooter">
  407.     <td colspan="14">&nbsp;</td>
  408.     <td class="Scores" colspan="2">&nbsp;</td>
  409.     <td>&nbsp;</td>
  410. </tr>
  411. <tr id="MouseHeader">
  412.     <td colspan="4">&nbsp;</td>
  413.     <td id="MouseButtonsHeader">Buttons:</td>
  414.     <td>&nbsp;</td>
  415.     <td colspan="3">Mouse Model:</td>
  416.     <td>&nbsp;</td>
  417.     <td>Mouse Type:</td>
  418.     <td>&nbsp;</td>
  419.     <td>Connector:</td>
  420.     <td>&nbsp;</td>
  421.     <td class="Scores" colspan="2">&nbsp;</td>
  422.     <td>&nbsp;</td>
  423. </tr>
  424. <tr id="MouseRow">
  425.     <td><input type="checkbox" id="CheckboxMouse" checked title="Deselect this checkbox if you want to exclude the mouse from the inventory." /></td>
  426.     <td><label for="CheckboxMouse">&nbsp;</label></td>
  427.     <th class="Left"><label for="CheckboxMouse">Mouse:</label></th>
  428.     <td>&nbsp;</td>
  429.     <td><input type="text" oncontextmenu="javascript:this.select();" id="MouseButtons"  size="12" readonly title="This read-only field will display the number of mouse buttons (elevated privileges required)." /></td>
  430.     <td>&nbsp;</td>
  431.     <td colspan="3"><input type="text" oncontextmenu="javascript:this.select();" id="MouseModel" size="40" readonly title="This read-only field will display the mouse model." /></td>
  432.     <td>&nbsp;</td>
  433.     <td><input type="text" oncontextmenu="javascript:this.select();" id="MouseType"    size="16" readonly title="This read-only field will display the mouse type." /></td>
  434.     <td>&nbsp;</td>
  435.     <td><input type="text" oncontextmenu="javascript:this.select();" id="MouseConn"   size="16" readonly title="This read-only field will display the mouse connector." /></td>
  436.     <td>&nbsp;</td>
  437.     <td class="Scores" colspan="2">&nbsp;</td>
  438.     <td><input id="ButtonDetailsMouse" class="Button" type="button" value=" Details " onclick="vbscript:DetailsMouse" title="Click here to display more mouse details." /></td>
  439. </tr>
  440. <tr id="MouseFooter">
  441.     <td colspan="14">&nbsp;</td>
  442.     <td class="Scores" colspan="2">&nbsp;</td>
  443.     <td>&nbsp;</td>
  444. </tr>
  445. <tr id="PortsHeader">
  446.     <td colspan="4">&nbsp;</td>
  447.     <td>USB Ports:</td>
  448.     <td>&nbsp;</td>
  449.     <td colspan="3">System Slots:</td>
  450.     <td>&nbsp;</td>
  451.     <td>FireWire Ports:</td>
  452.     <td>&nbsp;</td>
  453.     <td>Legacy Ports:</td>
  454.     <td>&nbsp;</td>
  455.     <td class="Scores" colspan="2">&nbsp;</td>
  456.     <td>&nbsp;</td>
  457. </tr>
  458. <tr id="PortsRow">
  459.     <td><input type="checkbox" id="CheckboxPorts" checked title="Deselect this checkbox if you want to exclude the ports summary from the inventory." /></td>
  460.     <td><label for="CheckboxPorts">&nbsp;</label></td>
  461.     <th class="Left"><label for="CheckboxPorts">Ports:</label></th>
  462.     <td>&nbsp;</td>
  463.     <td><input type="text" oncontextmenu="javascript:this.select();" id="USB" size="12" readonly title="This read-only field will tell if USB is supported." /></td>
  464.     <td>&nbsp;</td>
  465.     <td colspan="3"><input type="text" oncontextmenu="javascript:this.select();" id="Slots" size="40" readonly title="This read-only field will display the number and types of system slots (AGP/PCI)." /></td>
  466.     <td>&nbsp;</td>
  467.     <td><input type="text" oncontextmenu="javascript:this.select();" id="FireWire" size="16" readonly title="This read-only field will display the number of IEEE 1394 Firewire ports." /></td>
  468.     <td>&nbsp;</td>
  469.     <td><input type="text" oncontextmenu="javascript:this.select();" id="Legacy" size="16" readonly title="This read-only field will display the number of legacy parallel and serial ports." /></td>
  470.     <td>&nbsp;</td>
  471.     <td class="Scores" colspan="2">&nbsp;</td>
  472.     <td><input id="ButtonDetailsPorts" class="Button" type="button" value=" Details " onclick="vbscript:DetailsPorts" title="Click here to display more details on the available ports." /></td>
  473. </tr>
  474. <tr id="PortsFooter">
  475.     <td colspan="14">&nbsp;</td>
  476.     <td class="Scores" colspan="2">&nbsp;</td>
  477.     <td>&nbsp;</td>
  478. </tr>
  479. <tr id="BIOSHeader">
  480.     <td colspan="4">&nbsp;</td>
  481.     <td>Manufacturer:</td>
  482.     <td>&nbsp;</td>
  483.     <td colspan="3">Model:</td>
  484.     <td>&nbsp;</td>
  485.     <td>Version:</td>
  486.     <td>&nbsp;</td>
  487.     <td>Date:</td>
  488.     <td>&nbsp;</td>
  489.     <td class="Scores" colspan="2">&nbsp;</td>
  490.     <td>&nbsp;</td>
  491. </tr>
  492. <tr id="BIOSRow">
  493.     <td><input type="checkbox" id="CheckboxBIOS" checked title="Deselect this checkbox if you want to exclude the BIOS from the inventory." /></td>
  494.     <td><label for="CheckboxBIOS">&nbsp;</label></td>
  495.     <th class="Left"><label for="CheckboxBIOS">BIOS:</label></th>
  496.     <td>&nbsp;</td>
  497.     <td><input type="text" oncontextmenu="javascript:this.select();" id="BIOSManufacturer" size="12" readonly title="This read-only field will display the name of the BIOS manufacturer." /></td>
  498.     <td>&nbsp;</td>
  499.     <td colspan="3"><input type="text" oncontextmenu="javascript:this.select();" id="BIOSModel"        size="40" readonly title="This read-only field will display the BIOS description." /></td>
  500.     <td>&nbsp;</td>
  501.     <td><input type="text" oncontextmenu="javascript:this.select();" id="BIOSVersion"      size="16" readonly title="This read-only field will display the BIOS version number." /></td>
  502.     <td>&nbsp;</td>
  503.     <td><input type="text" oncontextmenu="javascript:this.select();" id="BIOSDate"         size="16" readonly title="This read-only field will display the BIOS release date." /></td>
  504.     <td>&nbsp;</td>
  505.     <td class="Scores" colspan="2">&nbsp;</td>
  506.     <td><input id="ButtonDetailsBIOS" class="Button" type="button" value="Details" onclick="vbscript:DetailsBIOS" title="Click here to display more BIOS details." /></td>
  507. </tr>
  508. <tr id="BIOSFooter">
  509.     <td colspan="14">&nbsp;</td>
  510.     <td class="Scores" colspan="2">&nbsp;</td>
  511.     <td>&nbsp;</td>
  512. </tr>
  513. </tbody>
  514. </table>
  515.  
  516. <div style="height: 0.5em;"></div>
  517.  
  518. <table>
  519. <tr>
  520.     <td><input id="ButtonCopy"     class="Button" type="button" value="Copy"    onclick="vbscript:CopyToClipboard"  title="Click here to copy the results to the clipboard. The data in the clipboard will be in tab delimited format. Paste the data in a spreadsheet, using tab as the only delimiter, to create reports." /></td>
  521.     <td>&nbsp;</td>
  522.     <td><input id="ButtonSave"     class="Button" type="button" value="Save"    onclick="vbscript:SaveTabDelimited" title="Click here to save the results, in tab delimited format, to a file." /></td>
  523.     <td>&nbsp;</td>
  524.     <td><input id="ButtonPrint"    class="Button" type="button" value="Print"   onclick="vbscript:Print"            title="Click here to print the results."                  accesskey="p" /></td>
  525.     <td>&nbsp;</td>
  526.     <td><input id="ButtonHelp"     class="Button" type="button" value="Help"    onclick="vbscript:ShowHelp"         title="Click this button to display the Command Line Help." /></td>
  527.     <td>&nbsp;</td>
  528.     <td><input id="ButtonCredits"  class="Button" type="button" value="Credits" onclick="vbscript:ShowCredits"      title="Click this button to display the Credits window."  accesskey="c" /></td>
  529.     <td>&nbsp;</td>
  530.     <td><input id="ButtonSettings" class="Button" type="button" value="Settings" onclick="vbscript:ShowSettings"    title="Click this button to change the program settings." accesskey="s" /></td>
  531. </tr>
  532. </table>
  533.  
  534. </div><!-- end of "MainScreen" -->
  535.  
  536.  
  537.  
  538. <div id="SettingsScreen" style="display: none; max-width: 100%;" class="DontPrint">
  539.  
  540. <h1>Settings</h1>
  541.  
  542. <table>
  543. <tr>
  544. 	<td>&nbsp;</td>
  545. 	<td class="Left Nowrap">Configuration file content</td>
  546. 	<td class="Left" id="DisplayConfig" colspan="2"></td>
  547. </tr>
  548. <tr>
  549. 	<td>&nbsp;</td>
  550. 	<td class="Left Nowrap">Command Line</td>
  551. 	<td class="Left" id="DisplayCommandLine" colspan="2"></td>
  552. </tr>
  553. <tr>
  554. 	<td colspan="3">&nbsp;</td>
  555. </tr>
  556. <tr title="Scale this HTA's window content">
  557. 	<td>&nbsp;</td>
  558. 	<td class="Left Nowrap">Zoom factor (50..250%)</td>
  559. 	<td class="Left" colspan="2"><input type="text" id="InputZoomFactor" min="50" max="250" value="100" size="5" onchange="vbscript:ValidateZoomFactor" onkeyup="vbscript:ValidateZoomFactor" /> %</td>
  560. </tr>	
  561. <tr title="Select to use DMIDecode for retrieving more detailed information about the local computer (ignored for remote computers or if DMIDecode.exe is not found in the PATH).">
  562. 	<td><input type="checkbox" id="CheckboxDMIDecode" onclick="vbscript:OnClick_CheckboxDMIDecode" /></td>
  563. 	<td class="Left" colspan="3"><label for="CheckboxDMIDecode">Use <a href="http://www.nongnu.org/dmidecode/">DMIDecode</a> for more details</label></td>
  564. </tr>
  565. <tr title="Select to use DxDiag for retrieving more detailed information about the local computer (ignored for remote computers).">
  566. 	<td><input type="checkbox" id="CheckboxDxDiag" onclick="vbscript:OnClick_CheckboxDxDiag" /></td>
  567. 	<td class="Left" colspan="3"><label for="CheckboxDxDiag">Use DxDiag for more details</label></td>
  568. </tr>
  569. <tr id="TablerowKeepXML" style="display: none; visibility: collapse;" title="Select to keep DxDiag's results to speed up the inventory next time.">
  570. 	<td>&nbsp;</td>
  571. 	<td class="Left Nowrap"><input type="checkbox" id="CheckboxKeepXML" />&nbsp;<label for="CheckboxKeepXML">Keep DxDiag's XML file</label></td>
  572. 	<td class="Left" colspan="2"><input class="Button" type="button" id="ButtonDeleteXML" value="Delete XML" onclick="vbscript:DeleteDxDiagXML" /></td>
  573. </tr>
  574. <tr id="TablerowDxDiagPath" style="display: none; visibility: collapse;">
  575. 	<td>&nbsp;</td>
  576. 	<td class="Left Nowrap" style="text-indent: 1.75em;">Path to DxDiag's XML file</td>
  577. 	<td class="Left" colspan="2"><input type="text" id="InputDxDiag" size="30" /></td>
  578. </tr>
  579. <tr title="Select to include USB storage devices.">
  580. 	<td><input type="checkbox" id="CheckboxUSBSTOR" /></td>
  581. 	<td class="Left" colspan="3"><label for="CheckboxUSBSTOR">Include USB storage devices</label></td>
  582. </tr>
  583. <tr title="Select to include virtual storage devices.">
  584. 	<td><input type="checkbox" id="CheckboxVirtual" /></td>
  585. 	<td class="Left" colspan="3"><label for="CheckboxVirtual">Include virtual storage devices</label></td>
  586. </tr>
  587. <tr title="Select to display physical screen dimensions as height and width in centimeters, instead of the diagonal in inches.">
  588. 	<td><input type="checkbox" id="CheckboxCM" /></td>
  589. 	<td class="Left" colspan="3"><label for="CheckboxCM">Show screen width and height in centimeters instead of the diagonal in inches</label></td>
  590. </tr>
  591. <tr title="Deselect to skip the WinSAT scores.">
  592. 	<td><input type="checkbox" id="CheckboxScores" checked /></td>
  593. 	<td class="Left" colspan="3"><label for="CheckboxScores">Show WinSAT scores</label></td>
  594. </tr>
  595. <tr title="Select to display arrays of numbers in the details windows as interpreted text too.">
  596. 	<td><input type="checkbox" id="CheckboxCharacterChains" /></td>
  597. 	<td class="Left" colspan="3" title="E.g.:
  598. Property (array) : 83,121,110,99,77,97,115,116,101,114,0
  599. Property (string): SyncMaster
  600. Note that not all arrays of numbers are intended to be interpreted as text, so the string may sometimes be 'jiberish'.
  601. For this reason, property names containing 'Capability' or 'Characteristic' (or their plural forms) are excluded, as they consist of arrays of numbers NOT representing text."><label for="CheckboxCharacterChains">Show arrays of characters in details windows as text too</label></td>
  602. </tr>
  603. <tr title="Select to run this HTA in Debug mode.">
  604. 	<td><input type="checkbox" id="CheckboxDebugMode" /></td>
  605. 	<td class="Left" colspan="3"><label for="CheckboxDebugMode">Enable Debug mode</label></td>
  606. </tr>
  607. <tr id="TablerowDebugLog" style="display: none; visibility: collapse;">
  608. 	<td>&nbsp;</td>
  609. 	<td class="Left Nowrap">Path to debug log file</td>
  610. 	<td class="Left" colspan="2"><input type="text" id="InputDebugLogPath" size="30" disabled /></td>
  611. </tr>
  612. <tr title="Deselect to skip the check for program updates at startup.">
  613. 	<td><input type="checkbox" id="CheckboxCheckUpd" checked /></td>
  614. 	<td class="Left" colspan="3"><label for="CheckboxCheckUpd">Check for updates at startup</label></td>
  615. </tr>
  616. <tr>
  617. 	<td>&nbsp;</td>
  618. 	<td colspan="3">Theme:</td>
  619. </tr>
  620. <fieldset>
  621. <tr>
  622. 	<td>&nbsp;</td>
  623. 	<td class="Left" colspan="3"><input type="radio" name="Theme" value="BW"     id="ThemeBW"     onclick="vbscript:SetTheme" /><label for="ThemeBW">Default: BW (black text on white background)</label></td>
  624. </tr>
  625. <tr>
  626. 	<td>&nbsp;</td>
  627. 	<td class="Left" colspan="3"><input type="radio" name="Theme" value="Blue"   id="ThemeBlue"   onclick="vbscript:SetTheme" checked /><label for="ThemeBlue">Blue (white text on blue background)</label></td>
  628. </tr>
  629. <tr>
  630. 	<td>&nbsp;</td>
  631. 	<td class="Left" colspan="3"><input type="radio" name="Theme" value="Dark"   id="ThemeDark"   onclick="vbscript:SetTheme" /><label for="ThemeDark">Dark (white text on black background)</label></td>
  632. </tr>
  633. <tr>
  634. 	<td>&nbsp;</td>
  635. 	<td class="Left" colspan="3"><input type="radio" name="Theme" value="Red"    id="ThemeRed"    onclick="vbscript:SetTheme" /><label for="ThemeRed">Red (yellow text on red background)</label></td>
  636. </tr>
  637. <tr>
  638. 	<td>&nbsp;</td>
  639. 	<td class="Left" colspan="3"><input type="radio" name="Theme" value="Custom" id="ThemeCustom" onclick="vbscript:SetTheme" /><label for="ThemeCustom">Custom colors</label></td>
  640. </tr>
  641. </fieldset>
  642. <tr>
  643. 	<td>&nbsp;</td>
  644. 	<td class="Left Nowrap" style="padding-left: 2em;">Background color</td>
  645. 	<td class="Left"><select id="BackgroundColor" name="BackgroundColor" onchange="vbscript:SetCustomTheme"></select></td>
  646. </tr>
  647. <tr>
  648. 	<td>&nbsp;</td>
  649. 	<td class="Left Nowrap" style="padding-left: 2em;">Captions color</td>
  650. 	<td class="Left" colspan="2"><select id="CaptionsColor" name="CaptionsColor" onchange="vbscript:SetCustomTheme"></select></td>
  651. </tr>
  652. <tr>
  653. 	<td>&nbsp;</td>
  654. 	<td class="Left Nowrap" style="padding-left: 2em;">Links color<!-- (<a href="#" onclick="javascript:return false;">example</a>)--></td>
  655. 	<td class="Left" colspan="2"><select id="LinksColor" name="LinksColor" onchange="vbscript:SetCustomTheme"></select></td>
  656. </tr>
  657. <tr>
  658. 	<td>&nbsp;</td>
  659. 	<td class="Left Nowrap" style="padding-left: 2em;">Button background color</td>
  660. 	<td class="Left" colspan="2"><select id="ButtonFaceColor" name="ButtonFaceColor" onchange="vbscript:SetCustomTheme"></select></td>
  661. </tr>
  662. <tr>
  663. 	<td>&nbsp;</td>
  664. 	<td class="Left Nowrap" style="padding-left: 2em;">Button text color</td>
  665. 	<td class="Left" colspan="2"><select id="ButtonCaptionsColor" name="ButtonCaptionsColor" onchange="vbscript:SetCustomTheme"></select></td>
  666. </tr>
  667. <tr>
  668. 	<td>&nbsp;</td>
  669. 	<td class="Left Nowrap" style="padding-left: 2em;">Command help color<!-- (<code>example</code>)--></td>
  670. 	<td class="Left" colspan="2"><select id="CodeColor" name="CodeColor" onchange="vbscript:SetCustomTheme"></select></td>
  671. </tr>
  672. </table>
  673.  
  674. <p>&nbsp;</p>
  675.  
  676. <p class="Center">
  677. <input id="ButtonSaveCfg" class="Button" type="button" value="Save"   onclick="vbscript:SaveSettings" />
  678. &nbsp;
  679. <input id="ButtonEditCfg" class="Button" type="button" value="Edit"   onclick="vbscript:EditSettings" accesskey="e" />
  680. &nbsp;
  681. <input id="ButtonReset"   class="Button" type="button" value="Reset"  onclick="vbscript:ConfigReset" />
  682. &nbsp;
  683. <input id="ButtonCancel"  class="Button" type="button" value="Cancel" onclick="vbscript:ShowMain" />
  684. </p>
  685.  
  686. <p>&nbsp;</p>
  687.  
  688. </div><!-- end of "SettingsScreen" area -->
  689.  
  690.  
  691.  
  692. <div id="HelpScreen" style="max-width: 900px; display: none;" class="DontPrint">
  693.  
  694. <h1>Basic Hardware Inventory, Version <span id="HelpVer">0.00</span></h1>
  695.  
  696. <p>Get a basic hardware inventory of any WMI enabled computer on the network</p>
  697.  
  698. <table class="Left" style="font-size: 10pt;">
  699. <tr>
  700. 	<td><strong>Usage:</strong></td>
  701. 	<td>&nbsp;</td>
  702. 	<td colspan="3"><code>HARDWARE.HTA  [ options ]  [ switches ]</code></td>
  703. </tr>
  704. <tr>
  705. 	<td colspan="5">&nbsp;</td>
  706. </tr>
  707. <tr>
  708. 	<td><strong>Options:</strong></td>
  709. 	<td>&nbsp;</td>
  710. 	<td colspan="3">These parameters can be set in the configuration file as well as on the command line (in case of conflicts, command line options prevail)</td>
  711. </tr>
  712. <tr>
  713. 	<td colspan="2">&nbsp;</td>
  714. 	<td><code>/CHAIN</code></td>
  715. 	<td>&nbsp;</td>
  716. 	<td>Experimental: In details windows, if a property value consists of an array of (character) numbers, show the <em>array</em> as well as the <em>interpreted text</em>; e.g.<br />
  717. 		<code style="font-size: 80%;">PropertyValue (array) : 83,121,110,99,77,97,115,116,101,114,0,0,0<br />
  718. 		PropertyValue (string): SyncMaster</code><br />
  719. 		Note that not all arrays of numbers are intended to be interpreted as text, so the string may sometimes be "jiberish".
  720. 		For this reason, property names containing "Capability" or "Characteristic" (or their plural forms) are excluded, as they consist of arrays of numbers <em>not</em> representing text.</td>
  721. </tr>
  722. <tr>
  723. 	<td colspan="2">&nbsp;</td>
  724. 	<td><code>/CM</code></td>
  725. 	<td>&nbsp;</td>
  726. 	<td>Display monitor dimensions in centimeters instead of diagonal in inches (only in Windows Vista and later)</td>
  727. </tr>
  728. <tr>
  729. 	<td colspan="2">&nbsp;</td>
  730. 	<td colspan="3"><code>/CUSTOMCOLORS:<em>gradienttop</em>;<em>gradientbottom</em>;<em>captions</em>;<em>links</em>;<em>buttonface</em>;<em>buttontext</em>;<em>commands</em></code></td>
  731. </tr>
  732. <tr>
  733. 	<td colspan="4">&nbsp;</td>
  734. 	<td>Set colors for the background gradient top and bottom, body text, links, button faces, button text, and this help screen's command code (valid with <code>/THEME:Custom</code> only); for valid colors, check the dropdowns in the Settings screen or visit <a href="http://www.w3schools.com/colors/colors_names.asp">W3Schools' list of HTML colors</a></td>
  735. </tr>
  736. <tr>
  737. 	<td colspan="2">&nbsp;</td>
  738. 	<td><code>/DEBUG</code></td>
  739. 	<td>&nbsp;</td>
  740. 	<td>Debug mode: list settings during startup process in a separate browser window</td>
  741. </tr>
  742. <tr>
  743. 	<td colspan="2">&nbsp;</td>
  744. 	<td><code>/DMIDECODE</code></td>
  745. 	<td>&nbsp;</td>
  746. 	<td>Use <a href="http://www.nongnu.org/dmidecode/">DMIDecode.exe</a> to retrieve DMI/SMBIOS details (more information than WMI for memory, but requires third party software, and gathers information for <em>local computer only</em>)</td>
  747. </tr>
  748. <tr>
  749. 	<td colspan="2">&nbsp;</td>
  750. 	<td><code>/DXDIAG</code></td>
  751. 	<td>&nbsp;</td>
  752. 	<td>Use DxDiag.exe to retrieve sound devices, video controllers and system data (more reliable than WMI for video and sound, but <em>slow</em>, and gathers information for <em>local computer only</em>)</td>
  753. </tr>
  754. <tr>
  755. 	<td colspan="2">&nbsp;</td>
  756. 	<td><code>/KEEPXML</code></td>
  757. 	<td>&nbsp;</td>
  758. 	<td>Reuse existing DxDiag data saved in XML, if it exists, and do not delete the XML file when terminating the program (requires <code>/DXDIAG</code>)</td>
  759. </tr>
  760. <tr>
  761. 	<td colspan="2">&nbsp;</td>
  762. 	<td><code>/NOUPD</code></td>
  763. 	<td>&nbsp;</td>
  764. 	<td>Skip check for updates at startup</td>
  765. </tr>
  766. <tr>
  767. 	<td colspan="2">&nbsp;</td>
  768. 	<td><code>/NOSCORES</code></td>
  769. 	<td>&nbsp;</td>
  770. 	<td>Do not display Windows System Assessment Tool (WinSAT) scores</td>
  771. </tr>
  772. <tr>
  773. 	<td colspan="2">&nbsp;</td>
  774. 	<td><code>/THEME:<em>theme</em></code></td>
  775. 	<td>&nbsp;</td>
  776. 	<td>Change the window background and text colors; <code><em>theme</em></code> can be <code>BW</code> (Black and White, default), <code>Blue</code>, <code>Dark</code>, <code>Red</code> or <code>Custom</code> (the latter requires <code>/CUSTOMCOLORS:<em>customcolors</em></code>)</td>
  777. </tr>
  778. <tr>
  779. 	<td colspan="2">&nbsp;</td>
  780. 	<td><code>/USBSTOR</code></td>
  781. 	<td>&nbsp;</td>
  782. 	<td>Include USB drives in the harddisks list</td>
  783. </tr>
  784. <tr>
  785. 	<td colspan="2">&nbsp;</td>
  786. 	<td><code>/VIRTUAL</code></td>
  787. 	<td>&nbsp;</td>
  788. 	<td>Include virtual drives in the harddisks list</td>
  789. </tr>
  790. <tr>
  791. 	<td colspan="2">&nbsp;</td>
  792. 	<td><code>/XML:<em>xmlfile</em></code></td>
  793. 	<td>&nbsp;</td>
  794. 	<td>Location where DxDiag results will be stored; if <em>xmlfile</em> is not specified, "Hardware.xml" in the current directory will be used (requires <code>/DXDIAG</code> and <code>/KEEPXML</code>)</td>
  795. </tr>
  796. <tr>
  797. 	<td colspan="2">&nbsp;</td>
  798. 	<td><code>/ZOOM:<em>zoomfactor</em></code></td>
  799. 	<td>&nbsp;</td>
  800. 	<td>Zoom factor in percents for content of this window (50..250, default 100)</td>
  801. </tr>
  802. <tr>
  803. 	<td colspan="5">&nbsp;</td>
  804. </tr>
  805. <tr>
  806. 	<td><strong>Switches:</strong></td>
  807. 	<td>&nbsp;</td>
  808. 	<td colspan="3">These parameters can be set on the command line only</td>
  809. </tr>
  810. <tr>
  811. 	<td colspan="2">&nbsp;</td>
  812. 	<td><code>/?</code> or <code>/HELP</code></td>
  813. 	<td>&nbsp;</td>
  814. 	<td>Show this message</td>
  815. </tr>
  816. <tr>
  817. 	<td colspan="2">&nbsp;</td>
  818. 	<td><code>/BASIC</code></td>
  819. 	<td>&nbsp;</td>
  820. 	<td>Very basic inventory (CPU, memory, HDD)</td>
  821. </tr>
  822. <tr>
  823. 	<td colspan="2">&nbsp;</td>
  824. 	<td><code>/COMPUTER:<em>computername</em></code></td>
  825. 	<td>&nbsp;</td>
  826. 	<td>Specify computer to be queried (starts inventory immediately)</td>
  827. </tr>
  828. <tr>
  829. 	<td colspan="2">&nbsp;</td>
  830. 	<td><code>/COPY</code></td>
  831. 	<td>&nbsp;</td>
  832. 	<td>Copy results to clipboard and close program (starts inventory immediately, and terminates program when results are copied)</td>
  833. </tr>
  834. <tr>
  835. 	<td colspan="2">&nbsp;</td>
  836. 	<td><code>/NOADMIN</code></td>
  837. 	<td>&nbsp;</td>
  838. 	<td>Skip the test for elevated privileges, just assume privileges are sufficient</td>
  839. </tr>
  840. <tr>
  841. 	<td colspan="2">&nbsp;</td>
  842. 	<td><code>/PRINT</code></td>
  843. 	<td>&nbsp;</td>
  844. 	<td>Print the results to the default printer (starts inventory immediately, and terminates program when results are printed)</td>
  845. </tr>
  846. <tr>
  847. 	<td colspan="2">&nbsp;</td>
  848. 	<td><code>/SAVE:<em>filename</em></code></td>
  849. 	<td>&nbsp;</td>
  850. 	<td>Save tab delimited results; if <em>filename</em> is not specified or equals "*", "Hardware.<em>computername</em>.<em>timestamp</em>.txt" in the HTA's parent folder will be used; if <em>filename</em> is a folder followed by "\*", "Hardware.<em>computername</em>.<em>timestamp</em>.txt" in the specified folder will be used (starts inventory immediately, and terminates program <em>if</em> and <em>when</em> results are written to file)</td>
  851. </tr>
  852. <tr>
  853. 	<td colspan="2">&nbsp;</td>
  854. 	<td><code>/TEMPDIR:<em>tempdir</em></code></td>
  855. 	<td>&nbsp;</td>
  856. 	<td>Specify a TEMP folder with write access for the current non-admin user (used "internally" by the HTA when restarting with elevated privileges)</td>
  857. </tr>
  858. <tr>
  859. 	<td colspan="5">&nbsp;</td>
  860. </tr>
  861. <tr id="Notes">
  862. 	<td><strong>Notes:</strong></td>
  863. 	<td>&nbsp;</td>
  864. 	<td colspan="3">At startup, the program looks for a file named "Hardware.cfg" in its working directory.
  865.         If it finds it, it will apply its settings first.<br />
  866.         Next, the command line settings are applied.
  867.         In case of conflicts, the command line parameters will prevail.<br />
  868.         Use the "Settings" button to create or edit "Hardware.cfg".<br />
  869.         "Hardware.cfg" might look like this:<br />
  870.         <code>/DMIDecode /DxDiag /KeepXML /USBStor</code></td>
  871. </tr>
  872. <tr>
  873. 	<td colspan="5">&nbsp;</td>
  874. </tr>
  875. <tr>
  876. 	<td colspan="2">&nbsp;</td>
  877. 	<td colspan="3">If the program detects that it runs in a WinPE environment, neither DxDiag nor DMIDecode can be used.<br />
  878. 		In that case, the switches <code>/DMIDecode</code>, <code>/DxDiag</code>, <code>/KeepXML</code> and <code>/XML</code> will all be ignored.<br />
  879. 		The switch <code>/NOADMIN</code> will not be required in a WinPE environment, as the program will have admin privileges by default in WinPE.<br />
  880. 		Note that WMI results in a WinPE environment WMI may be different from the ones returned in a "normal" Windows environment.</td>
  881. </tr>
  882. <tr>
  883. 	<td colspan="5">&nbsp;</td>
  884. </tr>
  885. <tr>
  886. 	<td><strong>Examples:</strong></td>
  887. 	<td>&nbsp;</td>
  888. 	<td colspan="3"><code>HARDWARE.HTA /DMIDecode /DxDiag /KeepXML /USBStor</code></td>
  889. </tr>
  890. <tr>
  891. 	<td colspan="5">&nbsp;</td>
  892. </tr>
  893. <tr>
  894. 	<td colspan="2">&nbsp;</td>
  895. 	<td colspan="3"><code>HARDWARE.HTA /NoUpd /DMIDecode /DxDiag /Save:%ComputerName%_Full_Inventory.txt</code></td>
  896. </tr>
  897. <tr>
  898. 	<td colspan="5">&nbsp;</td>
  899. </tr>
  900. <tr>
  901. 	<td colspan="2">&nbsp;</td>
  902. 	<td colspan="3"><code>HARDWARE.HTA /NoUpd /Basic /Computer:REMOTEPC /Save:REMOTEPC_Basic_Inventory.txt</code></td>
  903. </tr>
  904. <tr>
  905. 	<td colspan="5">&nbsp;</td>
  906. </tr>
  907. <tr>
  908. 	<td><strong>Keyboard:</strong></td>
  909. 	<td>&nbsp;</td>
  910. 	<td colspan="3">Besides Windows' standard "global" keyboard shortcuts, this HTA supports the following keyboard shortcuts:</td>
  911. </tr>
  912. <tr>
  913. 	<td colspan="5">&nbsp;</td>
  914. </tr>
  915. <tr>
  916. 	<td>&nbsp;</td>
  917. 	<td>&nbsp;</td>
  918. 	<td><code>F1</code></td>
  919. 	<td>&nbsp;</td>
  920. 	<td><strong>Help</strong></td>
  921. </tr>
  922. <tr>
  923. 	<td>&nbsp;</td>
  924. 	<td>&nbsp;</td>
  925. 	<td><code>Backspace</code></td>
  926. 	<td>&nbsp;</td>
  927. 	<td><strong>Back</strong> to Main window (only when in Help or Credits window)</td>
  928. </tr>
  929. <tr>
  930. 	<td>&nbsp;</td>
  931. 	<td>&nbsp;</td>
  932. 	<td><code>Esc</code></td>
  933. 	<td>&nbsp;</td>
  934. 	<td><strong>Back</strong> to Main window (only when in Settings, Help or Credits window)</td>
  935. </tr>
  936. <tr>
  937. 	<td>&nbsp;</td>
  938. 	<td>&nbsp;</td>
  939. 	<td><code>Alt+B</code></td>
  940. 	<td>&nbsp;</td>
  941. 	<td>Select <strong><u>B</u>asic</strong> inventory</td>
  942. </tr>
  943. <tr>
  944. 	<td>&nbsp;</td>
  945. 	<td>&nbsp;</td>
  946. 	<td><code>Alt+C</code></td>
  947. 	<td>&nbsp;</td>
  948. 	<td><strong><u>C</u>redits</strong></td>
  949. </tr>
  950. <tr>
  951. 	<td>&nbsp;</td>
  952. 	<td>&nbsp;</td>
  953. 	<td><code>Alt+D</code></td>
  954. 	<td>&nbsp;</td>
  955. 	<td>Toggle <strong><u>D</u>ebug</strong> mode on/off (best started with <code>/DEBUG</code> command line switch)</td>
  956. </tr>
  957. <tr>
  958. 	<td>&nbsp;</td>
  959. 	<td>&nbsp;</td>
  960. 	<td><code>Alt+E</code></td>
  961. 	<td>&nbsp;</td>
  962. 	<td><strong><u>E</u>dit</strong> the configuration file (in Settings screen only)</td>
  963. </tr>
  964. <tr>
  965. 	<td>&nbsp;</td>
  966. 	<td>&nbsp;</td>
  967. 	<td><code>Alt+F</code></td>
  968. 	<td>&nbsp;</td>
  969. 	<td>Select <strong><u>F</u>ull</strong> inventory</td>
  970. </tr>
  971. <tr>
  972. 	<td>&nbsp;</td>
  973. 	<td>&nbsp;</td>
  974. 	<td><code>Alt+G</code></td>
  975. 	<td>&nbsp;</td>
  976. 	<td><strong><u>G</u>o</strong> (start the inventory)</td>
  977. </tr>
  978. <tr>
  979. 	<td>&nbsp;</td>
  980. 	<td>&nbsp;</td>
  981. 	<td><code>Alt+P</code></td>
  982. 	<td>&nbsp;</td>
  983. 	<td><strong>Print <u>P</u>review</strong> in default browser (output in black and white)</td>
  984. </tr>
  985. <tr>
  986. 	<td>&nbsp;</td>
  987. 	<td>&nbsp;</td>
  988. 	<td><code>Alt+R</code></td>
  989. 	<td>&nbsp;</td>
  990. 	<td><strong><u>R</u>eset</strong> main window (only <em>after</em> running the inventory)</td>
  991. </tr>
  992. <tr>
  993. 	<td>&nbsp;</td>
  994. 	<td>&nbsp;</td>
  995. 	<td><code>Alt+S</code></td>
  996. 	<td>&nbsp;</td>
  997. 	<td><strong><u>S</u>ettings</strong></td>
  998. </tr>
  999. <tr>
  1000. 	<td>&nbsp;</td>
  1001. 	<td>&nbsp;</td>
  1002. 	<td><code>Ctrl+P</code></td>
  1003. 	<td>&nbsp;</td>
  1004. 	<td><strong><u>P</u>rint</strong> (output in the HTA's screen colors)</td>
  1005. </tr>
  1006. </table>
  1007.  
  1008. <p>&nbsp;</p>
  1009.  
  1010. <p class="Left">If you like this program, why not show your appreciation by making a donation?</p>
  1011.  
  1012. <p class="Left">Click <input type="button" class="Button" value="Donate" onclick="vbscript:ShowDonate" style="vertical-align: middle;" /> or navigate to <a href="https://www.robvanderwoude.com/donate.php">https://www.robvanderwoude.com/donate.php</a></p>
  1013.  
  1014. <p class="Left">Your support is highly appreciated.</p>
  1015.  
  1016. <p>&nbsp;</p>
  1017.  
  1018. </div><!-- end of "HelpScreen" area -->
  1019.  
  1020.  
  1021.  
  1022. <div id="CreditsScreen" class="DontPrint">
  1023.  
  1024. <h1>Credits</h1>
  1025.  
  1026. <h2>Basic Hardware Inventory, Version <span id="CredVersion">0.00</span></h2>
  1027.  
  1028. <p>&nbsp;</p>
  1029.  
  1030. <div class="Left">
  1031.  
  1032. <p>This program in its current state could not have been created without the help of others.<br />
  1033. Thanks to all the people involved, whether mentioned here or not.</p>
  1034.  
  1035. <p>The program was created using the Microsoft Scripting Guys' Scriptomatic 2.0 and HTA Helpomatic tools, and Adersoft's HTAEdit (now embedded in <a href="https://vbsedit.com/">VbsEdit</a>).</p>
  1036.  
  1037. <p>The decision to use the <code>MSFT_PhysicalDisk</code> class in the <code>root/Microsoft/Windows/Storage</code> namespace instead of the <code>Win32_DiskDrive</code> class in the <code>root/CIMV2</code> namespace to get more reliable results was based on a <a href="https://www.pdq.com/blog/determining-disk-type-with-get-physicaldisk/">PowerShell script by Kris Powell</a>.</p>
  1038.  
  1039. <p>The code to handle video memory over 4 GB was based on <a href="https://superuser.com/questions/1461858/fetch-correct-vram-for-gpu-via-command-line-on-windows/1497378#1497378">PowerShell code by "farag"</a>.</p>
  1040.  
  1041. <p>The Chassis routine was based on a <a href="https://www.computerperformance.co.uk/ezine/ezine94/">script by Guy Thomas</a>.</p>
  1042.  
  1043. <p>The HandleClass routine was based on the Microsoft TechNet ScriptCenter article "Scripting Eye for the GUI Guy".</p>
  1044.  
  1045. <p>WinPE detection was based on a <a href="https://techgenix.com/HowtodetectwhetheryouareinWindowsPE/">tip by Mitch Tulloch</a>.</p>
  1046.  
  1047. <p>The code to <a href="https://www.sccmog.com/get-current-old-machine-name-winpe-vbscript/">find the computer name in WinPE</a> was based on Richie Schuster's.</p>
  1048.  
  1049. <p>Trick to <a href="http://blog.sevagas.com/?Hacking-around-HTA-files">embed an icon in the HTA</a> by Emeric Nasi.</p>
  1050.  
  1051. <p>Steve Robertson thoroughly tested the program and sent me many bug reports, fixes, and suggestions for improvements.</p>
  1052.  
  1053. <p>Gary Johnson suggested to use DxDiag for video properties, and he also assisted in testing the DxDiag feature.</p>
  1054.  
  1055. <p>DMI (SMBIOS) details for the local computer are retrieved by <a href="https://gnuwin32.sourceforge.net/packages/dmidecode.htm">DMIDecode for Windows</a>, if installed.</p>
  1056.  
  1057. <p>List of 3-letter monitor manufacturer codes found in <a href="https://community.lansweeper.com/t5/managing-assets/list-of-3-letter-monitor-manufacturer-codes/ta-p/64429">Lansweeper knowledgebase</a>.</p>
  1058.  
  1059.  
  1060.  
  1061. <p>&nbsp;</p>
  1062.  
  1063. <p>If you like this program, why not show your appreciation by making a donation?</p>
  1064.  
  1065. <p>Click <input type="button" class="Button" value="Donate" onclick="vbscript:ShowDonate" style="vertical-align: middle;" /> or navigate to <a href="https://www.robvanderwoude.com/donate.php">https://www.robvanderwoude.com/donate.php</a></p>
  1066.  
  1067. <p class="Left">Your support is highly appreciated.</p>
  1068.  
  1069. </div><!-- end of left alignment -->
  1070.  
  1071. <p>&nbsp;</p>
  1072.  
  1073. </div><!-- end of "CreditsScreen" area -->
  1074.  
  1075.  
  1076.  
  1077. <div id="PrintScreen" class="PrintOnly">
  1078. <p>This field will contain the results of the last inventory; it is used for "fast" printing with Ctrl+P only.</p>
  1079. </div><!-- end of "PrintScreen" area -->
  1080.  
  1081.  
  1082.  
  1083. <div class="DontPrint">
  1084.  
  1085. <p>Basic Hardware Inventory,&nbsp; Version <span id="AppVersion">0.00</span><br />
  1086. <span style="font-size: 80%;">&copy; 2005 - <span id="AppYear">2016</span>, Rob van der Woude<br />
  1087. <a href="https://www.robvanderwoude.com/hardware.php">https://www.robvanderwoude.com/hardware.php</a></span></p>
  1088.  
  1089. <p>&nbsp;</p>
  1090.  
  1091. <p id="Back" style="display: none;"><input type="button" class="Button" value="Back" onclick="vbscript:ShowMain" /></p>
  1092.  
  1093. <p>&nbsp;</p>
  1094.  
  1095. </div><!-- end of "DontPrint" area -->
  1096.  
  1097. </div><!-- end of centered text -->
  1098.  
  1099. </body>
  1100. </html>

page last modified: 2024-04-16; loaded in 0.1133 seconds