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.03"
  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 = 2024
  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 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. 	gvsDetails = gvsDetails & HandleRegEnum( HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Enum\HDAUDIO", True )
  1564. 	If gvaSettingsBool.Item( "DXDIAG" ) Then
  1565. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleXMLNode( "/DxDiag/DirectSound/SoundDevices/SoundDevice" )
  1566. 	End If
  1567. 	DetailsWindow "Sound Devices", gvsDetails
  1568. End Sub
  1569.  
  1570.  
  1571. Sub DetailsVideo( )
  1572. 	Dim arrSubKeys, i, intResult, objReg, strKey
  1573. 	gvsDetails = HandleClass( "Win32_VideoController",         "root/CIMV2" ) & vbCrLf & vbCrLf _
  1574. 	           & HandleClass( "CIM_VideoControllerResolution", "root/CIMV2" ) & vbCrLf & vbCrLf _
  1575. 	           & HandleClass( "Win32_WinSAT",                  "root/CIMV2" )
  1576. 	Set objReg = GetObject( "winmgmts:{impersonationLevel=impersonate}!//" & gvsComputer & "/root/default:StdRegProv" )
  1577. 	strKey    = "SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}"
  1578. 	intResult = objReg.EnumKey( HKEY_LOCAL_MACHINE, strKey, arrSubKeys )
  1579. 	If intResult = 0 Then
  1580. 		For i = 0 To UBound( arrSubKeys )
  1581. 			If IsNumeric( arrSubKeys(i) ) Then
  1582. 				gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleRegEnum( HKEY_LOCAL_MACHINE, strKey & "\" & arrSubKeys(i), 0 )
  1583. 			End If
  1584. 		Next
  1585. 	End If
  1586. 	Set objReg = Nothing
  1587.  
  1588. 	If gvaSettingsBool.Item( "DXDIAG" ) Then
  1589. 		gvsDetails = gvsDetails & vbCrLf & vbCrLf & HandleXMLNode( "/DxDiag/DisplayDevices/DisplayDevice" )
  1590. 	End If
  1591. 	DetailsWindow "Display Adapters", gvsDetails
  1592. End Sub
  1593.  
  1594.  
  1595. Sub DetailsWindow( strCategory, gvsDetails )
  1596. 	Dim objDetailsFile, strHTMLBody, strHTMLFoot, strHTMLHead
  1597.  
  1598. 	strHTMLHead = "<html><head><title>" & strCategory & " details for " & gvsComputer & "</title></head><body>"
  1599. 	strHTMLBody = "<h1 style=""text-align: center;"">" & strCategory & " details for " & gvsComputer & "</h1> <pre style=""font-family: courier,monospace"">" & gvsDetails & "</pre>"
  1600. 	strHTMLFoot = "</body></html>"
  1601.  
  1602. 	' Create a temporary HTML file and open it in the default browser
  1603. 	Set objDetailsFile = gvoFSO.CreateTextFile( gvsDetailsFile )
  1604. 	objDetailsFile.Write( strHTMLHead )
  1605. 	objDetailsFile.Write( strHTMLBody )
  1606. 	objDetailsFile.Write( strHTMLFoot )
  1607. 	objDetailsFile.Close
  1608. 	Set objDetailsFile = Nothing
  1609. 	gvoWSHShell.Run gvsDetailsFile, , False
  1610. End Sub
  1611.  
  1612.  
  1613. Sub EditSettings( )
  1614. 	gvoWSHShell.Run "notepad.exe """ & gvsConfigFile & """", 1, True
  1615. 	ConfigReadFile
  1616. 	ConfigUpdateStatus
  1617. End Sub
  1618.  
  1619.  
  1620. Sub EnableWinSATScores( )
  1621. 	Dim objItem
  1622. 	' Hide WinSAT Score fields if not applicable
  1623. 	For Each objItem In document.all
  1624. 		If objItem.className = "Scores" Then
  1625. 			If gvaSettingsBool.Item( "NOSCORES" ) Or gvbWinPE Then
  1626. 				objItem.style.display    = "none"
  1627. 				objItem.style.visibility = "collapse"
  1628. 			Else
  1629. 				objItem.style.display    = "table-cell"
  1630. 				objItem.style.visibility = "visible"
  1631. 			End If
  1632. 		End If
  1633. 	Next
  1634. End Sub
  1635.  
  1636.  
  1637. Function GetBusType( myInt )
  1638. 	Dim arrBusTypes, strBusType
  1639. 	strBusType = "Unknown"
  1640. 	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", ";" )
  1641. 	If IsNumeric( myInt ) Then
  1642. 		If CInt( myint ) >= 0 And CInt( myInt ) <= UBound( arrBusTypes ) Then
  1643. 			strBusType = arrBusTypes( CInt( myInt ) )
  1644. 		End If
  1645. 	End If
  1646. 	GetBusType = strBusType
  1647. End Function
  1648.  
  1649.  
  1650. Function GetChassis( )
  1651. 	' Based on a script by Guy Thomas http://computerperformance.co.uk/
  1652. 	Dim colChassis, objChassis, strChassis
  1653. 	Set colChassis = gvoWMIrootCimv2.ExecQuery( "Select ChassisTypes from Win32_SystemEnclosure" )
  1654. 	For Each objChassis in colChassis
  1655. 		Select Case objChassis.ChassisTypes(0) ' ChassisTypes is returned as an array of integers
  1656. 			Case 1:
  1657. 				strChassis = "Maybe Virtual Machine"
  1658. 			Case 2:
  1659. 				strChassis = "Unknown"
  1660. 			Case 3:
  1661. 				strChassis = "Desktop"
  1662. 			Case 4:
  1663. 				strChassis = "Thin Desktop"
  1664. 			Case 5:
  1665. 				strChassis = "Pizza Box"
  1666. 			Case  6:
  1667. 				strChassis = "Mini Tower"
  1668. 			Case 7:
  1669. 				strChassis = "Full Tower"
  1670. 			Case 8:
  1671. 				strChassis = "Portable"
  1672. 			Case 9:
  1673. 				strChassis = "Laptop"
  1674. 			Case 10:
  1675. 				strChassis = "Notebook"
  1676. 			Case 11:
  1677. 				strChassis = "Hand Held"
  1678. 			Case 12:
  1679. 				strChassis = "Docking Station"
  1680. 			Case 13:
  1681. 				strChassis = "All in One"
  1682. 			Case 14:
  1683. 				strChassis = "Sub Notebook"
  1684. 			Case 15:
  1685. 				strChassis = "Space-Saving"
  1686. 			Case 16:
  1687. 				strChassis = "Lunch Box"
  1688. 			Case 17:
  1689. 				strChassis = "Main System Chassis"
  1690. 			Case 18:
  1691. 				strChassis = "Lunch Box"
  1692. 			Case 19:
  1693. 				strChassis = "SubChassis"
  1694. 			Case 20:
  1695. 				strChassis = "Bus Expansion Chassis"
  1696. 			Case 21:
  1697. 				strChassis = "Peripheral Chassis"
  1698. 			Case 22:
  1699. 				strChassis = "Storage Chassis"
  1700. 			Case 23:
  1701. 				strChassis = "Rack Mount Unit"
  1702. 			Case 24:
  1703. 				strChassis = "Sealed-Case PC"
  1704. 			Case Else:
  1705. 				strChassis = "Unknown"
  1706. 		End Select
  1707. 	Next
  1708. 	GetChassis = strChassis
  1709. End Function
  1710.  
  1711.  
  1712. Sub GetDefaultBrowser( )
  1713. 	Dim strProgID, wshShell
  1714. 	' Get default browser name
  1715. 	strProgID = gvoWSHShell.RegRead( "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice\ProgID" )
  1716. 	If InStr( strProgID, "-" ) Then
  1717. 		gvsDefaultBrowserName = Left( strProgID, InStr( strProgID, "-" ) - 1 )
  1718. 	Else
  1719. 		gvsDefaultBrowserName = strProgID
  1720. 	End If
  1721. 	If Right( gvsDefaultBrowserName, 4 ) = "HTML" Then gvsDefaultBrowserName = Left( gvsDefaultBrowserName, Len( gvsDefaultBrowserName ) - 4 )
  1722. 	If Right( gvsDefaultBrowserName, 3 ) = "HTM"  Then gvsDefaultBrowserName = Left( gvsDefaultBrowserName, Len( gvsDefaultBrowserName ) - 3 )
  1723. 	If Right( gvsDefaultBrowserName, 3 ) = "URL"  Then gvsDefaultBrowserName = Left( gvsDefaultBrowserName, Len( gvsDefaultBrowserName ) - 3 )
  1724. 	DebugMessage "", "Default browser name = """ & gvsDefaultBrowserName & """"
  1725. 	' Get default browser path
  1726. 	gvsDefaultBrowserPath = gvoWSHShell.RegRead( "HKEY_CLASSES_ROOT\" & strProgID & "\shell\open\command\" )
  1727. 	If Left( gvsDefaultBrowserPath, 1 ) = """" Then
  1728. 		gvsDefaultBrowserPath = Replace( Left( gvsDefaultBrowserPath, InStr( 2, gvsDefaultBrowserPath, """" ) ), """", "" )
  1729. 	ElseIf Not gvsDefaultBrowserPath = "" And Not gvsDefaultBrowserPath = Null Then
  1730. 		gvsDefaultBrowserPath = Left( gvsDefaultBrowserPath, InStr( gvsDefaultBrowserPath, " " ) - 1 )
  1731. 	End If
  1732. 	DebugMessage "", "Default browser path = """ & gvsDefaultBrowserPath & """"
  1733. End Sub
  1734.  
  1735.  
  1736. Function GetHostName( myComputer )
  1737. 	' This function uses a stripped version of my Hostname.cmd (version 3) batch file to get
  1738. 	' the hostname for the specified computer without requiring WMI access to that computer.
  1739. 	Dim objBatFile, objDatFile, strBatFile, strDatFile, strHostName
  1740. 	strHostName = myComputer
  1741. 	strBatFile  = gvoWSHShell.ExpandEnvironmentStrings( "%Temp%.\~hostname.bat" )
  1742. 	strDatFile  = strBatFile & ".dat"
  1743. 	With gvoFSO
  1744. 		If .FileExists( strBatFile ) Then .DeleteFile strBatFile
  1745. 		If .FileExists( strDatFile ) Then .DeleteFile strDatFile
  1746. 		Set objBatFile = .OpenTextFile( strBatFile, ForWriting, True, TristateFalse )
  1747. 		objBatFile.WriteLine "@ECHO OFF"
  1748. 		objBatFile.WriteLine "SETLOCAL ENABLEDELAYEDEXPANSION"
  1749. 		objBatFile.WriteLine "ECHO ""%~1"" | FIND.EXE "":"" >NUL && SET IPv4=|| SET IPv4=-4"
  1750. 		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)"
  1751. 		objBatFile.WriteLine "ENDLOCAL"
  1752. 		objBatFile.Close
  1753. 		Set objBatFile = Nothing
  1754. 		gvoWSHShell.Run strBatFile & " " & strHostName, 7, True
  1755. 		Sleep 1
  1756. 		.DeleteFile strBatFile
  1757. 		Set objDatFile = .OpenTextFile( strDatFile, ForReading, False, TristateFalse )
  1758. 		strHostName = objDatFile.ReadLine( )
  1759. 		objDatFile.Close
  1760. 		Set objDatFile = Nothing
  1761. 		.DeleteFile strDatFile
  1762. 	End With
  1763. 	GetHostName = strHostName
  1764. End Function
  1765.  
  1766.  
  1767. Function GetLocalComputerName( )
  1768. 	If gvbWinPE Then
  1769. 		GetLocalComputerName = GetLocalComputerNameWinPE( )
  1770. 	Else
  1771. 		GetLocalComputerName = UCase( gvoWSHShell.ExpandEnvironmentStrings( "%ComputerName%" ) )
  1772. 	End If
  1773. End Function
  1774.  
  1775.  
  1776. Function GetLocalComputerNameWinPE( )
  1777. ' Find computer name in WinPE
  1778. ' Based on code by Richie Schuster
  1779. ' http://www.sccmog.com/get-current-old-machine-name-winpe-vbscript/
  1780. ' Caveat: In case of a multi-boot system with multiple computer names, the script
  1781. '         only returns the computer name of the last Windows installation it finds
  1782. 	Dim colItems, objItem, objWMIService
  1783. 	GetLocalComputerNameWinPE = "localhost"
  1784. 	On Error Resume Next ' REQUIRED
  1785. 	' Find the Windows drive
  1786. 	If gvsWinDrive = "" Then
  1787. 		Set objWMIService = GetObject( "winmgmts://./root/CIMV2" )
  1788. 		Set colItems      = objWMIService.ExecQuery ( "SELECT * FROM Win32_LogicalDisk" )
  1789. 		For Each objItem in colItems
  1790. 			If gvoFSO.FolderExists( gvoFSO.BuildPath( objItem.DeviceID, "Windows\System32" ) ) Then
  1791. 				gvsWinDrive = objItem.DeviceID
  1792. 			End If
  1793. 		Next
  1794. 	End If
  1795. 	If gvsWinDrive <> "" Then
  1796. 		' Mount registry hive from Windows drive
  1797. 		gvoWSHShell.Run "CMD.EXE /C REG.EXE Load HKLM\TempHive " & gvsWinDrive & "\windows\system32\config\system", 0, True
  1798. 		' Read computer name from mounted registry hive
  1799. 		GetLocalComputerNameWinPE = UCase( gvoWSHShell.RegRead( "HKEY_LOCAL_MACHINE\TempHive\ControlSet001\Control\ComputerName\ComputerName\ComputerName" ) )
  1800. 		' Unmount registry hive from Windows drive
  1801. 		gvoWSHShell.Run "CMD.EXE /C REG.EXE Load HKLM\TempHive", 0, True
  1802. 	End If
  1803. 	Set colItems      = Nothing
  1804. 	Set objWMIService = Nothing
  1805. 	On Error Goto 0
  1806. End Function
  1807.  
  1808.  
  1809. Function GetMediaType( mtnumber )
  1810. 	Dim strMediaTypeDescription
  1811. 	strMediaTypeDescription = "Unknown"
  1812. 	Select Case mtnumber
  1813. 		Case 1:
  1814. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 1.2 MB"
  1815. 		Case 2:
  1816. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 1.44 MB"
  1817. 		Case 3:
  1818. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 2.88 MB"
  1819. 		Case 4:
  1820. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 20.8 MB"
  1821. 		Case 5:
  1822. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 720 KB"
  1823. 		Case 6:
  1824. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 360 KB"
  1825. 		Case 7:
  1826. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 320 KB"
  1827. 		Case 8:
  1828. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 320 KB"
  1829. 		Case 9:
  1830. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 180 KB"
  1831. 		Case 10:
  1832. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 160 KB"
  1833. 		Case 11:
  1834. 			strMediaTypeDescription = "Removable media other than floppy"
  1835. 		Case 12:
  1836. 			strMediaTypeDescription = "Fixed hard disk media"
  1837. 		Case 13:
  1838. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 120 MB"
  1839. 		Case 14:
  1840. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 640 KB"
  1841. 		Case 15:
  1842. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 640 KB"
  1843. 		Case 16:
  1844. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 720 KB"
  1845. 		Case 17:
  1846. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 1.2 MB"
  1847. 		Case 18:
  1848. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 1.23 MB"
  1849. 		Case 19:
  1850. 			strMediaTypeDescription = "5.25 Inch Floppy Disk 1.23 MB"
  1851. 		Case 20:
  1852. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 128 MB"
  1853. 		Case 21:
  1854. 			strMediaTypeDescription = "3.5 Inch Floppy Disk 230 MB"
  1855. 		Case 22:
  1856. 			strMediaTypeDescription = "8 Inch Floppy Disk 256 KB"
  1857. 		Case Else:
  1858. 			strMediaTypeDescription = "Unknown"
  1859. 	End Select
  1860. 	GetMediaType = strMediaTypeDescription
  1861. End Function
  1862.  
  1863.  
  1864. Function GetMemoryFormFactor( )
  1865. 	Dim colItems, objItem, objWMIService, intFormFactor, strFormFactor, strQuery
  1866. 	intFormFactor = 0
  1867. 	strFormFactor = ""
  1868. 	strQuery = "SELECT FormFactor FROM Win32_PhysicalMemory"
  1869. 	Set objWMIService = GetObject( "winmgmts://" & gvsComputer & "/root/CIMV2"   )
  1870. 	Set colItems = objWMIService.ExecQuery( strQuery )
  1871. 	If Not Err Then
  1872. 		For Each objItem In colItems
  1873. 			intFormFactor = CInt( objItem.FormFactor )
  1874. 		Next
  1875. 	End If
  1876. 	Select Case intFormFactor
  1877. 		Case 0:
  1878. 			strFormFactor = "Unknown"
  1879. 		Case 1:
  1880. 			strFormFactor = "Other"
  1881. 		Case 2:
  1882. 			strFormFactor = "SIP"
  1883. 		Case 3:
  1884. 			strFormFactor = "DIP"
  1885. 		Case 4:
  1886. 			strFormFactor = "ZIP"
  1887. 		Case 5:
  1888. 			strFormFactor = "SOJ"
  1889. 		Case 6:
  1890. 			strFormFactor = "Proprietary"
  1891. 		Case 7:
  1892. 			strFormFactor = "SIMM"
  1893. 		Case 8:
  1894. 			strFormFactor = "DIMM"
  1895. 		Case 9:
  1896. 			strFormFactor = "TSOP"
  1897. 		Case 10:
  1898. 			strFormFactor = "PGA"
  1899. 		Case 11:
  1900. 			strFormFactor = "RIMM"
  1901. 		Case 12:
  1902. 			strFormFactor = "SODIMM"
  1903. 		Case 13:
  1904. 			strFormFactor = "SRIMM"
  1905. 		Case 14:
  1906. 			strFormFactor = "SMD"
  1907. 		Case 15:
  1908. 			strFormFactor = "SSMP"
  1909. 		Case 16:
  1910. 			strFormFactor = "QFP"
  1911. 		Case 17:
  1912. 			strFormFactor = "TQFP"
  1913. 		Case 18:
  1914. 			strFormFactor = "SOIC"
  1915. 		Case 19:
  1916. 			strFormFactor = "LCC"
  1917. 		Case 20:
  1918. 			strFormFactor = "PLCC"
  1919. 		Case 21:
  1920. 			strFormFactor = "BGA"
  1921. 		Case 22:
  1922. 			strFormFactor = "FPBGA"
  1923. 		Case 23:
  1924. 			strFormFactor = "LGA"
  1925. 		Case Else:
  1926. 			strFormFactor = "Unknown"
  1927. 	End Select
  1928. 	GetMemoryFormFactor = strFormFactor
  1929. End Function
  1930.  
  1931.  
  1932. Function GetOSVer( )
  1933. 	Dim arrOS, colItems, objItem, objWMIService
  1934. 	GetOSVer = 0
  1935. 	Set objWMIService = GetObject( "winmgmts://./root/CIMV2" )
  1936. 	Set colItems = objWMIService.ExecQuery( "SELECT Version FROM Win32_OperatingSystem" )
  1937. 	If Not Err Then
  1938. 		For Each objItem In colItems
  1939. 			arrOS = Split( objItem.Version, "." )
  1940. 			If UBound( arrOS ) > 1 Then
  1941. 				GetOSVer = arrOS(0) & "." & arrOS(1)
  1942. 			Else
  1943. 				GetOSVer = arrOS(0)
  1944. 			End If
  1945. 		Next
  1946. 	End If
  1947. 	Set colItems      = Nothing
  1948. 	Set objWMIService = Nothing
  1949. End Function
  1950.  
  1951.  
  1952. Function GetParameter( myString, myParameter )
  1953. 	' Extract switch value from command line,
  1954. 	' e.g. GetParameter( "/CM /SIZE:1024x768 /NOUPD", "SIZE" ) to extract "1024x768"
  1955. 	Dim strItem, strParameter, strString
  1956. 	' Default return value is an empty string
  1957. 	strParameter = UCase( myParameter )
  1958. 	myString     = Trim( myString )
  1959. 	strString    = UCase( myString )
  1960. 	If InStr( strString, "/" & strParameter & ":" ) Then
  1961. 		' Step 1: extract switch and everything following it, e.g. "/SIZE:1024x768 /NOUPD"
  1962. 		strItem = Mid( myString, InStr( strString, "/" & strParameter & ":" ) )
  1963. 		' Check if there is anything following the switch and colon
  1964. 		If Len( strItem ) > Len( "/" & strParameter & ":" ) Then
  1965. 			' Step 2: remove the switch name and colon, e.g. in our example this leaves us with "1024x768 /NOUPD"
  1966. 			strItem = Mid( strItem, Len( "/" & strParameter & ":" ) + 1 )
  1967. 			' Check again if there is anything left to parse
  1968. 			If Len( strItem ) > 1 Then
  1969. 				' Check if the value starts with a doublequote
  1970. 				If Left( strItem, 1 ) = """" Then
  1971. 					' Remove the opening doublequote
  1972. 					strItem = Mid( strItem, 2 )
  1973. 					' Remove the closing doublequote and everything after it
  1974. 					strItem = Left( strItem, InStr( strItem, """" ) - 1 )
  1975. 				Else
  1976. 					' If not in doublequotes, remove the first space and everything following it,
  1977. 					' e.g. in our example this leaves us with "1024x768"
  1978. 					If InStr( strItem, " " ) Then strItem = Left( strItem, InStr( strItem, " " ) - 1 )
  1979. 				End If
  1980. 				' Return the result
  1981. 				GetParameter = Trim( strItem )
  1982. 			End If
  1983. 		End If
  1984. 	End If
  1985. End Function
  1986.  
  1987.  
  1988. Function GetRandomString( myLength )
  1989. 	Dim i, intChar, strResult
  1990. 	strResult = ""
  1991. 	For i = 1 To myLength
  1992. 		intChar = gvoRandom.Next_2( 48, 83 )
  1993. 		If intChar > 57 Then intChar = intChar + 7 ' numbers and captital letters only
  1994. 		strResult = strResult & Chr( intChar )
  1995. 	Next
  1996. 	GetRandomString = strResult
  1997. End Function
  1998.  
  1999.  
  2000. Function GetVideoRAM( myVideoCard )
  2001. 	' UInt32 cannot handle 4GB and greater, so we'll have to look it up in the registry
  2002. 	' Based on PowerShell code by "farag" at
  2003. 	' https://superuser.com/questions/1461858/fetch-correct-vram-for-gpu-via-command-line-on-windows/1497378#1497378
  2004. 	' Corrected for remote computers AND for multiple video controllers AND for both integrated and discrete video controllers by Steve Robertson
  2005. 	Dim arrSubKeys
  2006. 	Dim binVidMem
  2007. 	Dim i, intRegKeyCount, lngVidMem
  2008. 	Dim objReg
  2009. 	Dim strAdapterName, strRegKey, strSubKey, strVidMem
  2010.  
  2011. 	lngVidMem   = 0
  2012.  
  2013. 	strRegKey = "SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}"
  2014. 	Set objReg = GetObject( "winmgmts:{impersonationLevel=impersonate}!//" & gvaSettingsStr.Item( "COMPUTER" ) & "/root/default:StdRegProv" )
  2015. 	If objReg.EnumKey( HKEY_LOCAL_MACHINE, strRegKey, arrSubKeys ) = 0 Then
  2016. 		For intRegKeyCount = 0 To UBound( arrSubKeys )
  2017. 			If IsNumeric( arrSubKeys( intRegKeyCount ) ) Then
  2018. 				strSubKey = strRegKey & "\" & Right( "0000" & intRegKeyCount, 4 )
  2019. 				If objReg.GetStringValue( HKEY_LOCAL_MACHINE, strSubKey, "DriverDesc", strAdapterName ) = 0 Then
  2020. 					If strAdapterName = myVideoCard Then
  2021. 						' If a value is specified for HardwareInformation.qwMemorySize, the memory size is 4GB or more and we can ignore HardwareInformation.MemorySize
  2022. 						If objReg.GetQWORDValue( HKEY_LOCAL_MACHINE, strSubKey, "HardwareInformation.qwMemorySize", lngVidMem ) = 0 Then
  2023. 							' lngVidMem contains the amount of video RAM in bytes
  2024. 						ElseIf objReg.GetDWORDValue( HKEY_LOCAL_MACHINE, strSubKey, "HardwareInformation.MemorySize", lngVidMem ) = 0 Then
  2025. 							' lngVidMem contains the amount of video RAM in bytes
  2026. 						ElseIf objReg.GetBinaryValue( HKEY_LOCAL_MACHINE, strSubKey, "HardwareInformation.MemorySize", binVidMem ) = 0 Then
  2027. 							' binVidMem contains the amount of video RAM in MB and specified in a binary array
  2028. 							strVidMem = ""
  2029. 							For i = 0 To UBound( binVidMem )
  2030. 								strVidMem = strVidMem & binVidMem( i )
  2031. 							Next
  2032. 							lngVidMem = Int( strVidMem ) * MB
  2033. 						Else
  2034. 							lngVidMem = 0
  2035. 						End If
  2036. 					End If
  2037. 				End If
  2038. 			End If
  2039. 		Next
  2040. 	Else
  2041. 		Exit Function
  2042. 	End If
  2043. 	Set objReg = Nothing
  2044. 	GetVideoRAM = Round( lngVidMem / MB )
  2045. End Function
  2046.  
  2047.  
  2048. Function HandleClass( myClass, myNameSpace )
  2049. ' This subroutine lists all properties and their values for a specified class.
  2050. ' Created using an example from a Microsoft TechNet ScriptCenter article:
  2051. ' http://www.microsoft.com/technet/scriptcenter/resources/guiguy/default.mspx
  2052. 	Dim blnNumChain, colItems, intChar, intPadding, intTest, objClass, objItem, objProperty, objWMIService2, strPadding, strProperties
  2053.  
  2054. 	On Error Resume Next ' REQUIRED
  2055.  
  2056. 	strProperties = "<h2>\\" & gvsComputer & "\" & Replace( myNameSpace, "/", "\" ) & ":" & myClass & "</h2>" & vbCrLf & vbCrLf
  2057.  
  2058. 	If LCase( myNameSpace ) = "root/cimv2" Then
  2059. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM " & myClass )
  2060. 		Set objClass = gvoWMIrootCimv2.Get( myClass )
  2061. 		If Err Then
  2062. 			HandleClass = strProperties & "<p>Error while trying to query \\" & gvsComputer & "\root\CIMV2\" & myClass & "</p>" & vbCrLf & vbCrLf
  2063. 			Exit Function
  2064. 		End If
  2065. 	ElseIf LCase( myNameSpace ) = "root/wmi" Then
  2066. 		Set colItems = gvoWMIrootWMI.ExecQuery( "SELECT * FROM " & myClass )
  2067. 		Set objClass = gvoWMIrootWMI.Get( myClass )
  2068. 		If Err Then
  2069. 			HandleClass = strProperties & "<p>Error while trying to query \\" & gvsComputer & "\root\WMI\" & myClass & "</p>" & vbCrLf & vbCrLf
  2070. 			Exit Function
  2071. 		End If
  2072. 	ElseIf LCase( myNameSpace ) = "root/standardcimv2" Then
  2073. 		Set colItems = gvoWMIrootStandardCimv2.ExecQuery( "SELECT * FROM " & myClass )
  2074. 		Set objClass = gvoWMIrootStandardCimv2.Get( myClass )
  2075. 		If Err Then
  2076. 			HandleClass = strProperties & "<p>Error while trying to query \\" & gvsComputer & "\root\StandardCimv2\" & myClass & "</p>" & vbCrLf & vbCrLf
  2077. 			Exit Function
  2078. 		End If
  2079. 	Else
  2080. 		Set objWMIService2 = GetObject( "winmgmts://" & gvsComputer & "/" & myNameSpace )
  2081. 		If Err Then
  2082. 			HandleClass = strProperties & "<p>Error while trying to connect to \\" & gvsComputer & "\" & Replace( myNameSpace, "/", "\" ) & "</p>" & vbCrLf & vbCrLf
  2083. 			Exit Function
  2084. 		End If
  2085. 		Set colItems = objWMIService2.ExecQuery( "SELECT * FROM " & myClass )
  2086. 		Set objClass = objWMIService2.Get( myClass )
  2087. 		If Err Then
  2088. 			HandleClass = strProperties & "<p>Error while trying to query \\" & gvsComputer & "\" & Replace( myNameSpace, "/", "\" ) & "\" & myClass & "</p>" & vbCrLf & vbCrLf
  2089. 			Exit Function
  2090. 		End If
  2091. 	End If
  2092.  
  2093. 	Select Case colItems.Count
  2094. 		Case 0
  2095. 			strProperties = strProperties & "<p>No instances.</p>" & vbCrLf & vbCrLf
  2096. 		Case 1
  2097. 			strProperties = strProperties & "<p>1 instance:</p>" & vbCrLf & vbCrLf
  2098. 		Case Else
  2099. 			strProperties = strProperties & "<p>" & colItems.Count & " instances:</p>" & vbCrLf & vbCrLf
  2100. 	End Select
  2101.  
  2102. 	For Each objItem In colItems
  2103. 		intPadding = 1
  2104. 		For Each objProperty In objClass.Properties_
  2105. 			intPadding = Max( intPadding, Len( CreateLine( objProperty.Name ) ) )
  2106. 		Next
  2107. 		strpadding = Space( intPadding )
  2108. 		For Each objProperty In objClass.Properties_
  2109. 			If objProperty.IsArray = True Then
  2110. 				blnNumChain = True
  2111. 				intTest     = 0
  2112. 				For Each intChar In Eval( "objItem." & objProperty.Name )
  2113. 					If IsNumeric( intChar ) Then
  2114. 						intTest = intTest + intChar
  2115. 					Else
  2116. 						blnNumChain = False
  2117. 						Exit For
  2118. 					End If
  2119. 				Next
  2120. 				If blnNumChain And gvaSettingsBool.Item( "CHAIN" ) And ( intTest > 0 ) And ( InStr( objProperty.Name, "Characteristic" ) < 1 ) And ( InStr( objProperty.Name, "Capabilit" ) < 1 ) Then
  2121. 					strProperties = strProperties & Left( CreateLine( objProperty.Name & " (array)"  ) & strPadding, intPadding ) & " : " & Eval( "Join( objItem." & objProperty.Name & ", "","" )" ) & vbCrLf
  2122. 					strProperties = strProperties & Left( CreateLine( objProperty.Name & " (string)" ) & strPadding, intPadding ) & " : " & Eval( "Chain( objItem." & objProperty.Name & " )" ) & vbCrLf
  2123. 				Else
  2124. 					strProperties = strProperties & Left( CreateLine( objProperty.Name ) & strPadding, intPadding ) & " : " & Eval( "Join( objItem." & objProperty.Name & ", "","" )" ) & vbCrLf
  2125. 				End If
  2126. 			Else
  2127. 				If IsDate( Eval( "objItem." & objProperty.Name ) ) Then
  2128. 					strProperties = strProperties & Left( CreateLine( objProperty.Name ) & strPadding, intPadding ) & " : " & FormatDateTime( Eval( "objItem." & objProperty.Name ) ) & vbCrLf
  2129. 				Else
  2130. 					strProperties = strProperties & Left( CreateLine( objProperty.Name ) & strPadding, intPadding ) & " : " & Eval( "objItem." & objProperty.Name ) & vbCrLf
  2131. 				End If
  2132. 			End If
  2133. 		Next
  2134. 		strProperties = strProperties & vbCrLf & vbCrLf
  2135. 	Next
  2136.  
  2137. 	Set objWMIService2 = Nothing
  2138.  
  2139. 	On Error Goto 0
  2140.  
  2141. 	HandleClass = strProperties
  2142. End Function
  2143.  
  2144.  
  2145. Function HandleDMIDetails( myType )
  2146. 	Dim objCMD, strMsg, strOutput
  2147. 	HandleDMIDetails = ""
  2148. 	If gvbWinPE Then Exit Function
  2149. 	On Error Resume Next ' REQUIRED
  2150. 	Set objCMD = gvoWSHShell.Exec( "CMD.EXE /C """ & gvsDMIDecode & """ --type " & LCase( myType ) & " 2>&1" )
  2151. 	strOutput = objCMD.StdOut.ReadAll
  2152. 	objCMD.Terminate
  2153. 	Set objCMD = Nothing
  2154. 	On Error Goto 0
  2155. 	HandleDMIDetails = "<h2>\\" & gvsComputer & " " & "DMI " & myType & " details</h2>" & vbCrLf & vbCrLf & "<pre>" & strOutput & "</pre>" & vbCrLf
  2156. End Function
  2157.  
  2158.  
  2159. Function HandleRegEnum( myHive, myRegPath, myRecursion )
  2160. 	Dim arrSubkeys, arrValueNames, arrValueTypes
  2161. 	Dim blnRecursion
  2162. 	Dim i, intMaxTypeLen, intMaxNameLen, intResult
  2163. 	Dim objReg
  2164. 	Dim strData, strHive, strResult
  2165. 	Dim varData
  2166. 	blnRecursion = ( myRecursion <> 0 )
  2167. 	strResult     = ""
  2168. 	intMaxTypeLen = 0
  2169. 	intMaxNameLen = 0
  2170. 	Select Case myHive
  2171. 		Case HKEY_CLASSES_ROOT
  2172. 			strHive = "HKEY_CLASSES_ROOT"
  2173. 		Case HKEY_CURRENT_USER
  2174. 			strHive = "HKEY_CURRENT_USER"
  2175. 		Case HKEY_LOCAL_MACHINE
  2176. 			strHive = "HKEY_LOCAL_MACHINE"
  2177. 		Case HKEY_USERS
  2178. 			strHive = "HKEY_USERS"
  2179. 		Case HKEY_CURRENT_CONFIG
  2180. 			strHive = "HKEY_CURRENT_CONFIG"
  2181. 		Case Else
  2182. 			strHive = myHive
  2183. 	End Select
  2184. 	On Error Resume Next ' REQUIRED
  2185. 	Set objReg = GetObject( "winmgmts:{impersonationLevel=impersonate}!//" & gvsComputer & "/root/default:StdRegProv" )
  2186. 	strResult = "<h2>[" & strHive & "\" & myRegPath & "]</h2>" & vbCrLf
  2187. 	intResult = objReg.EnumValues( myHive, myRegPath, arrValueNames, arrValueTypes )
  2188. 	If intResult = 0 Then
  2189. 		If IsArray( arrValueNames ) And IsArray( arrValueTypes ) Then
  2190. 			For i = 0 To UBound( arrValueNames )
  2191. 				If Len( arrValueNames(i) )                 > intMaxNameLen Then intMaxNameLen = Len( arrValueNames(i) )
  2192. 				If Len( gvaRegDataType(arrValueTypes(i)) ) > intMaxTypeLen Then intMaxTypeLen = Len( gvaRegDataType(arrValueTypes(i)) )
  2193. 			Next
  2194. 			For i = 0 To UBound( arrValueNames )
  2195. 				strData = ""
  2196. 				Select Case arrValueTypes(i)
  2197. 					Case REG_SZ:
  2198. 						intResult = objReg.GetStringValue( myHive, myRegPath, arrValueNames(i), strData )
  2199. 					Case REG_EXPAND_SZ:
  2200. 						intResult = objReg.GetExpandedStringValue( myHive, myRegPath, arrValueNames(i), strData )
  2201. 					Case REG_BINARY:
  2202. 						intResult = objReg.GetBinaryValue( myHive, myRegPath, arrValueNames(i), varData )
  2203. 						If Not Err And IsArray( varData ) Then
  2204. 							strData = Join( varData, ";" )
  2205. 						End If
  2206. 					Case REG_DWORD, REG_DWORD_BIG_ENDIAN:
  2207. 						intResult = objReg.GetDWORDValue( myHive, myRegPath, arrValueNames(i), varData )
  2208. 						strData = "0x" & Right( String( 8, "0" ) & CStr( Hex( varData ) ), 8 ) & " (" & varData & ")"
  2209. 					Case REG_MULTI_SZ:
  2210. 						intResult = objReg.GetMultiStringValue( myHive, myRegPath, arrValueNames(i), varData )
  2211. 						strData = Join( varData, ";" )
  2212. 					Case REG_QWORD:
  2213. 						intResult = objReg.GetQWORDValue( myHive, myRegPath, arrValueNames(i), varData )
  2214. 						strData = "0x" & Right( String( 16, "0" ) & CStr( Hex( varData ) ), 16 ) & " (" & varData & ")"
  2215. 				End Select
  2216. 				If intResult = 0 Then
  2217. 					strResult = strResult & Left( arrValueNames(i) & Space( intMaxNameLen + 4 ), intMaxNameLen + 4) & Left( "[" & gvaRegDataType(arrValueTypes(i)) & "]" & Space( intMaxTypeLen + 4 ), intMaxTypeLen + 4 ) & strData & vbCrLf
  2218. 				End If
  2219. 			Next
  2220. 		End If
  2221. 	End If
  2222.  
  2223. 	If blnRecursion And intResult = 0 Then
  2224. 		strResult = strResult & vbCrLf
  2225. 		objReg.EnumKey myHive, myRegPath, arrSubkeys
  2226. 		If Not Err And IsArray( arrSubkeys ) Then
  2227. 			For i = 0 To UBound( arrSubkeys )
  2228. 				strResult = strResult & HandleRegEnum( myHive, myRegPath & "\" & arrSubkeys(i), 1 )
  2229. 			Next
  2230. 		End If
  2231. 	End If
  2232. 	Set objReg = Nothing
  2233. 	On Error Goto 0
  2234. 	HandleRegEnum = strResult
  2235. End Function
  2236.  
  2237.  
  2238. Function HandleXMLNode( myQuery )
  2239. 	Dim i, strDeviceType, strMsg, strQuery2
  2240. 	Dim colNodes, colNodes2, objNode, objNode2, objNode3, objNode4, objNode5, objNode6, xmlDoc
  2241. 	HandleXMLNode = ""
  2242. 	If gvbWinPE Then Exit Function
  2243. 	strDeviceType = Left( myQuery, InStrRev( myQuery, "/" ) - 1 )
  2244. 	strDeviceType = Mid( strDeviceType, InStrRev( strDeviceType, "/" ) + 1 )
  2245. 	strMsg        = "<h2>\\" & gvsComputer & " " & "DxDiag " & strDeviceType & " data</h2>" & vbCrLf & vbCrLf
  2246. 	On Error Resume Next ' REQUIRED
  2247. 	Set xmlDoc = CreateObject( "Microsoft.XMLDOM" )
  2248. 	xmlDoc.Async = "False"
  2249. 	xmlDoc.Load gvaSettingsStr.Item( "XML" )
  2250. 	Set colNodes = xmlDoc.selectNodes( myQuery )
  2251. 	Select Case colNodes.length
  2252. 		Case 0
  2253. 			strMsg = strMsg & "<p>No instances.</p>"
  2254. 		Case 1
  2255. 			strMsg = strMsg & "<p>1 instance:</p>"
  2256. 		Case Else
  2257. 			strMsg = strMsg & "<p>" & colNodes.length & " instances:</p>"
  2258. 	End Select
  2259. 	strMsg = strMsg & vbCrLf & vbCrLf & "<pre>"
  2260. 	For i = 0 To colNodes.length - 1
  2261. 		strQuery2 = myQuery & "[" & i & "]/*"
  2262. 		Set colNodes2 = xmlDoc.selectNodes( strQuery2 )
  2263. 		For Each objNode2 in colNodes2
  2264. 			If objNode2.childNodes.length = 1 Then
  2265. 				strMsg = strMsg & objNode2.nodeName & " = " & objNode2.text & vbCrLf
  2266. 			Else
  2267. 				strMsg = strMsg & objNode2.nodeName & ":" & vbCrLf
  2268. 				For Each objNode3 In objNode2.childNodes
  2269. 					If objNode3.childNodes.length = 1 Then
  2270. 						strMsg = strMsg & "  " & objNode3.nodeName & " = " & objNode3.text & vbCrLf
  2271. 					Else
  2272. 						strMsg = strMsg & objNode3.nodeName & ":" & vbCrLf
  2273. 						For Each objNode4 In objNode3.childNodes
  2274. 							If objNode4.childNodes.length = 1 Then
  2275. 								strMsg = strMsg & "  " & objNode4.nodeName & " = " & objNode4.text & vbCrLf
  2276. 							Else
  2277. 								strMsg = strMsg & objNode4.nodeName & ":" & vbCrLf
  2278. 								For Each objNode5 In objNode4.childNodes
  2279. 									If objNode5.childNodes.length = 1 Then
  2280. 										strMsg = strMsg & "  " & objNode5.nodeName & " = " & objNode5.text & vbCrLf
  2281. 									Else
  2282. 										strMsg = strMsg & objNode5.nodeName & ":" & vbCrLf
  2283. 										For Each objNode6 In objNode5.childNodes
  2284. 											strMsg = strMsg & "  " & objNode6.nodeName & " = " & objNode6.text & vbCrLf
  2285. 										Next
  2286. 									End If
  2287. 								Next
  2288. 							End If
  2289. 						Next
  2290. 					End If
  2291. 				Next
  2292. 			End If
  2293. 		Next
  2294. 		strMsg = strMsg & vbCrLf & vbCrLf
  2295. 	Next
  2296. 	strMsg = strMsg & "</pre>" & vbCrLf
  2297. 	Set colNodes2 = Nothing
  2298. 	Set colNodes  = Nothing
  2299. 	Set xmlDoc    = Nothing
  2300. 	On Error Goto 0
  2301. 	HandleXMLNode = strMsg
  2302. End Function
  2303.  
  2304.  
  2305. Function HandleXMLValue( myQuery )
  2306. 	Dim i, strDeviceType, strMsg, strQuery2
  2307. 	Dim colNodes, colNodes2, objNode, objNode2, objNode3, xmlDoc
  2308. 	HandleXMLValue = ""
  2309. 	If gvbWinPE Then Exit Function
  2310. 	strDeviceType  = Left( myQuery, InStrRev( myQuery, "/" ) - 1 )
  2311. 	strDeviceType  = Mid( strDeviceType, InStrRev( strDeviceType, "/" ) + 1 )
  2312. 	strMsg         = "<h2>\\" & gvsComputer & " " & "DxDiag " & strDeviceType & " data</h2>" & vbCrLf & vbCrLf
  2313. 	On Error Resume Next ' REQUIRED
  2314. 	Set xmlDoc = CreateObject( "Microsoft.XMLDOM" )
  2315. 	xmlDoc.Async = "False"
  2316. 	xmlDoc.Load gvaSettingsStr.Item( "XML" )
  2317. 	Set colNodes = xmlDoc.selectNodes( myQuery )
  2318. 	Select Case colNodes.length
  2319. 		Case 0
  2320. 			strMsg = strMsg & "<p>No instances.</p>"
  2321. 		Case 1
  2322. 			strMsg = strMsg & "<p>1 instance:</p>"
  2323. 		Case Else
  2324. 			strMsg = strMsg & "<p>" & colNodes.length & " instances:</p>"
  2325. 	End Select
  2326. 	strMsg = strMsg & vbCrLf & vbCrLf & "<pre>"
  2327. 	For i = 0 To colNodes.length - 1
  2328. 		strQuery2 = myQuery & "[" & i & "]"
  2329. 		Set colNodes2 = xmlDoc.selectNodes( strQuery2 )
  2330. 		For Each objNode2 in colNodes2
  2331. 			strMsg = strMsg & objNode2.nodeName & " #" & i & " : " & objNode2.text & vbCrLf
  2332. 		Next
  2333. 		strMsg = strMsg & vbCrLf & vbCrLf
  2334. 	Next
  2335. 	strMsg = strMsg & "</pre>" & vbCrLf
  2336. 	Set colNodes2 = Nothing
  2337. 	Set colNodes  = Nothing
  2338. 	Set xmlDoc    = Nothing
  2339. 	On Error Goto 0
  2340. 	HandleXMLValue = strMsg
  2341. End Function
  2342.  
  2343.  
  2344. Sub Initialize( )
  2345. 	Dim i, j, k, objRE
  2346. 	' Read PATH
  2347. 	gvsPATH = Trim( gvoWSHShell.ExpandEnvironmentStrings( "%PATH%" ) )
  2348. 	' Remove empty PATH entries
  2349. 	Set objRE = New RegExp
  2350. 	objRE.Pattern = ";\s+"
  2351. 	gvsPATH = Trim( objRE.Replace( gvsPATH, ";" ) )
  2352. 	objRE.Pattern = ";{2,}"
  2353. 	gvsPATH = Trim( objRE.Replace( gvsPATH, ";" ) )
  2354. 	objRE.Pattern = "(^;|;$)"
  2355. 	gvsPATH = Trim( objRE.Replace( gvsPATH, "" ) )
  2356. 	Set objRE = Nothing
  2357. 	' Split PATH into array of entries
  2358. 	gvaPATH = Split( gvsPATH, ";" )
  2359. 	k = UBound( gvaPATH )
  2360. 	' Trim PATH entries
  2361. 	For i = UBound( gvaPATH ) To 0 Step -1
  2362. 		gvaPATH(i) = Trim( gvaPATH(i) )
  2363. 		' Remove empty PATH entries
  2364. 		If gvaPATH(i) = "" Then
  2365. 			For j = i To k - 1
  2366. 				gvaPATH(j) = gvaPATH(j+1)
  2367. 			Next
  2368. 			k = k - 1
  2369. 		End If
  2370. 	Next
  2371. 	' Resize PATH array to account for removed entries
  2372. 	If k < UBound( gvaPATH ) Then
  2373. 		ReDim Preserve gvaPATH(k)
  2374. 	End If
  2375. 	' Check if in WinPE
  2376. 	gvbWinPE = CheckWinPE( )
  2377. 	If gvbWinPE Then DebugMessage "", "Running in WinPE"
  2378. 	' Reset counters
  2379. 	gvcBanks     = 0
  2380. 	gvcCPU       = 0
  2381. 	gvcMemory    = 0
  2382. 	gviMemSize   = 0
  2383. 	gviMemSpeed  = 0
  2384. 	gviNumOS     = 0
  2385. 	gviMinHeight = Min( 600, window.screen.height )
  2386. 	gviMinWidth  = Min( 800, window.screen.width  )
  2387. 	' Color changes on WMI connection errors
  2388. 	clrBgErr  = "Red"
  2389. 	clrTxtErr = "White"
  2390. 	' This HTA's command line
  2391. 	gvsCommandline   = Hardware.CommandLine
  2392. 	gvsCommandlineUC = UCase( gvsCommandline )
  2393. 	' Create a list of all interface colors available, and fill the theme settings dropdowns with them
  2394. 	ListCSSColors
  2395. 	ListColors "BackgroundColor",     "blue"
  2396. 	ListColors "CaptionsColor",       "white"
  2397. 	ListColors "LinksColor",          "red"
  2398. 	ListColors "ButtonFaceColor",     "silver"
  2399. 	ListColors "ButtonCaptionsColor", "blacl"
  2400. 	ListColors "CodeColor",           "yellow"
  2401. 	' Dictionary objects for global settings
  2402. 	Set gvaDefaultsBool = CreateObject( "Scripting.Dictionary" )
  2403. 	Set gvaDefaultsStr  = CreateObject( "Scripting.Dictionary" )
  2404. 	Set gvaSettingsBool = CreateObject( "Scripting.Dictionary" )
  2405. 	Set gvaSettingsStr  = CreateObject( "Scripting.Dictionary" )
  2406. 	' Read and set defaults
  2407. 	ConfigReadDefaults
  2408. 	' Paths of helper files
  2409. 	gvsConfigFile    = Left( Self.location.pathname, Len( Self.location.pathname ) - 4 ) & ".cfg"
  2410. 	gvsDetailsFile   = gvoFSO.BuildPath( gvaSettingsStr.Item( "TEMPDIR" ), "~hardware~details.html" )
  2411. 	gvsPrintFile     = gvoFSO.BuildPath( gvaSettingsStr.Item( "TEMPDIR" ), "~hardware~print~preview.html" )
  2412. 	gvsDebugText     = ""
  2413. End Sub
  2414.  
  2415.  
  2416. Sub Inventory( )
  2417. 	Dim blnSuccess, colItems, i, objItem, objWMIService
  2418.  
  2419. 	'ComputerName.value = gvsComputer
  2420. 	gvsComputer = UCase( Trim( ComputerName.value ) )
  2421.  
  2422. 	If ComputerName.value <> UCase( gvsComputer ) Then
  2423. 		If gvsComputer <> "" Then
  2424. 			DebugMessage "", "Changing computer name from " & gvsComputer & " to " & Trim( ComputerName.value )
  2425. 		End If
  2426. 	End If
  2427.  
  2428. 	ComputerName.style.backgroundColor = "White"
  2429. 	ComputerName.style.color           = "Black"
  2430. 	ComputerName.disabled              = True
  2431.  
  2432. 	gvbIsLocalComputer = IsLocalComputer( )
  2433.  
  2434.     If ButtonRun.value = "Reset" Then
  2435.     	Reset
  2436.     Else
  2437. 	    ButtonRun.value            = "Reset"
  2438. 	    ButtonRun.accessKey        = "r"
  2439. 	    ButtonRun.title            = "Click here to clear all fields"
  2440. 	    ButtonRun.disabled         = True
  2441. 		CheckboxBIOS.disabled      = True
  2442. 		CheckboxCDROM.disabled     = True
  2443. 		CheckboxCPU.disabled       = True
  2444. 		CheckboxFDD.disabled       = True
  2445. 		CheckboxHDD.disabled       = True
  2446. 		CheckboxKeyboard.disabled  = True
  2447. 		CheckboxMouse.disabled     = True
  2448. 		CheckboxMainBoard.disabled = True
  2449. 		CheckboxMemory.disabled    = True
  2450. 		CheckboxMonitor.disabled   = True
  2451. 		CheckboxNIC.disabled       = True
  2452. 		CheckboxPorts.disabled     = True
  2453. 		CheckboxSound.disabled     = True
  2454. 		CheckboxVideo.disabled     = True
  2455. 		ButtonBasic.disabled       = True
  2456. 		ButtonPaste.disabled       = True
  2457. 		ButtonPrint.disabled       = True
  2458. 		ComputerName.disabled      = True
  2459.  
  2460. 		If Not CheckboxBIOS.Checked Then
  2461. 			BIOSHeader.style.display = "none"
  2462. 			BIOSRow.style.display    = "none"
  2463. 			BIOSFooter.style.display = "none"
  2464. 		End If
  2465. 		If Not CheckboxCDROM.Checked Then
  2466. 			CDROMHeader.style.display = "none"
  2467. 			CDROM0.style.display      = "none"
  2468. 			CDROMFooter.style.display = "none"
  2469. 		End If
  2470. 		If Not CheckboxCPU.Checked Then
  2471. 			CPUHeader.style.display = "none"
  2472. 			CPURow.style.display    = "none"
  2473. 			CPUFooter.style.display = "none"
  2474. 		End If
  2475. 		If Not CheckboxFDD.Checked Then
  2476. 			FDDHeader.style.display = "none"
  2477. 			FDD0.style.display      = "none"
  2478. 			FDDFooter.style.display = "none"
  2479. 		End If
  2480. 		If Not CheckboxHDD.Checked Then
  2481. 			HardDiskHeader.style.display = "none"
  2482. 			HardDisk0.style.display      = "none"
  2483. 			HardDiskFooter.style.display = "none"
  2484. 		End If
  2485. 		If Not CheckboxKeyboard.Checked Then
  2486. 			KeyboardHeader.style.display = "none"
  2487. 			KeyboardRow.style.display    = "none"
  2488. 			KeyboardFooter.style.display = "none"
  2489. 		End If
  2490. 		If Not CheckboxMainBoard.Checked Then
  2491. 			MainBoardHeader.style.display = "none"
  2492. 			MainBoardRow.style.display    = "none"
  2493. 			MainBoardFooter.style.display = "none"
  2494. 		End If
  2495. 		If Not CheckboxMemory.Checked Then
  2496. 			MemHeader.style.display = "none"
  2497. 			MemRow.style.display    = "none"
  2498. 			MemFooter.style.display = "none"
  2499. 		End If
  2500. 		If Not CheckboxMonitor.Checked Then
  2501. 			MonitorHeader.style.display = "none"
  2502. 			Monitor0.style.display      = "none"
  2503. 			MonitorFooter.style.display = "none"
  2504. 		End If
  2505. 		If Not CheckboxMouse.Checked Then
  2506. 			MouseHeader.style.display = "none"
  2507. 			MouseRow.style.display    = "none"
  2508. 			MouseFooter.style.display = "none"
  2509. 		End If
  2510. 		If Not CheckboxNIC.Checked Then
  2511. 			NICHeader.style.display = "none"
  2512. 			NIC0.style.display      = "none"
  2513. 			NICFooter.style.display = "none"
  2514. 		End If
  2515. 		If Not CheckboxPorts.Checked Then
  2516. 			PortsHeader.style.display = "none"
  2517. 			PortsRow.style.display    = "none"
  2518. 			PortsFooter.style.display = "none"
  2519. 		End If
  2520. 		If Not CheckboxSound.Checked Then
  2521. 			SoundHeader.style.display = "none"
  2522. 			SoundRow.style.display    = "none"
  2523. 			SoundFooter.style.display = "none"
  2524. 		End If
  2525. 		If Not CheckboxVideo.Checked Then
  2526. 			VideoHeader.style.display = "none"
  2527. 			Video0.style.display      = "none"
  2528. 			VideoFooter.style.display = "none"
  2529. 		End If
  2530.  
  2531. 		DebugMessage "", "Starting inventory"
  2532.  
  2533. 		On Error Resume Next ' REQUIRED
  2534.  
  2535. 		If gvbWinPE Then
  2536. 			gvsComputer        = UCase( InputBox( "Please enter the computer name", "Computer Name", gvsComputer ) )
  2537. 			ComputerName.value = gvsComputer
  2538. 			Set gvoWMIrootCimv2         = GetObject( "winmgmts://./root/CIMV2" )
  2539. 			Set gvoWMIrootMSWinStorage  = GetObject( "winmgmts://./root/Microsoft/Windows/Storage" )
  2540. 			Set gvoWMIrootStandardCimv2 = GetObject( "winmgmts://./root/StandardCimv2" )
  2541. 			Set gvoWMIrootWMI           = GetObject( "winmgmts://./root/WMI" )
  2542. 		Else
  2543. 			gvsComputer = ComputerName.value
  2544. 			If gvsComputer = "" Or gvsComputer = "." Then
  2545. 				gvsComputer        = GetLocalComputerName( )
  2546. 				ComputerName.value = gvsComputer
  2547. 			End If
  2548. 			Sleep 1
  2549. 			Set colItems = gvoWMIlocalCimv2.ExecQuery( "SELECT StatusCode FROM Win32_PingStatus WHERE Address='" & gvsComputer & "'" )
  2550. 			For Each objItem In colItems
  2551. 				If IsNull( objItem.StatusCode ) Or objItem.StatusCode <> 0 Then
  2552. 					On Error GoTo 0
  2553. 					MsgBox "Error while trying to ping computer " & gvsComputer, vbOKOnly, "Connection Error"
  2554. 					Reset
  2555. 					Exit Sub
  2556. 				End If
  2557. 			Next
  2558. 			Set gvoWMIrootCimv2 = GetObject( "winmgmts://" & gvsComputer & "/root/CIMV2" )
  2559. 			If Err Then
  2560. 				MsgBox "Error " & Err.Number & " while trying to get access to " & gvsComputer & ": " & Err.Description, vbOKOnly, "Remote WMI Error"
  2561. 				On Error GoTo 0
  2562. 				Reset
  2563. 				Exit Sub
  2564. 			End If
  2565. 			Set gvoWMIrootMSWinStorage  = GetObject( "winmgmts://" & gvsComputer & "/root/Microsoft/Windows/Storage" )
  2566. 			Set gvoWMIrootStandardCimv2 = GetObject( "winmgmts://" & gvsComputer & "/root/StandardCimv2" )
  2567. 			Set gvoWMIrootWMI           = GetObject( "winmgmts://" & gvsComputer & "/root/WMI" )
  2568. 		End If
  2569.  
  2570. 		' Diable WinSAT for Windows XP and older
  2571. 		If CInt( Left( CStr( gviNumOS ), 1 ) ) < 6 Then gvaDefaultsBool.Item( "NOSCORES"  ) = True
  2572. 		EnableWinSATScores
  2573.  
  2574. 		On Error Goto 0
  2575.  
  2576. 		gvsHeader = "Computer:" & vbTab & "WinPE"
  2577. 		gvsCSVTxt = gvsComputer & vbTab & CStr( gvbWinPE )
  2578.  
  2579.  
  2580. 		InventoryWinSATScores
  2581. 		InventoryCPU
  2582. 		InventoryMemory
  2583. 		InventoryFDD
  2584. 		InventoryHDD
  2585. 		InventoryCDROM
  2586. 		InventoryVideo
  2587. 		InventoryMonitor
  2588. 		InventorySound
  2589. 		InventoryNIC
  2590. 		InventoryMainBoard
  2591. 		InventoryKeyboard
  2592. 		InventoryMouse
  2593. 		InventoryPorts
  2594. 		InventoryBIOS
  2595.  
  2596. 		If CheckboxVideo.Checked Then
  2597. 			If gvaSettingsBool.Item( "DXDIAG" ) Then
  2598. 				blnSuccess = InventoryDirectX( )
  2599. 				If Not blnSuccess Then MsgBox "There was an error reading the DirectX data:" & vbCrLf & "Unable to load """ & gvaSettingsStr.Item( "XML" ) & """", vbOKOnly, "XML error"
  2600. 			End If
  2601. 			Add2CsvVideo
  2602. 		End If
  2603.  
  2604. 		If gvaSettingsBool.Item( "DEVTEST" ) Then
  2605. 			ComputerName.value = "MYPC"
  2606. 			InputDxDiag.value  = "C:\Scripts\Hardware.xml"
  2607. 		Else
  2608. 			ComputerName.value = gvsComputer
  2609. 		End If
  2610.  
  2611. 		' Write the inventory data to the hidden area named "PrintScreen".
  2612. 		' This allows printing with Ctrl+P instead of the Print button.
  2613. 		PrintScreen.innerHTML = PrintTable( )
  2614.  
  2615. 		Set colItems = document.getElementsByTagName( "input" )
  2616. 		For Each objItem In colItems
  2617. 			If objItem.type = "text" Then
  2618. 				objItem.title = objItem.value
  2619. 			End If
  2620. 		Next
  2621. 		Set colItems = Nothing
  2622.  
  2623. 		ButtonCopy.disabled  = False
  2624. 		ButtonPrint.disabled = False
  2625. 		ButtonSave.disabled  = False
  2626. 		ButtonRun.disabled   = False
  2627. 		ButtonSave.Focus( )
  2628. 	End If
  2629.  
  2630. 	DebugMessage "", "End of inventory"
  2631. End Sub
  2632.  
  2633.  
  2634. Sub InventoryBIOS( )
  2635. 	Dim colItems, objItem, objMatches, objRE
  2636. 	Dim strBIOSDate, strBIOSVersion
  2637.  
  2638. 	On Error Resume Next ' REQUIRED
  2639.  
  2640. 	If CheckBoxBIOS.Checked Then
  2641. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_BIOS WHERE PrimaryBIOS = True" )
  2642. 		If Not Err Then
  2643. 			For Each objItem In colItems
  2644. 				strBIOSVersion = objItem.SMBIOSBIOSVersion
  2645. 				strBIOSDate    = Mid( objItem.ReleaseDate, 5, 2 ) & "/" & Mid( objItem.ReleaseDate, 7, 2 ) & "/" & Left( objItem.ReleaseDate, 4 )
  2646. 				gvsBIOSSerial  = objItem.SerialNumber
  2647. 				If InStr( strBIOSVersion, ":" ) Then ' Convert 01:23:00 to 1.23.00
  2648. 					Set objRE = New RegExp
  2649. 					objRE.Pattern = "^\d+(:\d+)+$"
  2650. 					If objRE.Test( strBIOSVersion ) Then
  2651. 						strBIOSVersion = Replace( strBIOSVersion, ":", "." )
  2652. 						If Len( strBIOSVersion ) > 3 Then
  2653. 							If Left( strBIOSVersion, 1 ) = "0" And Not Left( strBIOSVersion, 2 ) = "0." Then
  2654. 								strBIOSVersion = Mid( strBIOSVersion, 2 )
  2655. 							End If
  2656. 						End If
  2657. 					End If
  2658. 				End If
  2659. 				If gvaSettingsBool.Item( "DEVTEST" ) Then strBIOSVersion = gvoRandom.Next_2( 1, 9 ) & "." & gvoRandom.Next_2( 0, 9 ) & gvoRandom.Next_2( 0, 9 )
  2660. 				BIOSManufacturer.value = objItem.Manufacturer
  2661. 				BIOSModel.value        = objItem.Name
  2662. 				BIOSVersion.value      = strBIOSVersion
  2663. 				BIOSDate.value         = strBIOSDate
  2664.  
  2665. 				ButtonDetailsBIOS.disabled = False
  2666. 			Next
  2667. 		End If
  2668.  
  2669. 		DebugMessage "", "BIOS inventory succeeded: " & CStr( Not ButtonDetailsBIOS.disabled )
  2670.  
  2671. 		Add2CsvBIOS
  2672. 	End If
  2673.  
  2674. 	On Error Goto 0
  2675. End Sub
  2676.  
  2677.  
  2678. Sub InventoryCDROM( )
  2679. 	Dim arrDeviceID, arrHardwareID, arrFirmware
  2680. 	Dim i, intIndex, intRow
  2681. 	Dim colItems, objCDROMFirmwares, objCDROMInterfaces, objCDROMModels, objCell, objItem, objTable, objTableRow
  2682. 	Dim strDeviceID, strDriveLetter, strElement, strFirmware, strInterface
  2683.  
  2684. 	If CheckboxCDROM.Checked Then
  2685. 		On Error Resume Next ' REQUIRED
  2686. 		' Find all CDROM drives without the word "virtual" in their name
  2687. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_CDROMDrive WHERE NOT Name LIKE '%Virtual%'" )
  2688. 		If Err Or IsNull( colItems ) Or colItems.Count = 0 Then
  2689. 			On Error Goto 0
  2690. 			If gvbWinPE And gvsWinDrive <> "" Then InventoryCDROMWinPE
  2691. 		Else
  2692. 			Set objCDROMFirmwares  = CreateObject( "System.Collections.Sortedlist" )
  2693. 			Set objCDROMInterfaces = CreateObject( "System.Collections.Sortedlist" )
  2694. 			Set objCDROMModels     = CreateObject( "System.Collections.Sortedlist" )
  2695. 			For Each objItem In colItems
  2696. 				' Use drive letter without colon as key for CDROM SortedLists
  2697. 				strDriveLetter = Left( objItem.Drive, 1 )
  2698. 				' Parse the PNP Device ID string to get the interface and firmware revision
  2699. 				' Example:
  2700. 				' IDE\CDROM_NEC_DVD_RW_ND-3520AW___________________3.05____\5&2E27B08F&0&0.0.0
  2701. 				' ===  <-  interface                               ====  <-  firmware revision
  2702. 				' The array arrDeviceID will contain 3 elements: "IDE",
  2703. 				' "CDROM_NEC_DVD_RW_ND-3520AW___________________3.05____" and "5&2E27B08F&0&0.0.0"
  2704. 				If InStr( objItem.DeviceID, "\" ) Then
  2705. 					arrDeviceID  = Split( Replace( objItem.DeviceID, "&amp;", "&" ), "\", 3, vbTextCompare )
  2706. 					strInterface = arrDeviceID(0)
  2707. 					strDeviceID  = arrDeviceID(1)
  2708. 					' In our example, strDeviceID will contain "CDROM_NEC_DVD_RW_ND-3520AW___________________3.05____"
  2709. 					' The array arrFirmware will contain the elements "CDROM", "NEC", "DVD", "RW", "ND-3520AW", "3.05" and ""
  2710. 					' strFirmware is assigned the value of the last non-empty element in the array
  2711. 					If InStr( strDeviceID, "_" ) Then
  2712. 						arrFirmware  = Split( strDeviceID, "_", -1, vbTextCompare )
  2713. 						If Left( strInterface, 3 ) = "USB" Then strInterface = "USB"
  2714. 						For Each strElement In arrFirmware
  2715. 							If CStr( strElement ) <> "" Then strFirmware = strElement
  2716. 						Next
  2717. 					End If
  2718. 					If gvaSettingsBool.Item( "DEVTEST" ) Then strFirmware = gvoRandom.Next_2( 1, 9 ) & "." & gvoRandom.Next_2( 0, 9 ) & gvoRandom.Next_2( 0, 9 )
  2719. 					objCDROMModels.Item( strDriveLetter )     = objItem.Name
  2720. 					objCDROMInterfaces.Item( strDriveLetter ) = strInterface
  2721. 					objCDROMFirmwares.Item( strDriveLetter )  = strFirmware
  2722. 				End If
  2723. 			Next
  2724.  
  2725.  
  2726. 			Set objTable = document.getElementById( "Results" )
  2727. 			intRow = document.getElementById( "CDROM0" ).rowIndex
  2728. 			CDROM0Index.value     = objCDROMModels.GetKey( 0 ) & ":"
  2729. 			CDROM0Model.value     = objCDROMModels.GetByIndex( 0 )
  2730. 			CDROM0Firmware.value  = objCDROMFirmwares.GetByIndex( 0 )
  2731. 			CDROM0Interface.value = objCDROMInterfaces.GetByIndex( 0 )
  2732.  
  2733. 			If objCDROMModels.Count > 1 Then
  2734. 				document.getElementById( "MultipleCDROMs" ).style.display = "inline"
  2735. 				For i = 1 To objCDROMModels.Count - 1
  2736. 					Set objTableRow   = objTable.insertRow( intRow + i )
  2737. 					objTableRow.id    = "CDROM" & i
  2738.  
  2739. 					Set objCell       = objTableRow.insertCell( 0 )
  2740. 					objCell.innerHTML = "&nbsp;"
  2741.  
  2742. 					Set objCell       = objTableRow.insertCell( 1 )
  2743. 					objCell.innerHTML = "&nbsp;"
  2744.  
  2745. 					Set objCell       = objTableRow.insertCell( 2 )
  2746. 					objCell.innerHTML = "&nbsp;"
  2747.  
  2748. 					Set objCell       = objTableRow.insertCell( 3 )
  2749. 					objCell.innerHTML = "&nbsp;"
  2750.  
  2751. 					Set objCell       = objTableRow.insertCell( 4 )
  2752. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Index"" size=""12"" value=""" & objCDROMModels.GetKey( i ) & ":"" readonly />"
  2753.  
  2754. 					Set objCell       = objTableRow.insertCell( 5 )
  2755. 					objCell.innerHTML = "&nbsp;"
  2756.  
  2757. 					Set objCell       = objTableRow.insertCell( 6 )
  2758. 					objCell.setAttribute "colSpan", 3
  2759. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Model"" size=""40"" value=""" & objCDROMModels.GetByIndex( i ) & """ readonly />"
  2760.  
  2761. 					Set objCell       = objTableRow.insertCell( 7 )
  2762. 					objCell.innerHTML = "&nbsp;"
  2763.  
  2764. 					Set objCell       = objTableRow.insertCell( 8 )
  2765. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Firmware"" size=""16"" value=""" & objCDROMFirmwares.GetByIndex( i ) & """ readonly />"
  2766.  
  2767. 					Set objCell       = objTableRow.insertCell( 9 )
  2768. 					objCell.innerHTML = "&nbsp;"
  2769.  
  2770. 					Set objCell       = objTableRow.insertCell( 10 )
  2771. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Interface"" size=""16"" value=""" & objCDROMInterfaces.GetByIndex( i ) & """ readonly />"
  2772.  
  2773. 					Set objCell      = Nothing
  2774. 					Set objTableRow  = Nothing
  2775. 				Next
  2776. 			End If
  2777.  
  2778. 			ButtonDetailsCDROM.disabled = ( objCDROMModels.Count = 0 )
  2779.  
  2780. 			DebugMessage "", "CDROM inventory succeeded: " & CStr( Not ButtonDetailsCDROM.disabled )
  2781.  
  2782. 			Set objTable           = Nothing
  2783. 			Set objCDROMModels     = Nothing
  2784. 			Set objCDROMFirmwares  = Nothing
  2785. 			Set objCDROMInterfaces = Nothing
  2786.  
  2787. 			On Error Goto 0
  2788.  
  2789. 			Add2CsvCDROM
  2790. 		End If
  2791. 	End If
  2792. End Sub
  2793.  
  2794.  
  2795. Sub InventoryCDROMWinPE( )
  2796. 	Dim arrHardwareID, arrRegKeys, arrSubKeys, arrTest
  2797. 	Dim dicDescriptions, dicFirmware, dicHardwareIDs, dicInterfaces
  2798. 	Dim colItems, objItem, objRE, objReg
  2799. 	Dim i, intIndex, j
  2800. 	Dim strDescription, strDictKey, strRegKey, strRegSubKey, strWMIQuery
  2801.  
  2802. 	Set dicDescriptions = CreateObject( "Scripting.Dictionary" )
  2803. 	Set dicFirmware     = CreateObject( "Scripting.Dictionary" )
  2804. 	Set dicHardwareIDs  = CreateObject( "Scripting.Dictionary" )
  2805. 	Set dicInterfaces   = CreateObject( "Scripting.Dictionary" )
  2806. 	Set objRE           = New RegExp
  2807.  
  2808. 	' Mount registry hive from Windows Drive
  2809. 	gvoWSHShell.Run "CMD.EXE /C REG.EXE Load HKLM\TempHive " & gvsWinDrive & "\windows\system32\config\system", 0, True
  2810.  
  2811. 	' Scan the temporary registry hive for IDE CDROM devices
  2812. 	strWMIQuery = "winmgmts:{impersonationLevel=impersonate}!//./root/default:StdRegProv"
  2813. 	Set objReg = GetObject( strWMIQuery )
  2814. 	objReg.EnumKey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\IDE", arrRegKeys
  2815. 	If Not IsNull( arrRegKeys ) Then
  2816. 		For i = 0 To UBound( arrRegKeys )
  2817. 			strRegKey = arrRegKeys(i)
  2818. 			If Left( UCase( strRegKey ), 5 ) = "CDROM" Then
  2819. 				objReg.EnumKey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\IDE\" & strRegKey, arrSubKeys
  2820. 				For Each strRegSubKey In arrSubKeys
  2821. 					objReg.GetMultiStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\IDE\" & strRegKey & "\" & strRegSubKey, "HardwareID", arrHardwareID
  2822. 					If Not IsNull( arrHardwareID ) Then
  2823. 						If InStr( UCase( arrHardwareID(0) ), "VIRTUAL" ) = 0 Then
  2824. 							If Left( UCase( arrHardwareID(0) ), 4 ) = "IDE\"  Then arrHardwareID(0) = Mid( arrHardwareID(0), 5 )
  2825. 							If Left( UCase( arrHardwareID(0) ), 5 ) = "CDROM" Then arrHardwareID(0) = Mid( arrHardwareID(0), 6 )
  2826. 							objReg.GetStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\IDE\" & strRegKey & "\" & strRegSubKey, "FriendlyName", strDescription
  2827. 							strDictKey = objRE.Replace( arrHardwareID(0), "" )
  2828. 							dicHardwareIDs.Item( strDictKey )  = arrHardwareID(0)
  2829. 							dicDescriptions.Item( strDictKey ) = strDescription
  2830. 							dicInterfaces.Item( strDictKey )   = "IDE"
  2831. 							arrTest = Split( arrHardwareID(0), "_" )
  2832. 							For j = 0 To UBound( arrTest )
  2833. 								If Not arrTest(i) = "" Then
  2834. 									dicFirmware.Item( strDictKey ) = arrTest(j)
  2835. 								End If
  2836. 							Next
  2837. 						End If
  2838. 						arrHardwareID = Null
  2839. 					End If
  2840. 				Next
  2841. 				arrSubKeys = Null
  2842. 			End If
  2843. 		Next
  2844. 		arrRegKeys = Null
  2845. 	End If
  2846.  
  2847. 	' Scan the temporary registry hive for SCSI CDROM devices
  2848. 	objReg.EnumKey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\SCSI", arrRegKeys
  2849. 	If Not IsNull( arrRegKeys ) Then
  2850. 		For Each strRegKey In arrRegKeys
  2851. 			If Left( UCase( strRegKey ), 5 ) = "CDROM" Then
  2852. 				objReg.EnumKey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\SCSI\" & strRegKey, arrSubKeys
  2853. 				For Each strRegSubKey In arrSubKeys
  2854. 					objReg.GetMultiStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\SCSI\" & strRegKey & "\" & strRegSubKey, "HardwareID", arrHardwareID
  2855. 					If Not IsNull( arrHardwareID ) Then
  2856. 						If InStr( UCase( arrHardwareID(0) ), "VIRTUAL" ) = 0 Then
  2857. 							If Left( UCase( arrHardwareID(0) ), 5 ) = "SCSI\" Then arrHardwareID(0) = Mid( arrHardwareID(0), 6 )
  2858. 							If Left( UCase( arrHardwareID(0) ), 5 ) = "CDROM" Then arrHardwareID(0) = Mid( arrHardwareID(0), 6 )
  2859. 							objReg.GetStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\SCSI\" & strRegKey & "\" & strRegSubKey, "FriendlyName", strDescription
  2860. 							strDictKey = objRE.Replace( arrHardwareID(0), "" )
  2861. 							dicHardwareIDs.Item( strDictKey )  = arrHardwareID(0)
  2862. 							dicDescriptions.Item( strDictKey ) = strDescription
  2863. 							dicInterfaces.Item( strDictKey )   = "SCSI"
  2864. 							arrTest = Split( arrHardwareID(0), "_" )
  2865. 							For i = 0 To UBound( arrTest )
  2866. 								If Not arrTest(i) = "" Then
  2867. 									dicFirmware.Item( strDictKey ) = arrTest(i)
  2868. 								End If
  2869. 							Next
  2870. 						End If
  2871. 						arrHardwareID = Null
  2872. 					End If
  2873. 				Next
  2874. 				arrSubKeys = Null
  2875. 			End If
  2876. 		Next
  2877. 		arrRegKeys = Null
  2878. 	End If
  2879.  
  2880. 	' Show the results
  2881. 	If dicHardwareIDs.Count > 0 Then
  2882. 		CDROM0Index.value     = dicDescriptions.Keys(0)
  2883. 		CDROM0Model.value     = dicDescriptions(0)
  2884. 		CDROM0Firmware.value  = dicFirmware(0)
  2885. 		CDROM0Interface.value = dicInterfaces(0)
  2886.  
  2887. 		If objCDROMModels.Count > 1 Then
  2888. 			MultipleCDROMs.style.display = "inline"
  2889. 			Set objTable = document.getElementById( "Results" )
  2890. 			intRow = document.getElementById( "CDROM0" ).rowIndex
  2891. 			For i = 1 To objCDROMModels.Count - 1
  2892. 				Set objTableRow   = objTable.insertRow( intRow + i )
  2893. 				objTableRow.id    = "CDROM" & i
  2894. 				Set objCell       = objTableRow.insertCell( 0 )
  2895. 				objCell.innerHTML = "&nbsp;"
  2896. 				Set objCell       = objTableRow.insertCell( 1 )
  2897. 				objCell.innerHTML = "&nbsp;"
  2898. 				Set objCell       = objTableRow.insertCell( 2 )
  2899. 				objCell.innerHTML = "&nbsp;"
  2900. 				Set objCell       = objTableRow.insertCell( 3 )
  2901. 				objCell.innerHTML = "&nbsp;"
  2902. 				Set objCell       = objTableRow.insertCell( 4 )
  2903. 				objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Index"" size=""12"" value=""" & dicDescriptions.Keys(i) & ":"" readonly />"
  2904. 				Set objCell       = objTableRow.insertCell( 5 )
  2905. 				objCell.innerHTML = "&nbsp;"
  2906. 				Set objCell       = objTableRow.insertCell( 6 )
  2907. 				objcell.setAttribute "colSpan", 3
  2908. 				objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Model"" size=""40"" value=""" & dicDescriptions(i) & """ readonly />"
  2909. 				Set objCell       = objTableRow.insertCell( 7 )
  2910. 				objCell.innerHTML = "&nbsp;"
  2911. 				Set objCell       = objTableRow.insertCell( 8 )
  2912. 				objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Firmware"" size=""16"" value=""" & dicFirmware(i) & """ readonly />"
  2913. 				Set objCell       = objTableRow.insertCell( 9 )
  2914. 				objCell.innerHTML = "&nbsp;"
  2915. 				Set objCell       = objTableRow.insertCell( 10 )
  2916. 				objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""CDROM" & i & "Interface"" size=""16"" value=""" & dicInterfaces(i) & """ readonly />"
  2917. 				Set objCell      = Nothing
  2918. 				Set objTableRow  = Nothing
  2919. 			Next
  2920. 			Set objTable = Nothing
  2921. 		End If
  2922. 	End If
  2923.  
  2924. 	DebugMessage "", "CDROM inventory succeeded: " & CStr( Not ButtonDetailsCDROM.disabled )
  2925.  
  2926. 	' Unmount temporary registry hive
  2927. 	gvoWSHShell.Run "CMD.EXE /C REG.EXE Unload HKLM\TempHive", 0, True
  2928. 	Set dicDescriptions = Nothing
  2929. 	Set dicFirmware     = Nothing
  2930. 	Set dicHardwareIDs  = Nothing
  2931. 	Set dicInterfaces   = Nothing
  2932. 	Set objRE           = Nothing
  2933.  
  2934. 	Add2CsvCDROM
  2935. End Sub
  2936.  
  2937.  
  2938. Sub InventoryCPU( )
  2939. 	Dim colItems, objItem
  2940.  
  2941. 	If CheckBoxCPU.Checked Then
  2942. 		On Error Resume Next ' REQUIRED
  2943.  
  2944. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_Processor" )
  2945. 		If Not Err Then
  2946. 			gvcCPU = colItems.Count
  2947. 			CPUNumber.value = gvcCPU
  2948. 			If gvcCPU > 1 Then MultipleCPU.InnerHTML  = "s"
  2949. 			For Each objItem In colItems
  2950. 				CPUModel.value  = Trim( objItem.Name )
  2951. 				CPUSpeed.value  = objItem.CurrentClockSpeed
  2952. 				CPUSocket.value = objItem.SocketDesignation
  2953. 			Next
  2954. 			ButtonDetailsCPU.disabled = False
  2955. 		End If
  2956.  
  2957. 		On Error Goto 0
  2958.  
  2959. 		DebugMessage "", "CPU inventory succeeded: " & CStr( Not ButtonDetailsCPU.disabled )
  2960.  
  2961. 		Add2CsvCPU
  2962. 	End If
  2963. End Sub
  2964.  
  2965.  
  2966. Function InventoryDirectX( )
  2967. 	Dim blnLoaded, i
  2968. 	Dim colItems, colNodes, objItem, objNode, xmlDoc
  2969. 	Dim strDxDiag, strQuery, strSysDir
  2970.  
  2971. 	strSysDir = gvoWSHShell.ExpandEnvironmentStrings( "%Windir%\System32" )
  2972. 	strDxDiag = gvoFSO.BuildPath( strSysDir, "DxDiag.exe" )
  2973.  
  2974. 	' Delete old XML file if it exists, unless specified otherwise
  2975. 	If Not gvaSettingsBool.Item( "KEEPXML" ) Then
  2976. 		If gvoFSO.FileExists( gvaSettingsStr.Item( "XML" ) ) Then gvoFSO.DeleteFile gvaSettingsStr.Item( "XML" ), True
  2977. 	End If
  2978.  
  2979. 	' Run DXDIAG.EXE, if required, and save results in XML file
  2980. 	If gvoFSO.FileExists( gvaSettingsStr.Item( "XML" ) ) Then
  2981. 		If Not gvaSettingsBool.Item( "KEEPXML" ) Then
  2982. 			gvoFSO.DeleteFile gvaSettingsStr.Item( "XML" ), True
  2983. 			Sleep 2
  2984. 			gvoWSHShell.Run strDxDiag & " /whql:off /x " & gvaSettingsStr.Item( "XML" ), 7, False
  2985. 		End If
  2986. 	Else
  2987. 		gvoWSHShell.Run strDxDiag & " /whql:off /x " & gvaSettingsStr.Item( "XML" ), 7, False
  2988. 	End If
  2989.  
  2990. 	' Wait until XML file is created, 5 minutes maximum
  2991. 	For i = 1 To 150
  2992. 		Sleep 1
  2993. 		If gvoFSO.FileExists( gvaSettingsStr.Item( "XML" ) ) Then Exit For
  2994. 		Sleep 1
  2995. 	Next
  2996.  
  2997. 	' Wait for DXDIAG to close, 30 seconds maximum
  2998. 	Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_Process WHERE Caption='DxDiag.exe'" )
  2999. 	For i = 1 To 5
  3000. 		If colItems.count = 0 Then Exit For
  3001. 		Sleep 6
  3002. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_Process WHERE Caption='DxDiag.exe'" )
  3003. 	Next
  3004.  
  3005. 	' Open the XML file created by DXDIAG
  3006. 	Set xmlDoc = CreateObject( "Microsoft.XMLDOM" )
  3007. 	xmlDoc.Async = "False"
  3008. 	blnLoaded = xmlDoc.Load( gvaSettingsStr.Item( "XML" ) )
  3009. 	If Not blnLoaded Then
  3010. 		' Retry 5 times maximum, with 6 seconds interval
  3011. 		For i = 1 To 15
  3012. 			Sleep 2
  3013. 			blnLoaded = xmlDoc.Load( gvaSettingsStr.Item( "XML" ) )
  3014. 			If blnLoaded Then Exit For
  3015. 		Next
  3016. 		Sleep 2
  3017. 		MsgBox "Process DxDiag.exe still running", vbOKOnly, "DxDiag error"
  3018. 	End If
  3019.  
  3020. 	If blnLoaded Then
  3021. 		ReDim gvaVideo( 4, 0 )
  3022.  
  3023. 		strQuery = "/DxDiag/DisplayDevices/DisplayDevice/DisplayMemory"
  3024. 		Set colNodes = xmlDoc.selectNodes( strQuery )
  3025. 		i = 0
  3026. 		For Each objNode in colNodes
  3027. 			ReDim Preserve gvaVideo( 4, i )
  3028. 			gvaVideo( 0, i ) = Trim( Replace( objNode.text, "MB", "" ) )
  3029. 			i = i + 1
  3030. 		Next
  3031.  
  3032. 		strQuery = "/DxDiag/DisplayDevices/DisplayDevice/CurrentMode"
  3033. 		Set colNodes = xmlDoc.selectNodes( strQuery )
  3034. 		i = 0
  3035. 		For Each objNode in colNodes
  3036. 			gvaVideo( 1, i ) = Trim( objNode.text )
  3037. 			i = i + 1
  3038. 		Next
  3039.  
  3040. 		strQuery = "/DxDiag/DisplayDevices/DisplayDevice/MonitorName"
  3041. 		Set colNodes = xmlDoc.selectNodes( strQuery )
  3042. 		i = 0
  3043. 		For Each objNode in colNodes
  3044. 			gvaVideo( 2, i ) = Trim( objNode.text )
  3045. 			i = i + 1
  3046. 		Next
  3047.  
  3048. 		strQuery = "/DxDiag/DisplayDevices/DisplayDevice/MonitorModel"
  3049. 		Set colNodes = xmlDoc.selectNodes( strQuery )
  3050. 		i = 0
  3051. 		For Each objNode in colNodes
  3052. 			gvaVideo( 3, i ) = Trim( objNode.text )
  3053. 			i = i + 1
  3054. 		Next
  3055.  
  3056. 		strQuery = "/DxDiag/DisplayDevices/DisplayDevice/CardName"
  3057. 		Set colNodes = xmlDoc.selectNodes( strQuery )
  3058. 		i = 0
  3059. 		For Each objNode in colNodes
  3060. 			gvaVideo( 4, i ) = Trim( objNode.text )
  3061. 			i = i + 1
  3062. 		Next
  3063.  
  3064. 		InventoryDirectX = True
  3065. 	Else
  3066. 		InventoryDirectX = False
  3067. 	End If
  3068.  
  3069. 	' Clean up
  3070. 	Set colNodes = Nothing
  3071. 	Set xmlDoc   = Nothing
  3072.  
  3073. 	DebugMessage "", "DirectX inventory succeeded: " & CStr( InventoryDirectX )
  3074. End Function
  3075.  
  3076.  
  3077. Sub InventoryFDD( )
  3078. 	Dim cntAllFloppy, cntIntFloppy, cntUSBFloppy, i, intRow
  3079. 	Dim colItems, colItems2, objCell, objFDDCapacities, objFDDDescriptions, objFDDInterfaces, objItem, objItem2, objRE, objTable, objTableRow
  3080. 	Dim strDriveLetter, strInterface, strQuery
  3081.  
  3082. 	If CheckboxFDD.Checked Then
  3083. 		On Error Resume Next ' REQUIRED
  3084.  
  3085. 		strInterface = "Unknown"
  3086. 		cntAllFloppy = 0
  3087. 		cntIntFloppy = 0
  3088. 		cntUSBFloppy = 0
  3089.  
  3090. 		' Count total number of floppy disk drives
  3091. 		strQuery = "SELECT * FROM Win32_PnPEntity WHERE PNPClass='FloppyDisk'"
  3092. 		Set colItems = gvoWMIrootCimv2.ExecQuery( strQuery )
  3093. 		If Not Err Then cntAllFloppy = colItems.Count
  3094. 		' Count number of USB-attached floppy disk drives
  3095. 		strQuery = "SELECT * FROM Win32_PnPEntity WHERE PNPDeviceID LIKE 'USBSTOR%FLOPPY%'"
  3096. 		Set colItems = gvoWMIrootCimv2.ExecQuery( strQuery )
  3097. 		If Not Err Then cntUSBFloppy = colItems.Count
  3098. 		' Count number of internal floppy drive connectors
  3099. 		strQuery = "SELECT * FROM Win32_PortConnector"
  3100. 		Set colItems = gvoWMIrootCimv2.ExecQuery( strQuery )
  3101. 		If Not Err Then
  3102. 			For Each objItem In colItems
  3103. 				If objItem.PortType <> Null Then
  3104. 					For i = 0 To Len( objItem.PortType ) - 1
  3105. 						If objItem.PortType(i) = 89 Or objItem.PortType(i) = 91 Then
  3106. 							cntIntFloppy = cntIntFloppy + 1
  3107. 						End If
  3108. 					Next
  3109. 				End If
  3110. 			Next
  3111. 		End If
  3112. 		' 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
  3113. 		If cntAllFloppy = cntUSBFloppy Then
  3114. 			strInterface = "USB"
  3115. 		ElseIf cntUSBFloppy = 0 And cntIntFloppy >= cntAllFloppy Then
  3116. 			strInterface = "Flatcable"
  3117. 		End If
  3118. 		' Find all floppy disk drives
  3119. 		strQuery = "SELECT * FROM Win32_LogicalDisk WHERE DriveType=2 AND MediaType IS NOT NULL AND MediaType != 0 AND MediaType != 11 AND MediaType != 12" 
  3120. 		Set colItems = gvoWMIrootCimv2.ExecQuery( strQuery )
  3121. 		If colItems.Count > 0 And Not Err Then
  3122. 			Set objFDDCapacities   = CreateObject( "System.Collections.Sortedlist" )
  3123. 			Set objFDDDescriptions = CreateObject( "System.Collections.Sortedlist" )
  3124. 			Set objFDDInterfaces   = CreateObject( "System.Collections.Sortedlist" )
  3125. 			Set objRE = New RegExp
  3126. 			For Each objItem In colItems
  3127. 				If Trim( "" & objItem.DeviceId ) <> "" Then
  3128. 					strDriveLetter = Left( objItem.DeviceId, 1 )
  3129. 					'Set colItems2 = objWMIService.ExecQuery( "SELECT * FROM MSFT_Volume WHERE DriveLetter=""" & strDriveLetter & """" )
  3130. 					objRE.Pattern    = "[\d\.]+\s*[MK]B$"
  3131. 					objRE.IgnoreCase = True
  3132. 					If objRE.Test( GetMediaType( objItem.MediaType ) ) Then
  3133. 						objFDDCapacities.Item( strDriveLetter ) = objRE.Execute( GetMediaType( objItem.MediaType ) )(0)
  3134. 					Else
  3135. 						objFDDCapacities.Item( strDriveLetter ) = "Unknown"
  3136. 					End If
  3137. 					objFDDDescriptions.Item( strDriveLetter ) = objItem.Description
  3138. 					objFDDInterfaces.Item( strDriveLetter )   = strInterface
  3139. 				End If
  3140. 			Next
  3141.  
  3142. 			FDD0DeviceID.value    = objFDDDescriptions.GetKey( 0 ) & ":"
  3143. 			FDD0Description.value = objFDDDescriptions.GetByIndex( 0 )
  3144. 			FDD0Capacity.value    = objFDDCapacities.GetByIndex( 0 )
  3145. 			FDD0Interface.value   = objFDDInterfaces.GetByIndex( 0 )
  3146.  
  3147. 			If objFDDDescriptions.Count > 1 Then
  3148. 				document.getElementById( "MultipleFDDs" ).style.display = "inline"
  3149. 				Set objTable = document.getElementById( "Results" )
  3150. 				intRow = document.getElementById( "FDD0" ).rowIndex
  3151. 				For i = 1 To objFDDDescriptions.Count - 1
  3152. 					Set objTableRow   = objTable.insertRow( intRow + i )
  3153. 					objTableRow.id    = "FDD" & i
  3154. 					Set objCell       = objTableRow.insertCell( 0 )
  3155. 					objCell.innerHTML = "&nbsp;"
  3156. 					Set objCell       = objTableRow.insertCell( 1 )
  3157. 					objCell.innerHTML = "&nbsp;"
  3158. 					Set objCell       = objTableRow.insertCell( 2 )
  3159. 					objCell.innerHTML = "&nbsp;"
  3160. 					Set objCell       = objTableRow.insertCell( 3 )
  3161. 					objCell.innerHTML = "&nbsp;"
  3162. 					Set objCell       = objTableRow.insertCell( 4 )
  3163. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""FDD" & i & "DeviceID"" size=""12"" value=""" & objFDDDescriptions.GetKey( i ) & ":"" readonly />"
  3164. 					Set objCell       = objTableRow.insertCell( 5 )
  3165. 					objCell.innerHTML = "&nbsp;"
  3166. 					Set objCell       = objTableRow.insertCell( 6 )
  3167. 					objcell.setAttribute "colSpan", 3
  3168. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""FDD" & i & "Description"" size=""40"" value=""" & objFDDDescriptions.GetByIndex( i ) & """ readonly />"
  3169. 					Set objCell       = objTableRow.insertCell( 7 )
  3170. 					objCell.innerHTML = "&nbsp;"
  3171. 					Set objCell       = objTableRow.insertCell( 8 )
  3172. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""FDD" & i & "Capacity"" size=""16"" value=""" & objFDDCapacities.GetByIndex( i ) & """ readonly />"
  3173. 					Set objCell       = objTableRow.insertCell( 9 )
  3174. 					objCell.innerHTML = "&nbsp;"
  3175. 					Set objCell       = objTableRow.insertCell( 10 )
  3176. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""FDD" & i & "Interface"" size=""16"" value=""" & objFDDInterfaces.GetByIndex( i ) & """ readonly />"
  3177. 					Set objCell       = Nothing
  3178. 					Set objTableRow   = Nothing
  3179. 				Next
  3180. 				Set objTable = Nothing
  3181. 			End If
  3182.  
  3183. 			Set objFDDDescriptions = Nothing
  3184. 			Set objFDDInterfaces   = Nothing
  3185.  
  3186. 			ButtonDetailsFDD.disabled = False
  3187. 		End If
  3188.  
  3189. 		On Error GoTo 0
  3190.  
  3191. 		DebugMessage "", "FDD inventory succeeded: " & CStr( Not ButtonDetailsFDD.disabled )
  3192.  
  3193. 		Add2CsvFDD
  3194. 	End If
  3195. End Sub
  3196.  
  3197.  
  3198. Sub InventoryHDD( )
  3199. 	Dim i, intRow
  3200. 	Dim colItems, objCell, objHDDInterfaces, objHDDModels, objHDDSizes, objItem, objTable, objTableRow
  3201. 	Dim strQuery
  3202.  
  3203. 	If CheckboxHDD.Checked Then
  3204. 		On Error Resume Next ' REQUIRED
  3205.  
  3206. 		strQuery = "SELECT * FROM MSFT_PhysicalDisk"
  3207. 		Set colItems = gvoWMIrootMSWinStorage.ExecQuery( strQuery )
  3208. 		If Not Err Then
  3209. 			' Using SortedList instead of array because there may be "gaps" in the list of disk indexes
  3210. 			Set objHDDInterfaces = CreateObject( "System.Collections.Sortedlist" )
  3211. 			Set objHDDModels     = CreateObject( "System.Collections.Sortedlist" )
  3212. 			Set objHDDSizes      = CreateObject( "System.Collections.Sortedlist" )
  3213. 			For Each objItem In colItems
  3214. 				If gvaSettingsBool.Item( "USBSTOR" ) Or Not GetBusType( objItem.BusType ) = "USB" Then
  3215. 					If gvaSettingsBool.Item( "VIRTUAL" ) Or InStr( LCase( objItem.FriendlyName ), "virtual" ) = 0 Then
  3216. 						objHDDModels.Item( CInt( objItem.DeviceID ) )     = objItem.FriendlyName
  3217. 						objHDDSizes.Item( CInt( objItem.DeviceID ) )      = Round( objItem.Size / GB )
  3218. 						objHDDInterfaces.Item( CInt( objItem.DeviceID ) ) = GetBusType( objItem.BusType )
  3219. 					End If
  3220. 				End If
  3221. 			Next
  3222.  
  3223. 			HardDisk0Index.value     = objHDDModels.GetKey( 0 ) & ":"
  3224. 			HardDisk0Model.value     = objHDDModels.GetByIndex( 0 )
  3225. 			HardDisk0Size.value      = objHDDSizes.GetByIndex( 0 )
  3226. 			HardDisk0Interface.value = objHDDInterfaces.GetByIndex( 0 )
  3227. 			ButtonDetailsHDD.disabled = False
  3228.  
  3229. 			If objHDDModels.Count > 1 Then
  3230. 				document.getElementById( "MultipleHDUs" ).style.display = "inline"
  3231. 				Set objTable = document.getElementById( "Results" )
  3232. 				intRow = document.getElementById( "HardDisk0" ).rowIndex
  3233. 				For i = 1 To objHDDModels.Count - 1
  3234. 					Set objTableRow   = objTable.insertRow( intRow + i )
  3235. 					objTableRow.id    = "HardDisk" & i
  3236. 					Set objCell       = objTableRow.insertCell( 0 )
  3237. 					objCell.innerHTML = "&nbsp;"
  3238. 					Set objCell       = objTableRow.insertCell( 1 )
  3239. 					objCell.innerHTML = "&nbsp;"
  3240. 					Set objCell       = objTableRow.insertCell( 2 )
  3241. 					objCell.innerHTML = "&nbsp;"
  3242. 					Set objCell       = objTableRow.insertCell( 3 )
  3243. 					objCell.innerHTML = "&nbsp;"
  3244. 					Set objCell       = objTableRow.insertCell( 4 )
  3245. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""HardDisk" & i & "Index"" size=""12"" value=""" & objHDDModels.GetKey( i ) & """ readonly />"
  3246. 					Set objCell       = objTableRow.insertCell( 5 )
  3247. 					objCell.innerHTML = "&nbsp;"
  3248. 					Set objCell       = objTableRow.insertCell( 6 )
  3249. 					objCell.setAttribute "colSpan", 3
  3250. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""HardDisk" & i & "Model"" size=""40"" value=""" & objHDDModels.GetByIndex( i ) & """ readonly />"
  3251. 					Set objCell       = objTableRow.insertCell( 7 )
  3252. 					objCell.innerHTML = "&nbsp;"
  3253. 					Set objCell       = objTableRow.insertCell( 8 )
  3254. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""HardDisk" & i & "Size"" size=""16"" value=""" & objHDDSizes.GetByIndex( i ) & """ readonly />"
  3255. 					Set objCell       = objTableRow.insertCell( 9 )
  3256. 					objCell.innerHTML = "&nbsp;"
  3257. 					Set objCell       = objTableRow.insertCell( 10 )
  3258. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""HardDisk" & i & "Interface"" size=""16"" value=""" & objHDDInterfaces.GetByIndex( i ) & """ readonly />"
  3259. 					Set objCell       = Nothing
  3260. 					Set objTableRow   = Nothing
  3261. 				Next
  3262. 				Set objTable = Nothing
  3263. 			End If
  3264.  
  3265. 			Set objHDDInterfaces = Nothing
  3266. 			Set objHDDModels     = Nothing
  3267. 			Set objHDDSizes      = Nothing
  3268. 		End If
  3269.  
  3270. 		On Error Goto 0
  3271.  
  3272. 		DebugMessage "", "HDD inventory succeeded: " & CStr( Not ButtonDetailsHDD.disabled )
  3273.  
  3274. 		Add2CsvHDD
  3275. 	End If
  3276. End Sub
  3277.  
  3278.  
  3279. Sub InventoryKeyboard( )
  3280. 	Dim arrConnectorTypes, arrHardwareTypes
  3281. 	Dim blnHideFkeys
  3282. 	Dim intButtons, intConnectorType, intCount, intFkeys, intLEDs
  3283. 	Dim colItems, objItem
  3284. 	Dim strConnectorType, strKbdPNP, strMouseModel, strMouseType
  3285.  
  3286. 	If CheckboxKeyboard.checked Then
  3287. 		' Enumeration of connector and hardware types
  3288. 		arrConnectorTypes = Array( "I8042", "Serial", "USB" )
  3289. 		ReDim Preserve arrDeviceInterfaces( 162 )
  3290. 		arrDeviceInterfaces( 160 ) = "Bus mouse DB-9"
  3291. 		arrDeviceInterfaces( 161 ) = "Bus mouse micro-DIN"
  3292. 		arrDeviceInterfaces( 162 ) = "USB"
  3293.  
  3294. 		On Error Resume Next ' REQUIRED
  3295.  
  3296. 		blnHideFkeys = Not gvbIsElevated
  3297.  
  3298. 		' Check for keyboard details in root/WMI - this may fail on access denied errors when not running with elevated privileges
  3299. 		intCount  = 0
  3300. 		strKbdPNP = ""
  3301. 		Set colItems = gvoWMIrootWMI.ExecQuery( "SELECT * FROM MSKeyboard_PortInformation WHERE Active = True" )
  3302. 		If Not Err Then
  3303. 			intCount = colItems.Count
  3304. 			If intCount > 1 Then
  3305. 				Set colItems = gvoWMIrootWMI.ExecQuery( "SELECT * FROM MSKeyboard_PortInformation WHERE Active = True AND Instancename LIKE 'HID\\%'" )
  3306. 				intCount = colItems.Count
  3307. 				If colItems.Count = 0 Then
  3308. 					Set colItems = gvoWMIrootWMI.ExecQuery( "SELECT * FROM MSKeyboard_PortInformation WHERE Active = True AND Instancename LIKE '%&%'" )
  3309. 				End If
  3310. 			End If
  3311. 			For Each objItem In colItems
  3312. 				intFkeys  = 0
  3313. 				intLEDs   = 0
  3314. 				strKbdPNP = Split( objItem.InstanceName, "\" )(1)
  3315. 				intFkeys  = objItem.FunctionKeys
  3316. 				intLEDs   = objItem.Indicators
  3317. 				KeyboardFkLEDs.value = intFkeys & " F-keys; " & intLEDs & " LEDs"
  3318. 				intConnectorType = objItem.ConnectorType
  3319. 				If Not IsEmpty( intConnectorType ) Then
  3320. 					strConnectorType = arrConnectorTypes( intConnectorType )
  3321. 					KeyboardConnector.value = strConnectorType
  3322. 				End If
  3323. 				blnHideFkeys = ( intFkeys = 0 And intLEDs = 0 )
  3324. 			Next
  3325. 			ButtonDetailsKeyboard.disabled = False
  3326. 		End If
  3327.  
  3328. 		If strKbdPNP = "" Then
  3329. 			' Check for keyboard details in root/CIMV2 - this is less likely to fail on access denied errors
  3330. 			intCount = 0
  3331. 			Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_Keyboard" )
  3332. 			If Not Err Then
  3333. 				intCount = colItems.Count
  3334. 				If intCount > 1 Then
  3335. 					Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_Keyboard WHERE NOT PNPDeviceID LIKE 'ACPI\\%'" )
  3336. 					intCount = colItems.Count
  3337. 					If colItems.Count = 0 Then
  3338. 						Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_Keyboard" )
  3339. 					End If
  3340. 				End If
  3341. 				For Each objItem In colItems
  3342. 					If KeyboardModel.value  = "" Then KeyboardModel.value = objItem.Description
  3343. 					If KeyboardType.value   = ""  Then KeyboardType.value  = objItem.Name
  3344. 					If KeyboardFkLEDs.value = "" Then
  3345. 						intFkeys = objItem.NumberOfFunctionkeys
  3346. 						If Not IsEmpty( intFkeys ) And intFkeys > 0 Then KeyboardFkLEDs.value = intFkeys & " F-keys"
  3347. 					End If
  3348. 					KeyboardModel.value = objItem.Description
  3349. 					KeyboardType.value  = objItem.Name
  3350. 					If KeyboardConnector.value = "" Then
  3351. 						strConnectorType = Split( objItem.PNPDeviceID, "\" )(0)
  3352. 						KeyboardConnector.value = strConnectorType
  3353. 					End If
  3354. 				Next
  3355. 				ButtonDetailsKeyboard.disabled = False
  3356. 			End If
  3357. 		Else
  3358. 			Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_Keyboard WHERE PNPDeviceID LIKE '%\\" & strKbdPNP & "\\%'" )
  3359. 			If Not Err Then
  3360. 				For Each objItem In colItems
  3361. 					KeyboardModel.value = objItem.Description
  3362. 					KeyboardType.value  = objItem.Name
  3363. 				Next
  3364. 				ButtonDetailsKeyboard.disabled = False
  3365. 			End If
  3366. 		End If
  3367.  
  3368. 		If blnHideFkeys Then 
  3369. 			' If not running with elevated privileges, this field contains nonsense
  3370. 			KeyboardHeaderFkLEDs.style.visibility = "hidden"
  3371. 			KeyboardFkLEDs.style.visibility       = "hidden"
  3372. 		Else
  3373. 			KeyboardHeaderFkLEDs.style.visibility = "visible"
  3374. 			KeyboardFkLEDs.style.visibility       = "visible"
  3375. 		End if
  3376.  
  3377. 		On Error Goto 0
  3378.  
  3379. 		DebugMessage "", "Keyboard inventory succeeded: " & CStr( Not ButtonDetailsKeyboard.disabled )
  3380.  
  3381. 		Add2CsvKbd
  3382. 	End If
  3383. End Sub
  3384.  
  3385.  
  3386. Sub InventoryMainBoard( )
  3387. 	Dim colItems, objItem, strMBVersion
  3388.  
  3389. 	If CheckboxMainBoard.Checked Then
  3390. 		On Error Resume Next ' REQUIRED
  3391.  
  3392. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_BaseBoard" )
  3393. 		If Not Err Then
  3394. 			For Each objItem In colItems
  3395. 				If gvaSettingsBool.Item( "DEVTEST" ) Then
  3396. 					strMBVersion = gvoRandom.Next_2( 1, 9 ) & "." & gvoRandom.Next_2( 0, 9 ) & gvoRandom.Next_2( 0, 9 )
  3397. 				Else
  3398. 					strMBVersion = objItem.Version
  3399. 				End If
  3400. 				MBManufacturer.value = objItem.Manufacturer
  3401. 				MBModel.value        = objItem.Product
  3402. 				MBVersion.value      = strMBVersion
  3403. 			Next
  3404. 			ButtonDetailsMainBoard.disabled = False
  3405. 		End If
  3406.  
  3407. 		On Error Goto 0
  3408.  
  3409. 		ChassisType.value = GetChassis( )
  3410.  
  3411. 		Add2CsvMainBoard
  3412. 	End If
  3413.  
  3414. 	On Error GoTo 0
  3415.  
  3416. 	DebugMessage "", "Main Board inventory succeeded: " & CStr( Not ButtonDetailsMainBoard.disabled )
  3417. End Sub
  3418.  
  3419.  
  3420. Sub InventoryMemory( )
  3421. 	Dim colItems, objItem
  3422.  
  3423. 	If CheckboxMemory.Checked Then
  3424. 		On Error Resume Next ' REQUIRED
  3425.  
  3426. 		' Capacity filter intended for HP/COMPAQ EVO models
  3427. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_PhysicalMemory WHERE Capacity > 524288" )
  3428. 		If Not Err Then
  3429. 			For Each objItem in colItems
  3430. 				gvcMemory = gvcMemory + 1
  3431. 				gviMemSize = gviMemSize + objItem.Capacity
  3432. 				If gviMemSpeed = 0 Or objItem.Speed < gviMemSpeed Then gviMemSpeed = objItem.Speed
  3433. 			Next
  3434. 			MemoryModules.value = gvcMemory
  3435. 			MemorySize.value    = Round( gviMemSize / MB )
  3436.  
  3437. 			Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_PhysicalMemoryArray" )
  3438. 			For Each objItem In colItems
  3439. 				If objItem.MemoryDevices > gvcBanks Then gvcBanks = objItem.MemoryDevices
  3440. 			Next
  3441. 			ButtonDetailsMemory.disabled = False
  3442. 		End If
  3443.  
  3444. 		On Error Goto 0
  3445.  
  3446. 		MemoryBanks.value = gvcBanks
  3447.  
  3448. 		MemoryFormfactor.value = GetMemoryFormFactor( )
  3449.  
  3450. 		MemorySpeed.value = gviMemSpeed
  3451.  
  3452. 		DebugMessage "", "Memory inventory succeeded: " & CStr( Not ButtonDetailsMemory.disabled )
  3453.  
  3454. 		Add2CsvMemory
  3455. 	End If
  3456. End Sub
  3457.  
  3458.  
  3459. Sub InventoryMonitor( )
  3460. 	Dim arrMonitorDescriptions( ), arrMonitorHardwareIDs( ), arrMonitorManufacturers( ), arrMonitorSerialNumbers( )
  3461. 	Dim blnIsDesktopMonitor
  3462. 	Dim i, intHeight, intIndex, intRow, intWidth, numRatio
  3463. 	Dim colItems, colItems2, objCell, objItem, objItem2, objMatches, objRE, objTable, objTableRow, objWMIService
  3464. 	Dim strDesktopMonitorDeviceDesc, strDesktopMonitorHardwareID, strDesktopMonitorMfg, strDeviceDesc, strInstanceName
  3465. 	Dim strKey, strMfg, strQuery, strQuery2, strSerialNumberID, strSerialNumberLength, strSize
  3466.  
  3467. 	If CheckboxMonitor.Checked Then
  3468. 		On Error Resume Next ' REQUIRED
  3469.  
  3470. 		ButtonDetailsMonitor.disabled = False
  3471.  
  3472. 		' Use Win32_DesktopMonitor to get all the details for 1 monitor only
  3473. 		strQuery = "SELECT * FROM Win32_DesktopMonitor WHERE NOT Description LIKE '%Default%'"
  3474. 		Set objWMIService = GetObject( "winmgmts://" & gvscomputer & "/root/CIMV2" )
  3475. 		Set colItems      = objWMIService.ExecQuery( strQuery )
  3476. 		If Not Err Then
  3477. 			For Each objItem In colItems
  3478. 				strDesktopMonitorHardwareID = UCase( objItem.PNPDeviceID )
  3479. 				strDesktopMonitorDeviceDesc = objItem.Description
  3480. 				strDesktopMonitorMfg        = objItem.MonitorManufacturer
  3481. 			Next
  3482. 		End If
  3483. 		Set colItems      = Nothing
  3484. 		Set objWMIService = Nothing
  3485.  
  3486. 		' Use WmiMonitorID to get some details for all monitors
  3487. 		strQuery = "SELECT * FROM WmiMonitorID"
  3488. 		Set objWMIService = GetObject( "winmgmts://" & gvsComputer & "/root/WMI" )
  3489. 		Set colItems      = objWMIService.ExecQuery( strQuery )
  3490. 		If colItems.Count > 0 Then
  3491. 			ReDim arrMonitorDescriptions( colItems.Count - 1 )
  3492. 			ReDim arrMonitorHardwareIDs( colItems.Count - 1 )
  3493. 			ReDim arrMonitorManufacturers( colItems.Count - 1 )
  3494. 			ReDim arrMonitorSerialNumbers( colItems.Count - 1 )
  3495. 			arrMonitorDescriptions(0)  = strDesktopMonitorDeviceDesc
  3496. 			arrMonitorHardwareIDs(0)   = strDesktopMonitorHardwareID
  3497. 			arrMonitorManufacturers(0) = strDesktopMonitorMfg
  3498. 			intIndex = 1
  3499. 		End If
  3500. 		For Each objItem In colItems
  3501. 			strInstanceName = UCase( objItem.InstanceName )
  3502. 			'strInstanceName = Replace( UCase( Split( objItem.Path_.Path, "=" )(1) ), """", "" ) ' In case the line above doesn't work
  3503. 			blnIsDesktopMonitor = ( InStr( strInstanceName, strDesktopMonitorHardwareID ) = 1 )
  3504. 			If Not blnIsDesktopMonitor Then
  3505. 				' If this is NOT the monitor returned by Win32_DesktopMonitor then we have to query the registry for the Device Description and Manufacturer
  3506. 				' First get the DeviceID as used in the registry by removing a trailing instance index from the InstanceName (e.g. remove "_0" or "_1")
  3507. 				Set objRE = New RegExp
  3508. 				objRE.Pattern = "_\d{1,3}$"
  3509. 				If objRE.Test( strInstanceName ) Then
  3510. 					strInstanceName = objRE.Replace( strInstanceName, "" )
  3511. 				End If
  3512. 				Set objRE = Nothing
  3513. 				arrMonitorHardwareIDs( intIndex ) = strInstanceName
  3514. 				' Read the Device Description from the registry for this monitor
  3515. 				strDeviceDesc = gvoWSHShell.RegRead( "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\" & strInstanceName & "\DeviceDesc" )
  3516. 				If Not IsNull( strDeviceDesc ) Then
  3517. 					If Left( strDeviceDesc, 1 ) <> "(" And InStr( strDeviceDesc, ";" ) > 1 Then
  3518. 						strDeviceDesc = Mid( strDeviceDesc, InStr( strDeviceDesc, ";" ) + 1 )
  3519. 						arrMonitorDescriptions( intIndex ) = strDeviceDesc
  3520. 					End If
  3521. 				End If
  3522. 				' Read the Manufacturer from the registry for this monitor
  3523. 				strMfg = gvoWSHShell.RegRead( "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\" & strInstanceName & "\Mfg" )
  3524. 				If Not IsNull( strMfg ) Then
  3525. 					If Left( strMfg, 1 ) <> "(" And InStr( strMfg, ";" ) > 1 Then
  3526. 						strMfg = Mid( strMfg, InStr( strMfg, ";" ) + 1 )
  3527. 						arrMonitorManufacturers( intIndex ) = strMfg
  3528. 					End If
  3529. 				End If
  3530. 			End If
  3531. 			strSerialNumberLength = objItem.UserFriendlyNameLength
  3532. 			If gvaSettingsBool.Item( "DEVTEST" ) Then
  3533. 				strSerialNumberID = GetRandomString( strSerialNumberLength )
  3534. 			ElseIf strSerialNumberLength > 0 Then
  3535. 				strSerialNumberID = Chain( objItem.SerialNumberID )
  3536. 			Else
  3537. 				strSerialNumberID = ""
  3538. 			End If
  3539. 			If blnIsDesktopMonitor Then
  3540. 				arrMonitorSerialNumbers(0) = strSerialNumberID
  3541. 			Else
  3542. 				arrMonitorSerialNumbers( intIndex ) = strSerialNumberID
  3543. 			End If
  3544. 			' Get monitor dimensions for this monitor
  3545. 			strQuery2 = "SELECT * FROM WmiMonitorBasicDisplayParams WHERE InstanceName LIKE '" & Replace( strInstanceName, "\", "\\" ) & "%'"
  3546. 			Set colItems2 = objWMIService.ExecQuery( strQuery2 )
  3547. 			If Not Err Then
  3548. 				If colItems2.Count = 1 Then
  3549. 					For Each objItem2 in colItems2
  3550. 						intHeight   = objItem2.MaxVerticalImageSize
  3551. 						intWidth    = objitem2.MaxHorizontalImageSize
  3552. 						If intHeight * intWidth > 0 Then
  3553. 							numRatio = intWidth / intHeight
  3554. 							If gvaSettingsBool.Item( "CM" ) Then
  3555. 								strSize = " (" & intWidth  & " x " & intHeight & " cm"
  3556. 							Else
  3557. 								strSize = " (" & CInt( Sqr( ( intWidth * intWidth ) + ( intHeight * intHeight ) ) / 2.54 ) & """"
  3558. 							End If
  3559. 							If numRatio >= 1.45 Then
  3560. 								strSize = strSize & " widescreen"
  3561. 							End If
  3562. 							strSize = strSize & ")"
  3563. 							arrMonitorDescriptions( intIndex ) = arrMonitorDescriptions( intIndex ) & strSize
  3564. 						End If
  3565. 					Next
  3566. 				End If
  3567. 			End If
  3568. 		Next
  3569.  
  3570. 		If UBound( arrMonitorDescriptions ) >= 0 Then
  3571. 			document.getElementById( "MultipleMonitors" ).style.display = "inline"
  3572.  
  3573. 			MonitorIndex0.value        = 0
  3574. 			MonitorModel0.value        = arrMonitorDescriptions(0)
  3575. 			MonitorManufacturer0.value = arrMonitorManufacturers(0)
  3576. 			MonitorSerial0.value       = arrMonitorSerialNumbers(0)
  3577.  
  3578. 			If UBound( arrMonitorDescriptions ) > 0 Then
  3579. 				Set objTable = document.getElementById( "Results" )
  3580. 				intRow = document.getElementById( "Monitor0" ).rowIndex
  3581. 				For i = 1 To UBound( arrMonitorDescriptions )
  3582. 					Set objTableRow   = objTable.insertRow( intRow + i )
  3583. 					objTableRow.id    = "Monitor" & i
  3584. 					Set objCell       = objTableRow.insertCell( 0 )
  3585. 					objCell.innerHTML = "&nbsp;"
  3586. 					Set objCell       = objTableRow.insertCell( 1 )
  3587. 					objCell.innerHTML = "&nbsp;"
  3588. 					Set objCell       = objTableRow.insertCell( 2 )
  3589. 					objCell.innerHTML = "&nbsp;"
  3590. 					Set objCell       = objTableRow.insertCell( 3 )
  3591. 					objCell.innerHTML = "&nbsp;"
  3592. 					Set objCell       = objTableRow.insertCell( 4 )
  3593. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""MonitorIndex" & i & """ size=""12"" value=""" & i & """ readonly />"
  3594. 					Set objCell       = objTableRow.insertCell( 5 )
  3595. 					objCell.innerHTML = "&nbsp;"
  3596. 					Set objCell       = objTableRow.insertCell( 6 )
  3597. 					objcell.setAttribute "colSpan", 3
  3598. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""MonitorModel" & i & """ size=""40"" value=""" & arrMonitorDescriptions(i) & """ readonly />"
  3599. 					Set objCell       = objTableRow.insertCell( 7 )
  3600. 					objCell.innerHTML = "&nbsp;"
  3601. 					Set objCell       = objTableRow.insertCell( 8 )
  3602. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""MonitorManufacturer" & i & """ size=""16"" value=""" & arrMonitorManufacturers(i) & """ readonly />"
  3603. 					Set objCell       = objTableRow.insertCell( 9 )
  3604. 					objCell.innerHTML = "&nbsp;"
  3605. 					Set objCell       = objTableRow.insertCell( 10 )
  3606. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""MonitorSerial" & i & """ size=""16"" value=""" & arrMonitorSerialNumbers(i) & """ readonly />"
  3607. 					Set objCell       = Nothing
  3608. 					Set objTableRow   = Nothing
  3609. 				Next
  3610. 				Set objTable = Nothing
  3611. 			End If
  3612. 		End If
  3613.  
  3614. 		DebugMessage "", "Monitor inventory succeeded: " & CStr( Not ButtonDetailsMonitor.disabled )
  3615.  
  3616. 		On Error Goto 0
  3617. 	End If
  3618. End Sub
  3619.  
  3620.  
  3621. Sub InventoryMouse( )
  3622. 	Dim arrConnectorTypes, arrDeviceInterfaces, arrHardwareTypes, arrPointingTypes
  3623. 	Dim intButtons, intConnectorType, intCount, intMouseType
  3624. 	Dim colItems, objItem
  3625. 	Dim strConnectorType, strMouseModel, strMouseType
  3626.  
  3627. 	If CheckboxMouse.checked Then
  3628. 		' Enumeration of connector and hardware types
  3629. 		arrConnectorTypes = Array( "PS/2", "Serial","USB" )
  3630. 		arrHardwareTypes  = Array( "Standard Mouse", "Standard Pointer", "Standard Absolute Pointer", "Tablet", "Touch Screen", "Pen", "Track Ball" )
  3631. 		ReDim Preserve arrHardwareTypes( 256 )
  3632. 		arrHardwareTypes( 256 ) = "Other"
  3633. 		arrPointingTypes  = Array( "Unknown", "Other", "Unknown", "Mouse", "Trackball", "Track Point", "Glide Point", "Touch Pad", "Touch Screen", "Mouse - Optical Sensor" )
  3634. 		arrDeviceInterfaces = Array( "Unknown", "Other", "Unknown", "Serial", "PS/2", "Infrared", "HP-HIL", "Bus mouse", "ADB (Apple Desktop Bus)" )
  3635. 		ReDim Preserve arrDeviceInterfaces( 162 )
  3636. 		arrDeviceInterfaces( 160 ) = "Bus mouse DB-9"
  3637. 		arrDeviceInterfaces( 161 ) = "Bus mouse micro-DIN"
  3638. 		arrDeviceInterfaces( 162 ) = "USB"
  3639.  
  3640. 		On Error Resume Next ' REQUIRED
  3641.  
  3642. 		' Check for mouse details in root/CIMV2 - this is not likely to fail on access denied errors
  3643. 		intCount = 0
  3644. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_PointingDevice" )
  3645. 		If Not Err Then
  3646. 			intCount = colItems.Count
  3647. 			If intCount > 1 Then
  3648. 				Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_PointingDevice WHERE NOT PNPDeviceID LIKE 'ACPI\\%'" )
  3649. 				intCount = colItems.Count
  3650. 				If colItems.Count = 0 Then
  3651. 					Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_PointingDevice" )
  3652. 				End If
  3653. 			End If
  3654. 			For Each objItem In colItems
  3655. 				intButtons       = objItem.NumberOfButtons
  3656. 				intMouseType     = objItem.PointingType
  3657. 				strMouseType     = arrPointingTypes( intMouseType )
  3658. 				intConnectorType = objItem.DeviceInterface
  3659. 				strConnectorType = arrDeviceInterfaces( intConnectorType )
  3660. 				strMouseModel = objItem.Description
  3661. 				MouseButtons.value = intButtons
  3662. 				MouseType.value    = strMouseType
  3663. 				MouseModel.value   = strMouseModel
  3664. 				MouseConn.value    = strConnectorType
  3665. 			Next
  3666. 			ButtonDetailsMouse.disabled = False
  3667. 		End If
  3668.  
  3669. 		' Check for additional mouse details in root/WMI - this may fail on access denied errors when not running with elevated privileges
  3670. 		intCount = 0
  3671. 		Set colItems = gvoWMIrootWMI.ExecQuery( "SELECT * FROM MSMouse_PortInformation WHERE Active = True" )
  3672. 		If Not Err Then
  3673. 			intCount = colItems.Count
  3674. 			If intCount > 1 Then
  3675. 				Set colItems = gvoWMIrootWMI.ExecQuery( "SELECT * FROM MSMouse_PortInformation WHERE Active = True AND Instancename LIKE 'HID\\%'" )
  3676. 				intCount = colItems.Count
  3677. 				If intCount = 0 Then
  3678. 					Set colItems = gvoWMIrootWMI.ExecQuery( "SELECT * FROM MSMouse_PortInformation WHERE Active = True AND Instancename LIKE '%&%'" )
  3679. 				End If
  3680. 			End If
  3681. 			For Each objItem In colItems
  3682. 				intButtons = objItem.Buttons
  3683. 				intButtons = Max( MouseButtons.value, intButtons )
  3684. 				If Not gvbIsElevated And intButtons = 0 Then 
  3685. 					' If not running with elevated privileges, this field contains nonsense
  3686. 					MouseButtonsHeader.style.visibility = "hidden"
  3687. 					MouseButtons.style.visibility       = "hidden"
  3688. 				Else
  3689. 					MouseButtonsHeader.style.visibility = "visible"
  3690. 					MouseButtons.style.visibility       = "visible"
  3691. 					MouseButtons.value = intButtons
  3692. 				End If
  3693. 				intConnectorType = objItem.ConnectorType
  3694. 				strConnectorType = arrConnectorTypes( intConnectorType )
  3695. 				strMouseModel    = MouseModel.value
  3696. 				MouseModel.value   = strMouseModel
  3697. 				MouseConn.value    = strConnectorType
  3698. 			Next
  3699. 			ButtonDetailsMouse.disabled = False
  3700. 		End If
  3701.  
  3702. 		On Error Goto 0
  3703.  
  3704. 		DebugMessage "", "Mouse inventory succeeded: " & CStr( Not ButtonDetailsMouse.disabled )
  3705.  
  3706. 		Add2CsvMouse
  3707. 	End If
  3708. End Sub
  3709.  
  3710.  
  3711. Sub InventoryNIC( )
  3712. 	Dim arrNICPhysicalMedia(19)
  3713. 	Dim i, intIndex, intRandom, intRow
  3714. 	Dim colItems, objCell, objItem, objMACAddresses, objNICPhysMedia, objNICProductNames, objNICSpeeds, objTable, objTableRow
  3715. 	Dim strKey, strMACAddress, strQuery, strSpeed
  3716.  
  3717. 	arrNICPhysicalMedia( 0 )  = "Unspecified"
  3718. 	arrNICPhysicalMedia( 1 )  = "Wireless LAN"
  3719. 	arrNICPhysicalMedia( 2 )  = "Cable Modem"
  3720. 	arrNICPhysicalMedia( 3 )  = "Phone Line"
  3721. 	arrNICPhysicalMedia( 4 )  = "Power Line"
  3722. 	arrNICPhysicalMedia( 5 )  = "DSL"
  3723. 	arrNICPhysicalMedia( 6 )  = "FC"
  3724. 	arrNICPhysicalMedia( 7 )  = "1394"
  3725. 	arrNICPhysicalMedia( 8 )  = "Wireless WAN"
  3726. 	arrNICPhysicalMedia( 9 )  = "Native 802.11"
  3727. 	arrNICPhysicalMedia( 10 ) = "BlueTooth"
  3728. 	arrNICPhysicalMedia( 11 ) = "Infiniband"
  3729. 	arrNICPhysicalMedia( 12 ) = "WiMAX"
  3730. 	arrNICPhysicalMedia( 13 ) = "UWB"
  3731. 	arrNICPhysicalMedia( 14 ) = "802.3"
  3732. 	arrNICPhysicalMedia( 15 ) = "802.5"
  3733. 	arrNICPhysicalMedia( 16 ) = "IRDA"
  3734. 	arrNICPhysicalMedia( 17 ) = "Wired WAN"
  3735. 	arrNICPhysicalMedia( 18 ) = "Wired Connection Oriented WAN"
  3736. 	arrNICPhysicalMedia( 19 ) = "Other"
  3737.  
  3738. 	If CheckBoxNIC.Checked Then
  3739. 		On Error Resume Next ' REQUIRED
  3740. 		strQuery = "SELECT * FROM MSFT_NetAdapter"
  3741. 		Set colItems = gvoWMIrootStandardCimv2.ExecQuery( strQuery )
  3742. 		If Not Err Then
  3743. 			Set objMACAddresses    = CreateObject( "System.Collections.Sortedlist" )
  3744. 			Set objNICProductNames = CreateObject( "System.Collections.Sortedlist" )
  3745. 			Set objNICSpeeds       = CreateObject( "System.Collections.Sortedlist" )
  3746. 			Set objNICPhysMedia    = CreateObject( "System.Collections.Sortedlist" )
  3747. 			intIndex = 0
  3748. 			For Each objItem In colItems
  3749. 				If gvaSettingsBool.Item( "DEVTEST" ) Then
  3750. 					strMACAddress = ""
  3751. 					For i = 1 To 16
  3752. 						intRandom = gvoRandom.Next_2( 48, 63 )
  3753. 						If intRandom > 57 Then intRandom = intRandom + 7
  3754. 						strMACAddress = strMACAddress + Chr( intRandom )
  3755. 					Next
  3756. 					objMACAddresses.Item( intIndex ) = strMACAddress
  3757. 				Else
  3758. 					objMACAddresses.Item( intIndex ) = objItem.PermanentAddress
  3759. 				End If
  3760. 				objNICProductNames.Item( intIndex ) = objItem.DriverDescription
  3761. 				objNICSpeeds.Item( intIndex ) = objItem.Speed
  3762. 				If objNICSpeeds.Item( intIndex ) >= 1000000000 Then
  3763. 					strSpeed = " (" & ( objNICSpeeds.Item( intIndex ) / 1000000000 ) & " Gb/s)"
  3764. 				ElseIf objNICSpeeds.Item( intIndex ) >= 1000000 Then
  3765. 					strSpeed = " (" & ( objNICSpeeds.Item( intIndex ) / 1000000 ) & " Mb/s)"
  3766. 				ElseIf objNICSpeeds.Item( intIndex ) >= 1000 Then
  3767. 					strSpeed = " (" & ( objNICSpeeds.Item( intIndex ) / 1000 ) & " kb/s)"
  3768. 				Else
  3769. 					strSpeed = ""
  3770. 				End If
  3771. 				objNICSpeeds.Item( intIndex ) = objNICSpeeds.Item( intIndex ) & strSpeed
  3772. 				objNICPhysMedia.Item( intIndex ) = arrNICPhysicalMedia( objItem.NdisPhysicalMedium )
  3773. 				intIndex = intIndex + 1
  3774. 			Next
  3775.  
  3776. 			strKey            = objMACAddresses.GetKey( 0 )
  3777. 			NICIndex0.value   = strKey
  3778. 			NICModel0.value   = objNICProductNames.Item( strKey ) & " (" & objNICPhysMedia.Item( strKey ) & ")"
  3779. 			MACAddress0.value = objMACAddresses.Item( strKey )
  3780. 			NICSpeed0.value   = objNICSpeeds.Item( strKey )
  3781.  
  3782. 			If objMACAddresses.Count > 1 Then
  3783. 				MultipleNICs.style.display = "inline"
  3784. 				Set objTable = document.getElementById( "Results" )
  3785. 				intRow = document.getElementById( "NIC0" ).rowIndex
  3786. 				For i = 1 To objMACAddresses.Count - 1
  3787. 					strKey = objMACAddresses.GetKey( i )
  3788. 					Set objTableRow   = objTable.insertRow( intRow + i )
  3789. 					objTableRow.id    = "NIC" & i
  3790. 					Set objCell       = objTableRow.insertCell( 0 )
  3791. 					objCell.innerHTML = "&nbsp;"
  3792. 					Set objCell       = objTableRow.insertCell( 1 )
  3793. 					objCell.innerHTML = "&nbsp;"
  3794. 					Set objCell       = objTableRow.insertCell( 2 )
  3795. 					objCell.innerHTML = "&nbsp;"
  3796. 					Set objCell       = objTableRow.insertCell( 3 )
  3797. 					objCell.innerHTML = "&nbsp;"
  3798. 					Set objCell       = objTableRow.insertCell( 4 )
  3799. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""NICIndex" & i & """ size=""12"" value=""" & strKey & """ readonly />"
  3800. 					Set objCell       = objTableRow.insertCell( 5 )
  3801. 					objCell.innerHTML = "&nbsp;"
  3802. 					Set objCell       = objTableRow.insertCell( 6 )
  3803. 					objcell.setAttribute "colSpan", 3
  3804. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""NICModel" & i & """ size=""40"" value=""" & objNICProductNames.Item( strKey ) & " (" & objNICPhysMedia.Item( strKey ) & ")"" readonly />"
  3805. 					Set objCell       = objTableRow.insertCell( 7 )
  3806. 					objCell.innerHTML = "&nbsp;"
  3807. 					Set objCell       = objTableRow.insertCell( 8 )
  3808. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""MACAddress" & i & """ size=""16"" value=""" & objMACAddresses.Item( strKey ) & """ readonly />"
  3809. 					Set objCell       = objTableRow.insertCell( 9 )
  3810. 					objCell.innerHTML = "&nbsp;"
  3811. 					Set objCell       = objTableRow.insertCell( 10 )
  3812. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""NICSpeed" & i & """ size=""16"" value=""" & objNICSpeeds.Item( strKey ) & """ readonly />"
  3813. 					Set objCell       = Nothing
  3814. 					Set objTableRow   = Nothing
  3815. 				Next
  3816. 			End If
  3817. 			Set objtable           = Nothing
  3818. 			Set objMACAddresses    = Nothing
  3819. 			Set objNICProductNames = Nothing
  3820. 			Set objNICSpeeds       = Nothing
  3821.  
  3822. 			ButtonDetailsNIC.disabled = False
  3823. 		End If
  3824. 		On Error Goto 0
  3825.  
  3826. 		DebugMessage "", "NIC inventory succeeded: " & CStr( Not ButtonDetailsNIC.disabled )
  3827.  
  3828. 		Add2CsvNIC
  3829. 	End If
  3830. End Sub
  3831.  
  3832.  
  3833. Sub InventoryPorts( )
  3834. 	Dim cntAGP, cntFireWire, cntOther, cntParallel, cntPCI, cntPCIE, cntSerial, cntUSB, cntUSB3, colItems, objItem
  3835. 	cntAGP      = 0
  3836. 	cntFireWire = 0
  3837. 	cntOther    = 0
  3838. 	cntParallel = 0
  3839. 	cntPCI      = 0
  3840. 	cntPCIE     = 0
  3841. 	cntSerial   = 0
  3842. 	cntUSB      = 0
  3843. 	cntUSB3     = 0
  3844.  
  3845. 	If CheckBoxPorts.Checked Then
  3846. 		On Error Resume Next ' REQUIRED
  3847. 		' Check for USB controllers
  3848. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_USBController" )
  3849. 		If Not Err Then cntUSB = colItems.Count
  3850. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_USBController WHERE Name LIKE '%USB 3%'" )
  3851. 		If Not Err Then
  3852. 			cntUSB3 = colItems.Count
  3853. 			cntUSB  = cntUSB - cntUSB3
  3854. 			ButtonDetailsPorts.disabled = False
  3855. 		End If
  3856. 		If cntUSB3 > 0 Then
  3857. 			USB.value = cntUSB & " + " & cntUSB3 & " x USB3"
  3858. 		Else
  3859. 			USB.value = cntUSB
  3860. 		End If
  3861. 		' Count FireWire ports
  3862. 		Set colItems = gvoWMIrootCimv2.Execquery( "SELECT * FROM Win32_1394ControllerDevice" )
  3863. 		If Not Err Then
  3864. 			cntFireWire = colItems.Count
  3865. 			ButtonDetailsPorts.disabled = False
  3866. 		End If
  3867. 		FireWire.value = cntFireWire
  3868. 		' Count parallel ports
  3869. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_ParallelPort" )
  3870. 		If Not Err Then
  3871. 			cntParallel = colItems.Count
  3872. 			ButtonDetailsPorts.disabled = False
  3873. 		End If
  3874. 		' Count serial ports
  3875. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_SerialPort" )
  3876. 		If Not Err Then
  3877. 			cntSerial = colItems.Count
  3878. 			ButtonDetailsPorts.disabled = False
  3879. 		End If
  3880. 		If cntParallel > 0 And cntSerial > 0 Then
  3881. 			Legacy.value = cntParallel & "x Parallel, " & cntSerial & "x Serial"
  3882. 		ElseIf cntSerial > 0 Then
  3883. 			Legacy.value = cntSerial & " Serial"
  3884. 		ElseIf cntParallel > 0 Then
  3885. 			Legacy.value = cntParallel & " Parallel"
  3886. 		Else
  3887. 			Legacy.value = 0
  3888. 		End If
  3889. 		' Count system slots (PCI/AGP)
  3890. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT SlotDesignation FROM Win32_SystemSlot" )
  3891. 		If Not Err Then
  3892. 			For Each objItem In colItems
  3893. 				If Left( objItem.SlotDesignation, 3 ) = "AGP" Then cntAGP = cntAGP + 1
  3894. 				If Left( objItem.SlotDesignation, 3 ) = "PCI" Then
  3895. 					If Left( objItem.SlotDesignation, 4 ) = "PCIE" Then
  3896. 						cntPCIE = cntPCIE + 1
  3897. 					Else
  3898. 						cntPCI = cntPCI + 1
  3899. 					End If
  3900. 				End If
  3901. 				If InStr( "AGPCI", Left( objItem.SlotDesignation, 3 ) ) = 0 Then cntOther = cntOther + 1
  3902. 			Next
  3903. 			ButtonDetailsPorts.disabled = False
  3904. 		End If
  3905. 		On Error Goto 0
  3906. 		Slots.value = cntPCI & " x PCI, " & cntPCIE & " x PCIE, " & cntAGP & " x AGP"
  3907. 		gvsSlots    = cntPCI &   "xPCI "  & cntPCIE &   "xPCIE "  & cntAGP &   "xAGP"
  3908. 		If cntOther > 0 Then
  3909. 			Slots.value = Slots.value & ", " & cntOther & " x Other"
  3910. 			gvsSlots    = gvsSlots    & " "  & cntOther & "xOther"
  3911. 		End If
  3912.  
  3913. 		DebugMessage "", "Ports inventory succeeded: " & CStr( Not ButtonDetailsPorts.disabled )
  3914.  
  3915. 		Add2CsvPorts
  3916. 	End If
  3917. End Sub
  3918.  
  3919.  
  3920. Sub InventorySound( )
  3921. 	Dim arrSubKeys, arrSubSubKeys, arrSubSubSubKeys
  3922. 	Dim blnRegValFound
  3923. 	Dim i, j, k
  3924. 	Dim colItems, objItem, objReg
  3925. 	Dim strDescription, strQuery
  3926. 	If CheckBoxSound.Checked Then
  3927. 		' First search the registry for the ACTIVE sound card: it should have a key
  3928. 		' like "HKLM\SYSTEM\CurrentControlSet\Enum\HDAUDIO\FUNC_*\*\Device Parameters\"
  3929. 		' and then its name can be found at the end of the string value
  3930. 		' "HKLM\SYSTEM\CurrentControlSet\Enum\HDAUDIO\FUNC_*\*\DeviceDesc"
  3931. 		' after the last semicolon
  3932. 		blnRegValFound = True
  3933. 		Set objReg = GetObject( "winmgmts:{impersonationLevel=impersonate}!//" & gvsComputer & "/root/default:StdRegProv" )
  3934. 		blnRegValFound = blnRegValFound And objReg.EnumKey( HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Enum\HDAUDIO", arrSubKeys )
  3935. 		For i = 0 To UBound( arrSubKeys )
  3936. 			blnRegValFound = blnRegValFound And objReg.EnumKey( HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Enum\HDAUDIO\" & arrSubKeys(i), arrSubSubKeys )
  3937. 			For j = 0 To UBound( arrSubSubKeys )
  3938. 				blnRegValFound = blnRegValFound And objReg.EnumKey( HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Enum\HDAUDIO\" & arrSubKeys(i) & "\" & arrSubSubKeys(j), arrSubSubSubKeys )
  3939. 				For k = 0 To UBound( arrSubSubSubKeys )
  3940. 					If arrSubSubSubKeys(k) = "Device Parameters" Then
  3941. 						blnRegValFound = blnRegValFound And objReg.GetStringValue( HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Enum\HDAUDIO\" & arrSubKeys(i) & "\" & arrSubSubKeys(j), "DeviceDesc", strDescription )
  3942. 					End If
  3943. 				Next
  3944. 			Next
  3945. 		Next
  3946. 		strDescription = Mid( strDescription, InStrRev( strDescription, ";" ) + 1 )
  3947. 		Set objReg = Nothing
  3948.  
  3949. 		On Error Resume Next ' REQUIRED
  3950. 		strQuery = "SELECT * FROM Win32_SoundDevice"
  3951. 		' Append the name of the ACTIVE sound card, if found, to the query
  3952. 		If blnRegValFound Then strQuery = strQuery & " WHERE Name=""" & strDescription & """"
  3953. 		Set colItems = gvoWMIrootCimv2.ExecQuery( strQuery )
  3954. 		If Err Or IsNull( colItems ) Or colItems.Count = 0 Then
  3955. 			If gvbWinPE And gvsWinDrive <> "" Then InventorySoundWinPE
  3956. 		Else
  3957. 			For Each objItem In colItems
  3958. 				SoundCardManufacturer.value = objItem.Manufacturer
  3959. 				SoundCardModel.value        = objItem.ProductName
  3960. 			Next
  3961. 			ButtonDetailsSound.disabled = False
  3962. 		End If
  3963. 		On Error Goto 0
  3964.  
  3965. 		DebugMessage "", "Sound Devices inventory succeeded: " & CStr( Not ButtonDetailsSound.disabled )
  3966.  
  3967. 		Add2CsvSound
  3968. 	End If
  3969. End Sub
  3970.  
  3971.  
  3972. Sub InventorySoundWinPE( )
  3973. 	Dim arrRegKeys, arrSubKeys, arrSubSubKeys, arrTest
  3974. 	Dim blnFoundHardwareManufacturer
  3975. 	Dim i
  3976. 	Dim dicSoundCards, objReg
  3977. 	Dim strAudioDescription, strAudioManufacturer, strKey, strRegKey, strSubKey
  3978.  
  3979. 	' Mount registry hive from Windows Drive
  3980. 	gvoWSHShell.Run "CMD.EXE /C REG.EXE Load HKLM\TempHive " & gvsWinDrive & "\windows\system32\config\system", 0, True
  3981.  
  3982. 	' Scan the temporary registry hive for sound cards
  3983. 	Set dicSoundCards = CreateObject( "Scripting.Dictionary" )
  3984. 	Set objReg        = GetObject( "winmgmts:{impersonationLevel=impersonate}!//./root/default:StdRegProv" )
  3985. 	objReg.EnumKey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\HDAudio", arrRegKeys
  3986. 	If Not IsNull( arrRegKeys ) Then
  3987. 		For Each strRegKey In arrRegKeys
  3988. 			objReg.EnumKey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\HDAudio\" & strRegKey, arrSubKeys
  3989. 			If Not IsNull( arrSubKeys ) Then
  3990. 				For Each strSubKey In arrSubKeys
  3991. 					objReg.Enumkey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\HDAudio\" & strRegKey & "\" & strSubKey, arrSubSubKeys
  3992. 					If Not IsNull( arrSubSubKeys ) Then
  3993. 						strAudioDescription  = Null
  3994. 						strAudioManufacturer = Null
  3995. 						objReg.GetStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\HDAudio\" & strRegKey & "\" & strSubKey, "DeviceDesc", strAudioDescription
  3996. 						objReg.GetStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Enum\HDAudio\" & strRegKey & "\" & strSubKey, "Mfg", strAudioManufacturer
  3997. 						If Not IsNull( strAudioDescription ) And Not IsNull( strAudioManufacturer ) Then
  3998. 							If InStr( strAudioDescription, ";" ) Then
  3999. 								arrTest              = Split( strAudioDescription, ";" )
  4000. 								strAudioDescription  = arrTest( UBound( arrTest ) )
  4001. 							End If
  4002. 							If InStr( strAudioManufacturer, ";" ) Then
  4003. 								arrTest              = Split( strAudioManufacturer, ";" )
  4004. 								strAudioManufacturer = arrTest( UBound( arrTest ) )
  4005. 							End If
  4006. 							dicSoundCards.Item( Trim( strAudioManufacturer ) ) = Trim( strAudioDescription )
  4007. 						End If
  4008. 					End If
  4009. 				Next
  4010. 			End If
  4011. 		Next
  4012. 	End If
  4013. 	Set objReg = Nothing
  4014.  
  4015. 	' Unmount registry hive
  4016. 	gvoWSHShell.Run "CMD.EXE /C REG.EXE Unload HKLM\TempHive", 0, True
  4017.  
  4018. 	' Search the results, preferably for a true hardware manufacturer
  4019. 	strAudioDescription          = ""
  4020. 	strAudioManufacturer         = ""
  4021. 	blnFoundHardwareManufacturer = False
  4022. 	For Each strKey in dicSoundCards.Keys
  4023. 		If UCase( strKey ) <> "MICROSOFT" Then
  4024. 			strAudioManufacturer         = strKey
  4025. 			strAudioDescription          = dicSoundCards.Item( strKey )
  4026. 			blnFoundHardwareManufacturer = True
  4027. 		End If
  4028. 	Next
  4029. 	If Not blnFoundHardwareManufacturer Then
  4030. 		For Each strKey in dicSoundCards.Keys
  4031. 			strAudioManufacturer = strKey
  4032. 			strAudioDescription  = dicSoundCards.Item( strKey )
  4033. 		Next
  4034. 	End If
  4035. 	Set dicSoundCards = Nothing
  4036.  
  4037. 	SoundCardManufacturer.value = strAudioManufacturer
  4038. 	SoundCardModel.value        = strAudioDescription
  4039.  
  4040. 	ButtonDetailsSound.disabled = Not blnFoundHardwareManufacturer
  4041.  
  4042. 	DebugMessage "", "Sound Devices inventory succeeded: " & CStr( Not ButtonDetailsSound.disabled )
  4043. End Sub
  4044.  
  4045.  
  4046. Sub InventoryVideo( )
  4047. 	Dim arrVideoMemories( ), arrVideoModels( ), arrVideoModes( )
  4048. 	Dim i, intIndex, intRow, intVidMem
  4049. 	Dim colItems, objCell, objItem, objReg, objTable, objTableRow
  4050.  
  4051. 	If CheckboxVideo.Checked Then
  4052. 		On Error Resume Next ' REQUIRED
  4053. 		' WHERE clauses to exclude Citrix or other virtual video devices, based on input by Steve Robertson
  4054. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_VideoController WHERE AdapterRAM IS NOT NULL AND InstalledDisplayDrivers IS NOT NULL" )
  4055. 		If Err Or IsNull( colItems ) Or colItems.Count = 0 Then
  4056. 			If gvbWinPE And gvsWinDrive <> "" Then
  4057. 				On Error Goto 0
  4058. 				ButtonDetailsVideo.disabled = True
  4059. 				InventoryVideoWinPE
  4060. 			End If
  4061. 		Else
  4062. 			ReDim arrVideoMemories( colItems.Count - 1 )
  4063. 			ReDim arrVideoModels( colItems.Count - 1 )
  4064. 			ReDim arrVideoModes( colItems.Count - 1 )
  4065. 			intIndex  = 0
  4066. 			intVidMem = 0
  4067. 			For Each objItem in colItems
  4068. 				arrVideoMemories( intIndex ) = Round( objItem.AdapterRAM / MB )
  4069. 				arrVideoModels( intIndex ) = objItem.Name
  4070. 				arrVideoModes( intIndex )  = objItem.VideoModeDescription
  4071. 				' Correct video RAM if 4GB or more and for internal devices
  4072. 				intVidMem = GetVideoRAM( arrVideoModels( intIndex ) )
  4073. 				If intVidMem > 0 Then
  4074. 					arrVideoMemories( intIndex ) = intVidMem
  4075. 				End If
  4076. 				intIndex = intIndex + 1
  4077. 			Next
  4078.  
  4079. 			VideoIndex0.value  = 0
  4080. 			VideoModel0.value  = arrVideoModels(0)
  4081. 			VideoMemory0.value = arrVideoMemories(0)
  4082. 			VideoMode0.value   = arrVideoModes(0)
  4083.  
  4084. 			If UBound( arrVideoModels ) > 0 Then
  4085. 				Set objTable = document.getElementById( "Results" )
  4086. 				intRow = document.getElementById( "Video0" ).rowIndex
  4087. 				For i = 1 To UBound( arrVideoModels )
  4088. 					Set objTableRow   = objTable.insertRow( intRow + i )
  4089. 					objTableRow.id    = "Video" & i
  4090. 					Set objCell       = objTableRow.insertCell( 0 )
  4091. 					objCell.innerHTML = "&nbsp;"
  4092. 					Set objCell       = objTableRow.insertCell( 1 )
  4093. 					objCell.innerHTML = "&nbsp;"
  4094. 					Set objCell       = objTableRow.insertCell( 2 )
  4095. 					objCell.innerHTML = "&nbsp;"
  4096. 					Set objCell       = objTableRow.insertCell( 3 )
  4097. 					objCell.innerHTML = "&nbsp;"
  4098. 					Set objCell       = objTableRow.insertCell( 4 )
  4099. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoIndex" & i & """ size=""12"" value=""" & i & """ readonly />"
  4100. 					Set objCell       = objTableRow.insertCell( 5 )
  4101. 					objCell.innerHTML = "&nbsp;"
  4102. 					Set objCell       = objTableRow.insertCell( 6 )
  4103. 					objCell.setAttribute "colSpan", 3
  4104. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoModel" & i & """ size=""40"" value=""" & arrVideoModels(i) & """ readonly />"
  4105. 					Set objCell       = objTableRow.insertCell( 7 )
  4106. 					objCell.innerHTML = "&nbsp;"
  4107. 					Set objCell       = objTableRow.insertCell( 8 )
  4108. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoMemory" & i & """ size=""16"" value=""" & arrVideoMemories(i) & """ readonly />"
  4109. 					Set objCell       = objTableRow.insertCell( 9 )
  4110. 					objCell.innerHTML = "&nbsp;"
  4111. 					Set objCell       = objTableRow.insertCell( 10 )
  4112. 					objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoMode" & i & """ size=""16"" value=""" & arrVideoModes(i) & """ readonly />"
  4113. 					Set objCell       = Nothing
  4114. 					Set objTableRow   = Nothing
  4115. 				Next
  4116. 			End If
  4117. 			Set objTable = Nothing
  4118.  
  4119. 			ButtonDetailsVideo.disabled = False
  4120. 		End If
  4121.  
  4122. 		DebugMessage "", "Video inventory succeeded: " & CStr( Not ButtonDetailsVideo.disabled )
  4123.  
  4124. 		On Error Goto 0
  4125. 	End If
  4126. End Sub
  4127.  
  4128.  
  4129. Sub InventoryVideoWinPE( )
  4130. 	Dim arrRegKeys, arrSubKeys
  4131. 	Dim i, intIndex, intRow
  4132. 	Dim dicVideoCards, objCell, objReg, objtable, objTableRow
  4133. 	Dim strDictKey, strRegKey, strVideoDescription, strVideoService
  4134.  
  4135. 	' Mount registry hive from Windows Drive
  4136. 	gvoWSHShell.Run "CMD.EXE /C REG.EXE Load HKLM\TempHive " & gvsWinDrive & "\windows\system32\config\system", 0, True
  4137.  
  4138. 	' Scan the temporary registry hive for video cards
  4139. 	Set dicVideoCards = CreateObject( "Scripting.Dictionary" )
  4140. 	Set objReg        = GetObject( "winmgmts:{impersonationLevel=impersonate}!//./root/default:StdRegProv" )
  4141. 	objReg.EnumKey HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Control\Video", arrRegKeys
  4142. 	If Not IsNull( arrRegKeys ) Then
  4143. 		For Each strRegKey In arrRegKeys
  4144. 			objReg.GetStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Control\Video\" & strRegKey & "\Video", "Service", strVideoService
  4145. 			If strVideoService <> "" And UCase( strVideoService ) <> "VGA" Then ' Ignore standard VGA driver
  4146. 				objReg.GetStringValue HKEY_LOCAL_MACHINE, "TempHive\ControlSet001\Services\" & strVideoService & "\Device0", "Device Description", strVideoDescription
  4147. 				If Left( strVideoDescription, 3 ) <> "RDP" Then ' Ignore RDP video drivers
  4148. 					dicVideoCards.Item( strVideoService ) = strVideoDescription
  4149. 				End If
  4150. 			End If
  4151. 		Next
  4152. 	End If
  4153.  
  4154. 	' Unmount registry hive
  4155. 	gvoWSHShell.Run "CMD.EXE /C REG.EXE Unload HKLM\TempHive", 0, True
  4156.  
  4157. 	VideoIndex0.value  = 0
  4158. 	VideoModel0.value  = dicVideoCards.Item(0)
  4159. 	VideoMemory0.value = "?"
  4160. 	VideoMode0.value   = "?"
  4161.  
  4162. 	If dicVideoCards.Count > 1 then
  4163. 		Set objTable = document.getElementById( "Results" )
  4164. 		intRow = document.getElementById( "Video0" ).rowIndex
  4165. 		For i = 1 To dicVideoCards.Count - 1
  4166. 			strDictKey = dicVideoCards.Keys(i)
  4167. 			Set objTableRow   = objTable.insertRow( intRow + i )
  4168. 			objTableRow.id    = "Video" & i
  4169. 			Set objCell       = objTableRow.insertCell( 0 )
  4170. 			objCell.innerHTML = "&nbsp;"
  4171. 			Set objCell       = objTableRow.insertCell( 1 )
  4172. 			objCell.innerHTML = "&nbsp;"
  4173. 			Set objCell       = objTableRow.insertCell( 2 )
  4174. 			objCell.innerHTML = "&nbsp;"
  4175. 			Set objCell       = objTableRow.insertCell( 3 )
  4176. 			objCell.innerHTML = "&nbsp;"
  4177. 			Set objCell       = objTableRow.insertCell( 4 )
  4178. 			objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoIndex" & i & """ size=""12"" value=""" & i & """ readonly />"
  4179. 			Set objCell       = objTableRow.insertCell( 5 )
  4180. 			objCell.innerHTML = "&nbsp;"
  4181. 			Set objCell       = objTableRow.insertCell( 6 )
  4182. 			objcell.setAttribute "colSpan", 3
  4183. 			objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoModel" & i & """ size=""40"" value=""" & dicVideoCards.Item( strDictKey ) & """ readonly />"
  4184. 			Set objCell       = objTableRow.insertCell( 7 )
  4185. 			objCell.innerHTML = "&nbsp;"
  4186. 			Set objCell       = objTableRow.insertCell( 8 )
  4187. 			objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoMemory" & i & """ size=""16"" value=""?"" readonly />"
  4188. 			Set objCell       = objTableRow.insertCell( 9 )
  4189. 			objCell.innerHTML = "&nbsp;"
  4190. 			Set objCell       = objTableRow.insertCell( 10 )
  4191. 			objCell.innerHTML = "<input type=""text"" oncontextmenu=""this.select()"" id=""VideoMode" & i & """ size=""16"" value=""?"" readonly />"
  4192. 			Set objCell       = Nothing
  4193. 			Set objTableRow   = Nothing
  4194.  
  4195. 			ButtonDetailsVideo.disabled = True
  4196. 		Next
  4197. 	End If
  4198. 	Set objReg        = Nothing
  4199. 	Set dicVideoCards = Nothing
  4200.  
  4201. 	DebugMessage "", "Video inventory succeeded: " & CStr( Not ButtonDetailsVideo.disabled )
  4202. End Sub
  4203.  
  4204.  
  4205. Sub InventoryWinSATScores( )
  4206. 	Dim colItems, objItem
  4207. 	sngCPU    = -1
  4208. 	sngDisk   = -1
  4209. 	sngMemory = -1
  4210. 	sngTotal  = -1
  4211. 	sngVideo  = -1
  4212. 	If Not gvaSettingsBool.Item( "NOSCORES" ) And Not gvbWinPE Then
  4213. 		On Error Resume Next ' REQUIRED
  4214. 		Set colItems = gvoWMIrootCimv2.ExecQuery( "SELECT * FROM Win32_WinSAT Where TimeTaken=""MostRecentAssessment""" )
  4215. 		If Not Err Then
  4216. 			For Each objItem in colItems
  4217. 				sngCPU    = objItem.CPUScore
  4218. 				sngDisk   = objItem.DiskScore
  4219. 				sngVideo  = objItem.GraphicsScore
  4220. 				sngMemory = objItem.MemoryScore
  4221. 				sngTotal  = objItem.WinSPRLevel
  4222. 			Next
  4223. 		End If
  4224. 		If CheckboxCPU.Checked       Then CPUScore.value      = sngCPU
  4225. 		If CheckboxHDD.Checked       Then DiskScore.value     = sngDisk
  4226. 		If CheckboxMainBoard.Checked Then WinSATScore.value   = sngTotal
  4227. 		If CheckboxMemory.Checked    Then MemoryScore.value   = sngMemory
  4228. 		If CheckboxVideo.Checked     Then GraphicsScore.value = sngVideo
  4229. 		On Error Goto 0
  4230.  
  4231. 		If sngCPU < 1 Then
  4232. 			MsgBox "If WinSAT scores remain empty, run the command ""winsat.exe formal"" once in an elevated console.", vbOKOnly + vbInformation, "Enable WinSAT scores"
  4233. 		End If
  4234. 	End If
  4235.  
  4236. 	DebugMessage "", "WinSat scores inventory succeeded: " & CStr( CBool( sngCPU > -1 ) )
  4237.  
  4238. 	Set colItems = Nothing
  4239. End Sub
  4240.  
  4241.  
  4242. Function IsAdmin( showMessage )
  4243.     ' Based on code by Denis St-Pierre
  4244.     Dim intAnswer, intButtons, intPlatformHTA, intPlatformWin, intRC
  4245.     Dim colItems, objItem, objUAC
  4246.     Dim strCommandLine, strHTA, strMsg, strTitle
  4247.  
  4248.     gvbIsElevated = False
  4249.     On Error Resume Next ' REQUIRED
  4250.     gvbIsElevated = ( gvoWSHShell.Run( "CMD /C OPENFILES > NUL 2>&1", 7, True ) = 0 )
  4251.     If Err Then intRC = 1
  4252.     On Error Goto 0
  4253.  
  4254.     If ( InStr( UCase( Hardware.CommandLine ), "/NOADMIN" ) > 0 ) Or gvbWinPE Then
  4255.     	IsAdmin = True
  4256.     Else
  4257.     	IsAdmin = False
  4258. 		intPlatformHTA = CInt( Right( window.navigator.platform, 2 ) )
  4259. 	    If gvoFSO.FolderExists( gvoWSHShell.ExpandEnvironmentStrings( "%windir%\SysWOW64" ) ) Then
  4260. 			intPlatformWin = 64
  4261. 		Else
  4262. 			intPlatformWin = 32
  4263. 		End If
  4264. 	    If gvbIsElevated Then
  4265. 	    	intRC = 0
  4266. 	    	IsAdmin = True
  4267. 	    Else
  4268. 	    	intRC = 1
  4269. 			If showMessage Then
  4270. 				strTitle   = "Elevated Privileges Recommended"
  4271. 		   		intButtons = vbYesNoCancel + vbInformation + vbApplicationModal
  4272. 				strMsg     = "This HTA works best with elevated privileges." & vbCrLf _
  4273. 				           & "Without elevated privileges, the HTA won't have access to all WMI namespaces, i.e. some details will be missed." & vbCrLf & vbCrLf _
  4274. 				           & "Running this HTA as administrator is recommended." & vbCrLf & vbCrLf & vbCrLf & vbcrlf
  4275. 				If intPlatformHTA = 32 And intPlatformWin = 64 Then
  4276. 					strMsg = strMsg _
  4277. 				           & "This HTA is running in a 32-bit MSHTA process (%windir%\SysWOW64\mshta.exe) on 64-bit Windows." & vbCrLf & vbCrLf _
  4278. 				           & "Add the path to the proper (64-bit) MSHTA to this HTA's command line:" & vbCrLf & vbCrLf
  4279. 				Else
  4280. 					strMsg = strMsg _
  4281. 				           & "Note: On some 64-bit systems, you may still get this message, whether running with elevated privileges or not." & vbCrLf & vbCrLf _
  4282. 				           & "Usually this is caused by HTAs being incorrectly associated with the 32-bit MSHTA version (%windir%\SysWOW64\mshta.exe)." & vbCrLf & vbCrLf _
  4283. 				           & "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
  4284. 				End If
  4285. 				strMsg     = strMsg _
  4286. 				           & """%windir%\system32\mshta.exe"" """
  4287. 				If InStr( UCase( Hardware.CommandLine ), "/DEVTEST" ) Then
  4288. 					strMsg = strMsg & "C:\Scripts\Hardware.hta"
  4289. 				Else
  4290. 					strMsg = strMsg & Self.location.pathname
  4291. 				End if
  4292. 				strMsg     = strMsg _
  4293. 				           & """" & vbCrLf & vbCrLf & vbCrLf & vbCrLf _
  4294.  				           & "Do you want to elevate privileges now?" & vbCrLf & vbCrLf _
  4295. 				           & "Yes:"    & vbtab & "Restart the HTA with elevated privileges" & vbCrLf _
  4296. 				           & "No:"     & vbTab & "Continue without elevated privileges"     & vbCrLf _
  4297. 				           & "Cancel:" & vbTab & "Abort"
  4298. 				intAnswer  = MsgBox( strMsg, intButtons, strTitle )
  4299. 				If intAnswer = vbYes Then
  4300. 					strHTA = Self.location.pathname
  4301. 					strCommandLine = Hardware.CommandLine
  4302. 					' Strip HTA file name or path from command line
  4303. 					If InStr( strCommandLine, """" & strHTA & """" ) = 1 Then
  4304. 						strCommandLine = Mid( strCommandLine, Len( strHTA ) + 3 )
  4305. 					ElseIf InStr( strCommandLine, strHTA ) = 1 Then
  4306. 						strCommandLine = Mid( strCommandLine, Len( strHTA ) + 1 )
  4307. 					ElseIf InStr( strCommandLine, """" & gvoFSO.GetFileName( strHTA ) & """" ) = 1 Then
  4308. 						strCommandLine = Mid( strCommandLine, Len( strHTA ) + 3 )
  4309. 					ElseIf InStr( strCommandLine, gvoFSO.GetFileName( strHTA ) ) = 1 Then
  4310. 						strCommandLine = Mid( strCommandLine, Len( strHTA ) + 1 )
  4311. 					ElseIf InStr( strCommandLine, gvoFSO.GetFileName( strHTA ) ) > 0 Then
  4312. 						strCommandLine = Mid( strCommandLine, InStr( strHTA ) + Len( strHTA ) + 1 )
  4313. 						If Left( strCommandLine, 1 ) = """" Then strCommandLine = Mid( strCommandLine, 2 )
  4314. 					Else
  4315. 						' Error: do nothing, the HTA will close
  4316. 					End If
  4317. 					strCommandLine = Replace( Trim( strCommandLine ), """", """""" )
  4318. 					If InStr( UCase( strCommandLine ), "/TEMPDIR:" ) = -1 Then
  4319. 						strCommandLine = "/TEMPDIR:""" & gvaSettingsStr.Item( "TEMPDIR" ) & """ " & strCommandLine
  4320. 					End If
  4321. 					If InStr( UCase( strCommandLine ), "/NOADMIN" ) = -1 Then
  4322. 						strCommandLine = "/NOADMIN " & strCommandLine
  4323. 					End If
  4324.  
  4325. 					' 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.
  4326. 					' Failing to do so will block Chrome from opening new unelevated tabs or windows after the first elevated window is opened.
  4327. 					If Not gvbIsElevated And InStr( UCase( gvsDefaultBrowserName ), "CHROME" ) Then
  4328. 						Set colItems = gvoWMIlocalCimv2.ExecQuery( "SELECT * FROM Win32_Process WHERE ExecutablePath='" & Replace( gvsDefaultBrowserPath, "\", "\\" ) & "'" )
  4329. 						If colItems.Count = 0 Then
  4330. 							gvoWSHShell.Run """" & gvsDefaultBrowserPath & """", 7, False
  4331. 						End If
  4332. 						Set colItems = Nothing
  4333. 					End If
  4334.  
  4335. 					' Elevate privileges
  4336. 					Set objUAC = CreateObject( "Shell.Application" )
  4337. 					objUAC.ShellExecute "MSHTA.EXE", """" & strHTA & """ " & strCommandLine, "", "runas", 1
  4338. 					Set objUAC = Nothing
  4339. 					window.close True
  4340. 				ElseIf intAnswer = vbNo Then
  4341. 					IsAdmin = True
  4342. 				End If
  4343. 			End If
  4344. 		End If
  4345. 		On Error GoTo 0
  4346.     End If
  4347. End Function
  4348.  
  4349.  
  4350. Function IsLocalComputer( )
  4351. 	' Check if specified computer is the local computer
  4352. 	IsLocalComputer = False
  4353. 	gvsComputer = CheckComputerName( ComputerName.value )
  4354. 	If gvsComputer = "" Then Exit Function
  4355. 	If gvbWinPE Then
  4356. 		IsLocalComputer                     = True
  4357. 		gvaSettingsBool.Item( "DXDIAG"    ) = False
  4358. 		gvaSettingsBool.Item( "DMIDECODE" ) = False
  4359. 	ElseIf ( gvsComputer = GetLocalComputerName( ) ) Or ( gvsComputer = "LOCALHOST" ) Or ( gvsComputer = "127.0.0.1" ) Or ( gvsComputer = "::1" ) Then
  4360. 		IsLocalComputer                   = True
  4361. 		gvaSettingsStr.Item( "COMPUTER" ) = gvsComputer
  4362. 	Else
  4363. 		IsLocalComputer                     = False
  4364. 		gvaSettingsBool.Item( "DXDIAG"    ) = False
  4365. 		gvaSettingsBool.Item( "DMIDECODE" ) = False
  4366. 		gvaSettingsStr.Item( "COMPUTER" )   = gvsComputer
  4367. 	End If
  4368. 	ConfigUpdateStatus
  4369. End Function
  4370.  
  4371.  
  4372. Sub ListColors( myDropdown, myPreselected )
  4373. 	' Populate a dropdown list with colors available in CSS
  4374. 	Dim i, objDropdown, objOption, strColor
  4375. 	Set objDropdown = document.getElementById( myDropdown )
  4376. 	objDropdown.innerHTML = ""
  4377. 	On Error Resume Next ' REQUIRED
  4378. 	For Each strColor In gvaCSSColors.Keys
  4379. 		Set objOption = document.createElement( "OPTION" )
  4380. 		objOption.text                  = strColor
  4381. 		objOption.value                 = LCase( strColor )
  4382. 		objOption.selected              = ( LCase( myPreselected ) = LCase( strColor ) )
  4383. 		objOption.style.backgroundColor = LCase( strColor )
  4384. 		objOption.style.color           = gvaCSSColors.Item( strColor )
  4385. 		If Not Err Then objDropdown.Add( objOption )
  4386. 		Set objOption = Nothing
  4387. 	Next
  4388. 	On Error Goto 0
  4389. 	Set objDropdown = Nothing
  4390. End Sub
  4391.  
  4392.  
  4393. Sub ListCSSColors( )
  4394. 	' List of available CSS colors by W3Schools.com:
  4395. 	' http://www.w3schools.com/colors/colors_names.asp
  4396. 	' Contrasting text colors calculated with code by Brian Suda:
  4397. 	' https://24ways.org/2010/calculating-color-contrast/
  4398. 	On Error Resume Next ' REQUIRED
  4399. 	Set gvaCSSColors = Nothing
  4400. 	On Error Goto 0
  4401. 	Set gvaCSSColors = CreateObject( "Scripting.Dictionary" )
  4402. 	gvaCSSColors.Item( "AliceBlue" )            = "black"
  4403. 	gvaCSSColors.Item( "AntiqueWhite" )         = "black"
  4404. 	gvaCSSColors.Item( "Aqua" )                 = "black"
  4405. 	gvaCSSColors.Item( "Aquamarine" )           = "black"
  4406. 	gvaCSSColors.Item( "Azure" )                = "black"
  4407. 	gvaCSSColors.Item( "Beige" )                = "black"
  4408. 	gvaCSSColors.Item( "Bisque" )               = "black"
  4409. 	gvaCSSColors.Item( "Black" )                = "white"
  4410. 	gvaCSSColors.Item( "BlanchedAlmond" )       = "black"
  4411. 	gvaCSSColors.Item( "Blue" )                 = "white"
  4412. 	gvaCSSColors.Item( "BlueViolet" )           = "white"
  4413. 	gvaCSSColors.Item( "Brown" )                = "white"
  4414. 	gvaCSSColors.Item( "BurlyWood" )            = "black"
  4415. 	gvaCSSColors.Item( "CadetBlue" )            = "black"
  4416. 	gvaCSSColors.Item( "Chartreuse" )           = "black"
  4417. 	gvaCSSColors.Item( "Chocolate" )            = "white"
  4418. 	gvaCSSColors.Item( "Coral" )                = "black"
  4419. 	gvaCSSColors.Item( "CornflowerBlue" )       = "black"
  4420. 	gvaCSSColors.Item( "Cornsilk" )             = "black"
  4421. 	gvaCSSColors.Item( "Crimson" )              = "white"
  4422. 	gvaCSSColors.Item( "Cyan" )                 = "black"
  4423. 	gvaCSSColors.Item( "DarkBlue" )             = "white"
  4424. 	gvaCSSColors.Item( "DarkCyan" )             = "white"
  4425. 	gvaCSSColors.Item( "DarkGoldenRod" )        = "black"
  4426. 	gvaCSSColors.Item( "DarkGray" )             = "black"
  4427. 	gvaCSSColors.Item( "DarkGrey" )             = "black"
  4428. 	gvaCSSColors.Item( "DarkGreen" )            = "white"
  4429. 	gvaCSSColors.Item( "DarkKhaki" )            = "black"
  4430. 	gvaCSSColors.Item( "DarkMagenta" )          = "white"
  4431. 	gvaCSSColors.Item( "DarkOliveGreen" )       = "white"
  4432. 	gvaCSSColors.Item( "DarkOrange" )           = "black"
  4433. 	gvaCSSColors.Item( "DarkOrchid" )           = "white"
  4434. 	gvaCSSColors.Item( "DarkRed" )              = "white"
  4435. 	gvaCSSColors.Item( "DarkSalmon" )           = "black"
  4436. 	gvaCSSColors.Item( "DarkSeaGreen" )         = "black"
  4437. 	gvaCSSColors.Item( "DarkSlateBlue" )        = "white"
  4438. 	gvaCSSColors.Item( "DarkSlateGray" )        = "white"
  4439. 	gvaCSSColors.Item( "DarkSlateGrey" )        = "white"
  4440. 	gvaCSSColors.Item( "DarkTurquoise" )        = "black"
  4441. 	gvaCSSColors.Item( "DarkViolet" )           = "white"
  4442. 	gvaCSSColors.Item( "DeepPink" )             = "white"
  4443. 	gvaCSSColors.Item( "DeepSkyBlue" )          = "black"
  4444. 	gvaCSSColors.Item( "DimGray" )              = "white"
  4445. 	gvaCSSColors.Item( "DimGrey" )              = "white"
  4446. 	gvaCSSColors.Item( "DodgerBlue" )           = "white"
  4447. 	gvaCSSColors.Item( "FireBrick" )            = "white"
  4448. 	gvaCSSColors.Item( "FloralWhite" )          = "black"
  4449. 	gvaCSSColors.Item( "ForestGreen" )          = "white"
  4450. 	gvaCSSColors.Item( "Fuchsia" )              = "white"
  4451. 	gvaCSSColors.Item( "Gainsboro" )            = "black"
  4452. 	gvaCSSColors.Item( "GhostWhite" )           = "black"
  4453. 	gvaCSSColors.Item( "Gold" )                 = "black"
  4454. 	gvaCSSColors.Item( "GoldenRod" )            = "black"
  4455. 	gvaCSSColors.Item( "Gray" )                 = "black"
  4456. 	gvaCSSColors.Item( "Grey" )                 = "black"
  4457. 	gvaCSSColors.Item( "Green" )                = "white"
  4458. 	gvaCSSColors.Item( "GreenYellow" )          = "black"
  4459. 	gvaCSSColors.Item( "HoneyDew" )             = "black"
  4460. 	gvaCSSColors.Item( "HotPink" )              = "black"
  4461. 	gvaCSSColors.Item( "IndianRed" )            = "white"
  4462. 	gvaCSSColors.Item( "Indigo" )               = "white"
  4463. 	gvaCSSColors.Item( "Ivory" )                = "black"
  4464. 	gvaCSSColors.Item( "Khaki" )                = "black"
  4465. 	gvaCSSColors.Item( "Lavender" )             = "black"
  4466. 	gvaCSSColors.Item( "LavenderBlush" )        = "black"
  4467. 	gvaCSSColors.Item( "LawnGreen" )            = "black"
  4468. 	gvaCSSColors.Item( "LemonChiffon" )         = "black"
  4469. 	gvaCSSColors.Item( "LightBlue" )            = "black"
  4470. 	gvaCSSColors.Item( "LightCoral" )           = "black"
  4471. 	gvaCSSColors.Item( "LightCyan" )            = "black"
  4472. 	gvaCSSColors.Item( "LightGoldenRodYellow" ) = "black"
  4473. 	gvaCSSColors.Item( "LightGray" )            = "black"
  4474. 	gvaCSSColors.Item( "LightGrey" )            = "black"
  4475. 	gvaCSSColors.Item( "LightGreen" )           = "black"
  4476. 	gvaCSSColors.Item( "LightPink" )            = "black"
  4477. 	gvaCSSColors.Item( "LightSalmon" )          = "black"
  4478. 	gvaCSSColors.Item( "LightSeaGreen" )        = "black"
  4479. 	gvaCSSColors.Item( "LightSkyBlue" )         = "black"
  4480. 	gvaCSSColors.Item( "LightSlateGray" )       = "black"
  4481. 	gvaCSSColors.Item( "LightSlateGrey" )       = "black"
  4482. 	gvaCSSColors.Item( "LightSteelBlue" )       = "black"
  4483. 	gvaCSSColors.Item( "LightYellow" )          = "black"
  4484. 	gvaCSSColors.Item( "Lime" )                 = "black"
  4485. 	gvaCSSColors.Item( "LimeGreen" )            = "black"
  4486. 	gvaCSSColors.Item( "Linen" )                = "black"
  4487. 	gvaCSSColors.Item( "Magenta" )              = "white"
  4488. 	gvaCSSColors.Item( "Maroon" )               = "white"
  4489. 	gvaCSSColors.Item( "MediumAquaMarine" )     = "black"
  4490. 	gvaCSSColors.Item( "MediumBlue" )           = "white"
  4491. 	gvaCSSColors.Item( "MediumOrchid" )         = "black"
  4492. 	gvaCSSColors.Item( "MediumPurple" )         = "black"
  4493. 	gvaCSSColors.Item( "MediumSeaGreen" )       = "black"
  4494. 	gvaCSSColors.Item( "MediumSlateBlue" )      = "white"
  4495. 	gvaCSSColors.Item( "MediumSpringGreen" )    = "black"
  4496. 	gvaCSSColors.Item( "MediumTurquoise" )      = "black"
  4497. 	gvaCSSColors.Item( "MediumVioletRed" )      = "white"
  4498. 	gvaCSSColors.Item( "MidnightBlue" )         = "white"
  4499. 	gvaCSSColors.Item( "MintCream" )            = "black"
  4500. 	gvaCSSColors.Item( "MistyRose" )            = "black"
  4501. 	gvaCSSColors.Item( "Moccasin" )             = "black"
  4502. 	gvaCSSColors.Item( "NavajoWhite" )          = "black"
  4503. 	gvaCSSColors.Item( "Navy" )                 = "white"
  4504. 	gvaCSSColors.Item( "OldLace" )              = "black"
  4505. 	gvaCSSColors.Item( "Olive" )                = "white"
  4506. 	gvaCSSColors.Item( "OliveDrab" )            = "white"
  4507. 	gvaCSSColors.Item( "Orange" )               = "black"
  4508. 	gvaCSSColors.Item( "OrangeRed" )            = "white"
  4509. 	gvaCSSColors.Item( "Orchid" )               = "black"
  4510. 	gvaCSSColors.Item( "PaleGoldenRod" )        = "black"
  4511. 	gvaCSSColors.Item( "PaleGreen" )            = "black"
  4512. 	gvaCSSColors.Item( "PaleTurquoise" )        = "black"
  4513. 	gvaCSSColors.Item( "PaleVioletRed" )        = "black"
  4514. 	gvaCSSColors.Item( "PapayaWhip" )           = "black"
  4515. 	gvaCSSColors.Item( "PeachPuff" )            = "black"
  4516. 	gvaCSSColors.Item( "Peru" )                 = "black"
  4517. 	gvaCSSColors.Item( "Pink" )                 = "black"
  4518. 	gvaCSSColors.Item( "Plum" )                 = "black"
  4519. 	gvaCSSColors.Item( "PowderBlue" )           = "black"
  4520. 	gvaCSSColors.Item( "Purple" )               = "white"
  4521. 	gvaCSSColors.Item( "RebeccaPurple" )        = "white"
  4522. 	gvaCSSColors.Item( "Red" )                  = "white"
  4523. 	gvaCSSColors.Item( "RosyBrown" )            = "black"
  4524. 	gvaCSSColors.Item( "RoyalBlue" )            = "white"
  4525. 	gvaCSSColors.Item( "SaddleBrown" )          = "white"
  4526. 	gvaCSSColors.Item( "Salmon" )               = "black"
  4527. 	gvaCSSColors.Item( "SandyBrown" )           = "black"
  4528. 	gvaCSSColors.Item( "SeaGreen" )             = "white"
  4529. 	gvaCSSColors.Item( "SeaShell" )             = "black"
  4530. 	gvaCSSColors.Item( "Sienna" )               = "white"
  4531. 	gvaCSSColors.Item( "Silver" )               = "black"
  4532. 	gvaCSSColors.Item( "SkyBlue" )              = "black"
  4533. 	gvaCSSColors.Item( "SlateBlue" )            = "white"
  4534. 	gvaCSSColors.Item( "SlateGray" )            = "white"
  4535. 	gvaCSSColors.Item( "SlateGrey" )            = "white"
  4536. 	gvaCSSColors.Item( "Snow" )                 = "black"
  4537. 	gvaCSSColors.Item( "SpringGreen" )          = "black"
  4538. 	gvaCSSColors.Item( "SteelBlue" )            = "white"
  4539. 	gvaCSSColors.Item( "Tan" )                  = "black"
  4540. 	gvaCSSColors.Item( "Teal" )                 = "white"
  4541. 	gvaCSSColors.Item( "Thistle" )              = "black"
  4542. 	gvaCSSColors.Item( "Tomato" )               = "black"
  4543. 	gvaCSSColors.Item( "Turquoise" )            = "black"
  4544. 	gvaCSSColors.Item( "Violet" )               = "black"
  4545. 	gvaCSSColors.Item( "Wheat" )                = "black"
  4546. 	gvaCSSColors.Item( "White" )                = "black"
  4547. 	gvaCSSColors.Item( "WhiteSmoke" )           = "black"
  4548. 	gvaCSSColors.Item( "Yellow" )               = "black"
  4549. 	gvaCSSColors.Item( "YellowGreen" )          = "black"
  4550. End Sub
  4551.  
  4552.  
  4553. Function Max( num1, num2 )
  4554. 	If CInt( num1 ) > CInt( num2 ) Then
  4555. 		Max = CInt( num1 )
  4556. 	Else
  4557. 		Max = CInt( num2 )
  4558. 	End If
  4559. End Function
  4560.  
  4561.  
  4562. Function Min( num1, num2 )
  4563. 	If CInt( num1 ) < CInt( num2 ) Then
  4564. 		Min = CInt( num1 )
  4565. 	Else
  4566. 		Min = CInt( num2 )
  4567. 	End If
  4568. End Function
  4569.  
  4570.  
  4571. Sub OnClick_CheckboxDMIDecode( )
  4572. 	If gvbWinPE Then
  4573. 		CheckboxDMIDecode.checked  = False
  4574. 		CheckboxDMIDecode.disabled = True
  4575. 	End If
  4576. End Sub
  4577.  
  4578.  
  4579. Sub OnClick_CheckboxDxDiag( )
  4580. 	If gvbWinPE Then
  4581. 		CheckboxDxDiag.checked   = False
  4582. 		CheckboxDxDiag.disabled  = True
  4583. 		CheckboxKeepXML.checked  = False
  4584. 		CheckboxKeepXML.disabled = True
  4585. 	End If
  4586. 	CheckboxKeepXML.checked  = CheckboxKeepXML.checked And CheckboxDxDiag.checked
  4587. 	If CheckboxDxDiag.checked Then
  4588. 		TablerowKeepXML.style.display       = "table-row"
  4589. 		TablerowKeepXML.style.visibility    = "visible"
  4590. 		TablerowDxDiagPath.style.display    = "table-row"
  4591. 		TablerowDxDiagPath.style.visibility = "visible"
  4592. 	Else
  4593. 		gvaSettingsStr.Item( "XML" )        = gvaDefaultsStr.Item( "XML" )
  4594. 		TablerowKeepXML.style.display       = "none"
  4595. 		TablerowKeepXML.style.visibility    = "collapse"
  4596. 		TablerowDxDiagPath.style.display    = "none"
  4597. 		TablerowDxDiagPath.style.visibility = "collapse"
  4598. 	End If
  4599. 	InputDxDiag.value = gvaSettingsStr.Item( "XML" )
  4600. End Sub
  4601.  
  4602.  
  4603. Sub PasteFromClipboard
  4604. 	Dim strText
  4605. 	On Error Resume Next ' REQUIRED
  4606. 	strText = Document.ParentWindow.ClipboardData.GetData( "text" )
  4607. 	If Err Then
  4608. 		MsgBox "An error occurred while trying to paste data from the clipboard:" & vbCrLf & vbCrLf & Err.Description, vbOKOnly, "Clipboard Error"
  4609. 	Else
  4610. 		If Not IsNull( strText ) Then ComputerName.value = strText
  4611. 	End If
  4612. 	On Error Goto 0
  4613. End Sub
  4614.  
  4615.  
  4616. Sub Print( )
  4617. 	' Build an HTML table with the results, to allow printing
  4618. 	Dim arrData, arrHeader, i, j, objPrintFile, strHTML, strTable
  4619.  
  4620. 	' Create a temporary HTML file and open it in the default browser
  4621. 	strHTML = "<html>" _
  4622. 	        & "<head>" _
  4623. 	        & "<title>Basic Hardware Inventory " & Hardware.Version & " - &copy; 2005 - " & COPYRIGHTS_YEAR & " Rob van der Woude</title>" & vbCrLf _
  4624. 	        & "<style type=""text/css"">"          & vbCrLf _
  4625. 	        & ".Odd { background-color: silver; }" & vbCrLf _
  4626. 	        & "</style>"    & vbCrLf _
  4627. 	        & "</head>"     & vbCrLf _
  4628. 	        & "<body>"      & vbCrLf _
  4629. 	        & PrintTable( )          _
  4630. 	        & "</body>"     & vbCrLf _
  4631. 	        & "</html>"     & vbCrLf
  4632.  
  4633. 	Set objPrintFile = gvoFSO.CreateTextFile( gvsPrintFile )
  4634. 	objPrintFile.Write( strHTML )
  4635. 	objPrintFile.Close
  4636. 	Set objPrintFile = Nothing
  4637. 	gvoWSHShell.Run gvsPrintFile, 7, False
  4638. End Sub
  4639.  
  4640.  
  4641. Function PrintTable( )
  4642. 	Dim arrData, arrHeader, i, strClass, strTable
  4643. 	strTable  = "<table style=""border: 1px solid black; width: 100%;"">" & vbCrLf
  4644. 	strTable  = strTable _
  4645. 	          & "<thead style=""font-weight: bold; font-size: 120%; display: table-header-group; page-break-before: always;"">" & vbCrLf _
  4646. 	          & "<tr class=""Odd"" style=""page-break-inside: avoid;"">" & vbCrLf _
  4647. 	          & "    <th style=""page-break-inside: avoid; border: 1px solid black;"">Component</th>" & vbCrLf _
  4648. 	          & "    <th style=""page-break-inside: avoid; border: 1px solid black;"">Value</th>"     & vbCrLf _
  4649. 	          & "</tr>"    & vbCrLf _
  4650. 	          & "</thead>" & vbCrLf _
  4651. 	          & "<tbody>"  & vbCrLf
  4652. 	arrData   = Split( gvsCSVTxt, vbTab, -1, 1 )
  4653. 	arrHeader = Split( gvsHeader, vbTab, -1, 1 )
  4654. 	For i = 0 To Min( UBound( arrHeader ), UBound( arrData ) )
  4655. 		If i Mod 2 = 0 Then
  4656. 			strClass = ""
  4657. 		Else
  4658. 			strClass = " class=""Odd"""
  4659. 		End If
  4660. 		strTable = strTable _
  4661. 		         & "<tr" & strClass & " style=""page-break-inside: avoid;"">" & vbCrLf _
  4662. 		         & "    <th style=""page-break-inside: avoid; border: 1px solid black; text-align: left; padding: 5px;"">" & arrHeader(i) & "</th>" & vbCrLf _
  4663. 		         & "    <td style=""page-break-inside: avoid; border: 1px solid black; text-align: left; padding: 5px;"">" & arrData(i)   & "</td>" & vbCrLf _
  4664. 		         & "</tr>" & vbCrLf
  4665. 	Next
  4666. 	strTable = strTable _
  4667. 	         & "</tbody>" & vbCrLf _
  4668. 	         & "</table>" & vbCrLf
  4669. 	PrintTable = strTable
  4670. End Function
  4671.  
  4672.  
  4673. Sub Reset( )
  4674. 	window_onunload
  4675. 	Location.Reload True
  4676. End Sub
  4677.  
  4678.  
  4679. Sub SaveSettings( )
  4680. 	ConfigSaveChanges
  4681. 	ConfigSaveFile
  4682. 	ConfigUpdateStatus
  4683. 	ShowMain
  4684. End Sub
  4685.  
  4686.  
  4687. Function SaveTabDelimited( )
  4688. 	Dim objFile, strFile, strMsg, strWinPE
  4689. 	SaveTabDelimited = ""
  4690. 	If gvbWinPE Then
  4691. 		strWinPE = ".WinPE."
  4692. 	Else
  4693. 		strWinPE = "."
  4694. 	End If
  4695. 	If gvaSettingsStr.Item( "SAVE" ) = "*" Or gvaSettingsStr.Item( "SAVE" ) = "" Then
  4696. 		strFile = gvoFSO.BuildPath( gvoFSO.GetParentFolderName( Self.location.pathname ), "Hardware." & gvaDefaultsStr.Item( "COMPUTER" ) & strWinPE & Replace( Replace( TimeStamp( ), ":", "" ), " ", "_" ) & ".txt" )
  4697. 	ElseIf Right( gvaSettingsStr.Item( "SAVE" ), 2 ) = "\*" Then
  4698. 		strFile = Left( gvaSettingsStr.Item( "SAVE" ), Len( gvaSettingsStr.Item( "SAVE" ) ) - 1 ) & "Hardware." & gvaDefaultsStr.Item( "COMPUTER" ) & strWinPE & TimeStamp( ) & ".txt"
  4699. 	Else
  4700. 		strFile = gvaSettingsStr.Item( "SAVE" )
  4701. 	End If
  4702. 	If InStr( gvaSettingsStr.Item( "SAVE" ), "\" ) = -1 Then
  4703. 		strFile = gvoFSO.BuildPath( gvoFSO.GetParentFolderName( Self.location.pathname ), strFile )
  4704. 	End If
  4705. 	If strFile <> "" Then
  4706. 		If Left( strFile, 1 )  = """" Then strFile = Mid( strFile, 2 )
  4707. 		If Right( strFile, 1 ) = """" Then strFile = Left( strFile, Len( strFile ) - 1 )
  4708. 	End If
  4709. 	With gvoFSO
  4710. 		If .FolderExists( .GetParentFolderName( strFile ) ) Then
  4711. 			On Error Resume Next ' REQUIRED
  4712. 			strFile = .GetAbsolutePathName( strFile )
  4713. 			Set objFile = .CreateTextFile( strFile, True, False )
  4714. 			If Err Then
  4715. 				strMsg = "Error #" & Err.Number & " while trying to save the results to """ & strFile & """:"
  4716. 				strMsg = strMsg & vbCrLf & Err.Description
  4717. 				MsgBox strMsg, vbOKOnly, "File Save Error"
  4718. 				strFile = ""
  4719. 			Else
  4720. 				objFile.WriteLine gvsHeader
  4721. 				objFile.WriteLine gvsCSVTxt
  4722. 				objFile.Close
  4723. 				If Not gvbSilent Then MsgBox "File """ & strFile & """ successfully saved.", vbOKOnly, "File Saved"
  4724. 			End If
  4725. 			Set objFile = Nothing
  4726. 			On Error Goto 0
  4727. 		Else
  4728. 			MsgBox "Folder """ & .GetParentFolderName( strFile ) & """ does not exist.", vbOKOnly, "File save error"
  4729. 			strFile = ""
  4730. 		End If
  4731. 	End With
  4732. 	SaveTabDelimited = strFile
  4733. End Function
  4734.  
  4735.  
  4736. Sub SetCustomColor( myDropdown )
  4737. 	Dim arrCustomColors, colElements, objDropdown, objElement, objOption
  4738. 	arrCustomColors = Split( gvaSettingsStr.Item( "CUSTOMCOLORS" ), ";" )
  4739. 	Set objDropdown = document.getElementById( myDropdown )
  4740. 	For Each objOption In objDropdown.options
  4741. 		If objOption.selected Then
  4742. 			Select Case myDropdown
  4743. 				Case "BackgroundColor":
  4744. 					document.body.style.backgroundColor = arrCustomColors(0)
  4745. 				Case "CaptionsColor":
  4746. 					document.body.style.color = arrCustomColors(1)
  4747. 				Case "LinksColor":
  4748. 					Set colElements = document.getElementsByTagName( "a" )
  4749. 					For Each objElement In colElements
  4750. 						objElement.style.color = arrCustomColors(2)
  4751. 					Next
  4752. 					Set colElements = Nothing
  4753. 				Case "ButtonFaceColor":
  4754. 					Set colElements = document.getElementsByTagName( "input" )
  4755. 					For Each objElement In colElements
  4756. 						If objElement.type = "button" Then
  4757. 							objElement.style.backgroundColor = arrCustomColors(3)
  4758. 						End If
  4759. 					Next
  4760. 					Set colElements = Nothing
  4761. 				Case "ButtonCaptionsColor":
  4762. 					Set colElements = document.getElementsByTagName( "input" )
  4763. 					For Each objElement In colElements
  4764. 						If objElement.type = "button" Then
  4765. 							objElement.style.color = arrCustomColors(4)
  4766. 						End If
  4767. 					Next
  4768. 					Set colElements = Nothing
  4769. 				Case "CodeColor":
  4770. 					Set colElements = document.getElementsByTagName( "code" )
  4771. 					For Each objElement In colElements
  4772. 						objElement.style.color = arrCustomColors(5)
  4773. 					Next
  4774. 					Set colElements = Nothing
  4775. 			End Select
  4776. 		End If
  4777. 	Next
  4778. 	Set objDropdown = Nothing
  4779. End Sub
  4780.  
  4781.  
  4782. Sub SetCustomTheme( )
  4783. 	Dim objOption, strCustomColors
  4784. 	ThemeBlue.checked   = False
  4785. 	ThemeBW.checked     = False
  4786. 	ThemeRed.checked    = False
  4787. 	ThemeCustom.checked = True
  4788. 	gvaSettingsStr.Item( "THEME" ) = "ThemeCustom"
  4789. 	For Each objOption In BackgroundColor.options
  4790. 		If objOption.selected Then strCustomColors = objOption.value
  4791. 	Next
  4792. 	For Each objOption In CaptionsColor.options
  4793. 		If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  4794. 	Next
  4795. 	For Each objOption In LinksColor.options
  4796. 		If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  4797. 	Next
  4798. 	For Each objOption In ButtonFaceColor.options
  4799. 		If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  4800. 	Next
  4801. 	For Each objOption In ButtonCaptionsColor.options
  4802. 		If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  4803. 	Next
  4804. 	For Each objOption In CodeColor.options
  4805. 		If objOption.selected Then strCustomColors = strCustomColors & ";" & objOption.value
  4806. 	Next
  4807. 	gvaSettingsStr.Item( "CUSTOMCOLORS" ) = LCase( strCustomColors )
  4808. End Sub
  4809.  
  4810.  
  4811. Sub SetTheme( )
  4812. 	If ThemeBW.checked Then
  4813. 		If gvaSettingsStr.Item( "THEME" ) = "ThemeBlue" Then
  4814. 			Exit Sub
  4815. 		Else
  4816. 			gvaSettingsStr.Item( "THEME" ) = "ThemeBlue"
  4817. 		End If
  4818. 	ElseIf ThemeBW.checked Then
  4819. 		If gvaSettingsStr.Item( "THEME" ) = "ThemeBW" Then
  4820. 			Exit Sub
  4821. 		Else
  4822. 			gvaSettingsStr.Item( "THEME" ) = "ThemeBW"
  4823. 		End If
  4824. 	ElseIf ThemeCustom.checked Then
  4825. 		gvaSettingsStr.Item( "THEME" ) = "ThemeCustom"
  4826. 	ElseIf ThemeDark.checked Then
  4827. 		If gvaSettingsStr.Item( "THEME" ) = "ThemeDark" Then
  4828. 			Exit Sub
  4829. 		Else
  4830. 			gvaSettingsStr.Item( "THEME" ) = "ThemeDark"
  4831. 		End If
  4832. 	ElseIf ThemeRed.checked Then
  4833. 		If gvaSettingsStr.Item( "THEME" ) = "ThemeRed" Then
  4834. 			Exit Sub
  4835. 		Else
  4836. 			gvaSettingsStr.Item( "THEME" ) = "ThemeRed"
  4837. 		End If
  4838. 	ElseIf Not gvaSettingsStr.Item( "THEME" ) = "ThemeBW" Then
  4839. 		gvaSettingsStr.Item( "THEME" ) = "ThemeBW"
  4840. 	End If
  4841. End Sub
  4842.  
  4843.  
  4844. Sub ShowCredits( )
  4845. 	MainScreen.style.display     = "none"
  4846. 	SettingsScreen.style.display = "none"
  4847. 	HelpScreen.style.display     = "none"
  4848. 	CreditsScreen.style.display  = "block"
  4849. 	Back.style.display           = "block"
  4850. End Sub
  4851.  
  4852.  
  4853. Sub ShowDonate( )
  4854. 	gvoWSHShell.Run "https://www.robvanderwoude.com/donate.php", 7, False
  4855. End Sub
  4856.  
  4857.  
  4858. Sub ShowHelp( )
  4859. 	MainScreen.style.display     = "none"
  4860. 	SettingsScreen.style.display = "none"
  4861. 	HelpScreen.style.display     = "block"
  4862. 	CreditsScreen.style.display  = "none"
  4863. 	Back.style.display           = "block"
  4864. End Sub
  4865.  
  4866.  
  4867. Sub ShowMain( )
  4868. 	MainScreen.style.display     = "block"
  4869. 	SettingsScreen.style.display = "none"
  4870. 	HelpScreen.style.display     = "none"
  4871. 	CreditsScreen.style.display  = "none"
  4872. 	Back.style.display           = "none"
  4873. End Sub
  4874.  
  4875.  
  4876. Sub ShowSettings( )
  4877. 	MainScreen.style.display     = "none"
  4878. 	SettingsScreen.style.display = "block"
  4879. 	HelpScreen.style.display     = "none"
  4880. 	CreditsScreen.style.display  = "none"
  4881. 	Back.style.display           = "none"
  4882. 	ButtonEditCfg.disabled = Not gvoFSO.FileExists( gvsConfigFile )
  4883. 	If gvaSettingsBool.Item( "DEVTEST" ) Then
  4884. 		InputDxDiag.value  = "C:\Scripts\Hardware.xml"
  4885. 	End If
  4886. 	If InputDxDiag.value = "" Then
  4887. 		ButtonDeleteXML.disabled = True
  4888. 	Else
  4889. 		If gvoFSO.FileExists( InputDxDiag.value ) Then
  4890. 			ButtonDeleteXML.disabled = False
  4891. 		Else
  4892. 			ButtonDeleteXML.disabled = True
  4893. 		End If
  4894. 	End If
  4895. 	ButtonReset.disabled = ConfigTestIfDefault( )
  4896. End Sub
  4897.  
  4898.  
  4899. Sub Sleep( seconds )
  4900. 	Dim objShell, strCmd
  4901. 	Set objShell = CreateObject( "Wscript.Shell" )
  4902. 	strCmd = "%COMSPEC% /C PING -n " & seconds & " localhost > NUL 2>&1"
  4903. 	objShell.Run strCmd, 0, 1
  4904. 	Set objShell = Nothing
  4905. End Sub
  4906.  
  4907.  
  4908. Function TextFromHTML( myURL )
  4909. 	Dim objHTTP
  4910. 	TextFromHTML = ""
  4911. 	On Error Resume Next ' REQUIRED
  4912. 	Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" )
  4913. 	objHTTP.Open "GET", myURL
  4914. 	objHTTP.Send
  4915. 	If Err Then gvbConnected = False
  4916. 	' Check if the result was valid, and if so return the result
  4917. 	If objHTTP.Status = 200 Then TextFromHTML = objHTTP.ResponseText
  4918. 	Set objHTTP = Nothing
  4919. 	On Error Goto 0
  4920. End Function
  4921.  
  4922.  
  4923. Function TimeStamp( )
  4924. 	TimeStamp = Year( Now ) _
  4925. 	          & "-" _
  4926. 	          & Right( "0" & Month(  Now ), 2 ) _
  4927. 	          & "-" _
  4928. 	          & Right( "0" & Day(    Now ), 2 ) _
  4929. 	          & " " _
  4930. 	          & Right( "0" & Hour(   Now ), 2 ) _
  4931. 	          & ":" _
  4932. 	          & Right( "0" & Minute( Now ), 2 ) _
  4933. 	          & ":" _
  4934. 	          & Right( "0" & Second( Now ), 2 )
  4935. End Function
  4936.  
  4937.  
  4938. Sub ValidateZoomFactor( )
  4939. 	Dim intZoomFactor, objRE
  4940. 	intZoomFactor = Trim( InputZoomFactor.value )
  4941. 	Set objRE = New RegExp
  4942. 	objRE.Pattern = "[^\d]"
  4943. 	objRE.Global  = True
  4944. 	If Not objRE.Replace( intZoomFactor, "" ) = intZoomFactor Then
  4945. 		intZoomFactor = objRE.Replace( intZoomFactor, "" )
  4946. 	End If
  4947. 	Set objRE = Nothing
  4948. 	If intZoomFactor > 250 Then
  4949. 		intZoomFactor = 250
  4950. 	End If
  4951. 	If Not intZoomFactor = InputZoomFactor.value Then
  4952. 		InputZoomFactor.value = intZoomFactor
  4953. 	End If
  4954. End Sub
  4955.  
  4956.  
  4957. Sub window_onunload
  4958. 	On Error Resume Next ' REQUIRED
  4959. 	' Delete DxDiag's XML file if it exists, unless /KEEPXML switch was used
  4960. 	If gvaSettingsBool.Item( "DXDIAG" ) Then
  4961. 		If Not gvaSettingsBool.Item( "KEEPXML" ) Then
  4962. 			If Trim( gvaSettingsStr.Item( "XML" ) ) <> "" Then
  4963. 				If gvoFSO.FileExists( gvaSettingsStr.Item( "XML" ) ) Then
  4964. 					gvoFSO.DeleteFile gvaSettingsStr.Item( "XML" ), True
  4965. 				End If
  4966. 			End If
  4967. 		End If
  4968. 	End If
  4969. 	' Delete temporary files
  4970. 	With gvoFSO
  4971. 		If .FileExists( gvsDetailsFile ) Then .DeleteFile gvsDetailsFile, True
  4972. 		If .FileExists( gvsPrintFile )   Then .DeleteFile gvsPrintFile,   True
  4973. 	End With
  4974. 	' "Gracefully" close objects
  4975. 	Set gvaCSSColors             = Nothing
  4976. 	Set gvaDefaultsBool          = Nothing
  4977. 	Set gvaSettingsBool          = Nothing
  4978. 	Set gvaSettingsStr           = Nothing
  4979. 	Set gvoFSO                   = Nothing
  4980. 	Set gvoWMIlocalCimv2         = Nothing
  4981. 	Set gvoWMIrootCimv2          = Nothing
  4982. 	Set gvoWMIrootMSWinStorage   = Nothing
  4983. 	Set gvoWMIrootStandardCimv2  = Nothing
  4984. 	Set gvoWMIrootWMI            = Nothing
  4985. 	Set gvoWSHShell              = Nothing
  4986. 	Set gvoHDDInterfaces         = Nothing
  4987. 	Set gvoRandom                = Nothing
  4988. 	On Error Goto 0
  4989. 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>&nbsp;</p>
  1058.  
  1059. <p>If you like this program, why not show your appreciation by making a donation?</p>
  1060.  
  1061. <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>
  1062.  
  1063. <p class="Left">Your support is highly appreciated.</p>
  1064.  
  1065. </div><!-- end of left alignment -->
  1066.  
  1067. <p>&nbsp;</p>
  1068.  
  1069. </div><!-- end of "CreditsScreen" area -->
  1070.  
  1071.  
  1072.  
  1073. <div id="PrintScreen" class="PrintOnly">
  1074. <p>This field will contain the results of the last inventory; it is used for "fast" printing with Ctrl+P only.</p>
  1075. </div><!-- end of "PrintScreen" area -->
  1076.  
  1077.  
  1078.  
  1079. <div class="DontPrint">
  1080.  
  1081. <p>Basic Hardware Inventory,&nbsp; Version <span id="AppVersion">0.00</span><br />
  1082. <span style="font-size: 80%;">&copy; 2005 - <span id="AppYear">2016</span>, Rob van der Woude<br />
  1083. <a href="https://www.robvanderwoude.com/hardware.php">https://www.robvanderwoude.com/hardware.php</a></span></p>
  1084.  
  1085. <p>&nbsp;</p>
  1086.  
  1087. <p id="Back" style="display: none;"><input type="button" class="Button" value="Back" onclick="vbscript:ShowMain" /></p>
  1088.  
  1089. <p>&nbsp;</p>
  1090.  
  1091. </div><!-- end of "DontPrint" area -->
  1092.  
  1093. </div><!-- end of centered text -->
  1094.  
  1095. </body>
  1096. </html>

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