ct_cpuq.cmd 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. @echo off
  2. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3. :: ct_cpuq.cmd v.19.1
  4. :: - grab cpu and machine info.
  5. ::
  6. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  7. SETLOCAL
  8. if NOT [%CT_BUILD_VERSION%]==[] (
  9. goto main
  10. )
  11. echo Terms for Oracle Software Collection Tool >"%TEMP%\ct_cpuq_tmp.txt"
  12. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  13. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  14. echo By selecting "Accept License Agreement" (or the equivalent) or by installing or using the Software (as defined below), You indicate Your acceptance of these terms and Your agreement, as an authorized representative of Your company or organization (if being acquired for use by an entity) or as an individual, to comply with the license terms that apply to the Software. If you are not willing to be bound by these terms, do not indicate Your acceptance and do not download, install, or use the Software. >>"%TEMP%\ct_cpuq_tmp.txt"
  15. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  16. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  17. echo License Agreement>>"%TEMP%\ct_cpuq_tmp.txt"
  18. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  19. echo PLEASE SCROLL DOWN AND READ ALL OF THE FOLLOWING TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT (this "Agreement") CAREFULLY. THIS AGREEMENT IS A LEGALLY BINDING CONTRACT BETWEEN YOU AND ORACLE AMERICA, INC. THAT SETS FORTH THE TERMS THAT GOVERN YOUR USE OF THE SOFTWARE. >>"%TEMP%\ct_cpuq_tmp.txt"
  20. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  21. echo YOU MUST ACCEPT AND ABIDE BY THESE TERMS AS PRESENTED TO YOU - ANY CHANGES, ADDITIONS OR DELETIONS BY YOU TO THESE TERMS ARE NOT ACCEPTED AND WILL NOT BE PART OF THIS AGREEMENT. >>"%TEMP%\ct_cpuq_tmp.txt"
  22. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  23. echo Definitions>>"%TEMP%\ct_cpuq_tmp.txt"
  24. echo "Oracle" refers to Oracle America, Inc.. >>"%TEMP%\ct_cpuq_tmp.txt"
  25. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  26. echo "You" and "Your" refers to the individual or entity that wishes to use the Software. >>"%TEMP%\ct_cpuq_tmp.txt"
  27. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  28. echo "Software" refers to the tool(s), script(s) and/or software product(s) (and any applicable documentation) provided with these terms to You by Oracle and which You wish to access and use to measure, monitor and/or manage Your usage of separately-licensed Oracle software (the "Programs") that has been licensed under a separate agreement between Oracle and You, such as an Oracle Master Agreement, an Oracle Software License and Services Agreement, an Oracle PartnerNetwork Agreement or an Oracle distribution agreement (each, an "Oracle License Agreement"). >>"%TEMP%\ct_cpuq_tmp.txt"
  29. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  30. echo Rights Granted>>"%TEMP%\ct_cpuq_tmp.txt"
  31. echo Oracle grants You a non-exclusive, non-transferable limited right to use the Software, subject to the terms of this Agreement, for the limited purpose of measuring, monitoring and/or managing Your usage of the Programs. You may allow Your agents and contractors (including, without limitation, outsourcers) to use the Software for this purpose and You are responsible for their compliance with this Agreement in such use. You (including Your agents, contractors and/or outsourcers) may not use the Software for any other purpose. >>"%TEMP%\ct_cpuq_tmp.txt"
  32. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  33. echo Ownership and Restrictions>>"%TEMP%\ct_cpuq_tmp.txt"
  34. echo Oracle and Oracle's licensors retain all ownership and intellectual property rights to the Software. The Software may be installed on one or more servers; provided, however, that You may only make one copy of the Software for backup or archival purposes. >>"%TEMP%\ct_cpuq_tmp.txt"
  35. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  36. echo Third party technology that may be appropriate or necessary for use with the Software is specified in the Software documentation, notice files or readme files. Such third party technology is licensed to You under the terms of the third party technology license agreement specified >>"%TEMP%\ct_cpuq_tmp.txt"in the Software documentation, notice files or readme files and not under the terms of this Agreement.
  37. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  38. echo You may not:>>"%TEMP%\ct_cpuq_tmp.txt"
  39. echo - use the Software for Your own internal data processing or for any commercial or production purposes, or use the Software for any purpose except the purpose stated herein; >>"%TEMP%\ct_cpuq_tmp.txt"
  40. echo - remove or modify any Software markings or any notice of Oracle's or Oracle's licensors' proprietary rights;>>"%TEMP%\ct_cpuq_tmp.txt"
  41. echo - make the Software available in any manner to any third party for use in the third party's business operations, without Oracle's prior written consent;>>"%TEMP%\ct_cpuq_tmp.txt"
  42. echo - use the Software to provide third party training or rent or lease the Software or use the Software for commercial time sharing or service bureau use;>>"%TEMP%\ct_cpuq_tmp.txt"
  43. echo - assign this Agreement or give or transfer the Software or an interest in them to another individual or entity;>>"%TEMP%\ct_cpuq_tmp.txt"
  44. echo - cause or permit reverse engineering (unless required by law for interoperability), disassembly or decompilation of the Software (the foregoing prohibition includes but is not limited to review of data structures or similar materials produced by the Software);>>"%TEMP%\ct_cpuq_tmp.txt"
  45. echo - disclose results of any Software benchmark tests without Oracle's prior written consent; >>"%TEMP%\ct_cpuq_tmp.txt"
  46. echo - use any Oracle name, trademark or logo without Oracle's prior written consent. >>"%TEMP%\ct_cpuq_tmp.txt"
  47. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  48. echo Disclaimer of Warranty>>"%TEMP%\ct_cpuq_tmp.txt"
  49. echo ORACLE DOES NOT GUARANTEE THAT THE SOFTWARE WILL PERFORM ERROR-FREE OR UNINTERRUPTED. TO THE EXTENT NOT PROHIBITED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND THERE ARE NO WARRANTIES, EXPRESS OR IMPLIED, OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF MERCHANTABILITY, NONINFRINGEMENT OR FITNESS FOR A PARTICULAR PURPOSE, THAT APPLY TO THE SOFTWARE. >>"%TEMP%\ct_cpuq_tmp.txt"
  50. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  51. echo No Right to Technical Support>>"%TEMP%\ct_cpuq_tmp.txt"
  52. echo You acknowledge and agree that Oracle's technical support organization will not provide You with technical support for the Software licensed under this Agreement. >>"%TEMP%\ct_cpuq_tmp.txt"
  53. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  54. echo End of Agreement>>"%TEMP%\ct_cpuq_tmp.txt"
  55. echo You may terminate this Agreement by destroying all copies of the Software. Oracle has the right to terminate Your right to use the Software at any time upon notice to You, in which case You shall destroy all copies of the Software. >>"%TEMP%\ct_cpuq_tmp.txt"
  56. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  57. echo Entire Agreement>>"%TEMP%\ct_cpuq_tmp.txt"
  58. echo You agree that this Agreement is the complete agreement for the Software and supersedes all prior or contemporaneous agreements or representations, written or oral, regarding the Software. If any term of this Agreement is found to be invalid or unenforceable, the remaining provisions will remain effective and such term shall be replaced with a term consistent with the purpose and intent of this Agreement. >>"%TEMP%\ct_cpuq_tmp.txt"
  59. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  60. echo Limitation of Liability>>"%TEMP%\ct_cpuq_tmp.txt"
  61. echo IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOSS OF PROFITS, REVENUE, DATA OR DATA USE, INCURRED BY YOU OR ANY THIRD PARTY. ORACLE'S ENTIRE LIABILITY FOR DAMAGES ARISING OUT OF OR RELATED TO THIS AGREEMENT, WHETHER IN CONTRACT OR TORT OR OTHERWISE, SHALL IN NO EVENT EXCEED THE GREATER OF ONE THOUSAND U.S. DOLLARS (U.S. $1,000) OR THE LICENSE FEES THAT YOU HAVE PAID TO ORACLE FOR PROGRAMS PURSUANT TO AN ORACLE LICENSE AGREEMENT.>>"%TEMP%\ct_cpuq_tmp.txt"
  62. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  63. echo Export>>"%TEMP%\ct_cpuq_tmp.txt"
  64. echo Export laws and regulations of the United States and any other relevant local export laws and regulations apply to the Software. You agree that such export control laws govern Your use of the Software (including technical data) provided under this Agreement, and You agree to comply with all such export laws and regulations (including "deemed export" and "deemed re-export" regulations). You agree that no data, information, and/or Software (or direct product thereof) will be exported, directly or indirectly, in violation of any export laws, nor will they be used for any purpose prohibited by these laws including, without limitation, nuclear, chemical, or biological weapons proliferation, or development of missile technology. >>"%TEMP%\ct_cpuq_tmp.txt"
  65. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  66. echo Other>>"%TEMP%\ct_cpuq_tmp.txt"
  67. echo 1. This Agreement is governed by the substantive and procedural laws of the State of California, USA. You and Oracle agree to submit to the exclusive jurisdiction of, and venue in, the courts of San Francisco or Santa Clara counties in California in any dispute arising out of or relating to this Agreement. >>"%TEMP%\ct_cpuq_tmp.txt"
  68. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  69. echo 2. You may not assign this Agreement or give or transfer the Software or an interest in them to another individual or entity. If You grant a security interest in the Software, the secured party has no right to use or transfer the Software.>>"%TEMP%\ct_cpuq_tmp.txt"
  70. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  71. echo 3. Except for actions for breach of Oracle's proprietary rights, no action, regardless of form, arising out of or relating to this Agreement may be brought by either party more than two years after the cause of action has accrued.>>"%TEMP%\ct_cpuq_tmp.txt"
  72. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  73. echo 4. The relationship between You and Oracle is that of licensee/licensor. Nothing in this Agreement shall be construed to create a partnership, joint venture, agency, or employment relationship between the parties. The parties agree that they are acting solely as independent contractors hereunder and agree that the parties have no fiduciary duty to one another or any other special or implied duties that are not expressly stated herein. Neither party has any authority to act as agent for, or to incur any obligations on behalf of or in the name of the other. >>"%TEMP%\ct_cpuq_tmp.txt"
  74. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  75. echo 5. This Agreement may not be modified and the rights and restrictions may not be altered or waived except in a writing signed by authorized representatives of You and Oracle. >>"%TEMP%\ct_cpuq_tmp.txt"
  76. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  77. echo 6. Any notice required under this Agreement shall be provided to the other party in writing. >>"%TEMP%\ct_cpuq_tmp.txt"
  78. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  79. echo 7. In order to assist You with the measurement, monitoring or management of Your usage of the Programs, Oracle may have access to and collect Your information, which may include personal information, and data residing on Oracle, customer or third-party systems on which the Software is used and/or to which Oracle is provided access to perform any associated services. Oracle treats such information and data in accordance with the terms of the Oracle Services Privacy Policy and the Oracle Corporate Security Practices, which are available at http://www.oracle.com/contracts, and treats such data as confidential in accordance with the terms of the Oracle License Agreement applicable to the Programs. The Oracle Services Privacy Policy and the Oracle Corporate Security Practices are subject to change at Oracle's discretion; however, Oracle will not materially reduce the level of protection specified in the Oracle Services Privacy Policy or the Oracle Corporate Security Practices in effect at the time the information was collected during the period that Oracle retains such information. >>"%TEMP%\ct_cpuq_tmp.txt"
  80. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  81. echo Contact Information>>"%TEMP%\ct_cpuq_tmp.txt"
  82. echo Should You have any questions concerning Your use of the Software or this Agreement, please contact Oracle at: http://www.oracle.com/corporate/contact/>>"%TEMP%\ct_cpuq_tmp.txt"
  83. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  84. echo Oracle America, Inc.>>"%TEMP%\ct_cpuq_tmp.txt"
  85. echo 500 Oracle Parkway, >>"%TEMP%\ct_cpuq_tmp.txt"
  86. echo Redwood City, CA 94065>>"%TEMP%\ct_cpuq_tmp.txt"
  87. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  88. echo.>>"%TEMP%\ct_cpuq_tmp.txt"
  89. echo Last updated 1 November 2018>>"%TEMP%\ct_cpuq_tmp.txt"
  90. more "%TEMP%\ct_cpuq_tmp.txt"
  91. :promptloop
  92. set /p ANSWER=Accept License Agreement? (y\n\q)
  93. if "%ANSWER%" == "y" (
  94. goto main
  95. ) else if "%ANSWER%" == "n" (
  96. goto licagreement
  97. ) else if "%ANSWER%" == "q" (
  98. goto licagreement
  99. ) else (
  100. goto promptloop
  101. )
  102. :licagreement
  103. echo.
  104. echo You cannot run this program without agreeing to the license agreement.
  105. goto ct_cpu_info
  106. :main
  107. ::
  108. :: setup temp files to hold data
  109. ::
  110. rem set MACHINE_NAME=%COMPUTERNAME%
  111. rem set MACHINE_MSINFO=%1\%MACHINE_NAME%-MSinfo.txt
  112. set RETURN_FILE=%COMPUTERNAME%-ct_cpuq.txt
  113. if exist "%*" (
  114. set TEMP=%*
  115. set RETURN_FILE="%*\%COMPUTERNAME%-ct_cpuq.txt"
  116. )
  117. del "%TEMP%\ct_cpuq_tmp.txt"
  118. :: Get windows Version numbers
  119. For /f "tokens=2 delims=[]" %%G in ('ver') Do (set _version=%%G)
  120. For /f "tokens=2,3,4 delims=. " %%G in ('echo %_version%') Do (set _major=%%G& set _minor=%%H& set _build=%%I)
  121. ::
  122. :: Gather OS, CPU, IP Address and machine name information
  123. :: populate IP adresses to file
  124. ::
  125. echo Gathering machine information ....
  126. echo ct_cpuq.cmd v.19.1 > %RETURN_FILE%
  127. echo CT Version %CT_BUILD_VERSION% >> %RETURN_FILE%
  128. echo ################################ >> %RETURN_FILE%
  129. echo Script Start Date: %date% >> %RETURN_FILE%
  130. echo Script Start Time: %time% >> %RETURN_FILE%
  131. if "%_major%"=="5" (
  132. :: Since catlist only supported on < Server 2008 and Windows, don't use it on those platforms.
  133. "%ProgramFiles%\Common Files\Microsoft Shared\MSInfo\msinfo32.exe" /report "%TEMP%\ct_cpuq_tmp.txt" /categories catlist
  134. echo "%ProgramFiles%\Common Files\Microsoft Shared\MSInfo\msinfo32.exe" /report "%TEMP%\ct_cpuq_tmp.txt" /categories catlist >> %RETURN_FILE%
  135. echo ################################ >> %RETURN_FILE%
  136. type "%TEMP%\ct_cpuq_tmp.txt" >> %RETURN_FILE%
  137. %SystemRoot%\regedit /E "%TEMP%\ct_cpuq_tmp.txt" "HKEY_LOCAL_MACHINE\Hardware\Description\System\CentralProcessor"
  138. echo ################################ >> %RETURN_FILE%
  139. echo regedit /E "%TEMP%\ct_cpuq_tmp.txt" "HKEY_LOCAL_MACHINE\Hardware\Description\System\CentralProcessor" >> %RETURN_FILE%
  140. ) else (
  141. echo "msinfo32.exe catlist option not run on Windows 2008, Windows Vista or greater." >> %RETURN_FILE%
  142. echo ################################ >> %RETURN_FILE%
  143. %SystemRoot%\System32\reg export HKLM\Hardware\Description\System\CentralProcessor "%TEMP%\ct_cpuq_tmp.txt"
  144. echo ################################ >> %RETURN_FILE%
  145. echo reg export HKLM\Hardware\Description\System\CentralProcessor "%TEMP%\ct_cpuq_tmp.txt" >> %RETURN_FILE%
  146. )
  147. echo ################################ >> %RETURN_FILE%
  148. type "%TEMP%\ct_cpuq_tmp.txt" >> %RETURN_FILE%
  149. echo ################################ >> %RETURN_FILE%
  150. :: Preparing VB Script file
  151. :: Escaping with ^ all command characters & < > | ON OFF
  152. echo.' Set output file > "%TEMP%\ct_cpuq_tmp.vbs"
  153. echo.On Error Resume Next >> "%TEMP%\ct_cpuq_tmp.vbs"
  154. echo.Set objFSO = CreateObject("Scripting.FileSystemObject") >> "%TEMP%\ct_cpuq_tmp.vbs"
  155. echo.Set objTextFile = objFSO.CreateTextFile("%TEMP%\ct_cpuq_tmp.txt") >> "%TEMP%\ct_cpuq_tmp.vbs"
  156. echo. >> "%TEMP%\ct_cpuq_tmp.vbs"
  157. echo.' Connect to Local Machine and get data. >> "%TEMP%\ct_cpuq_tmp.vbs"
  158. echo.' If cannot connect to Local Machine print message. >> "%TEMP%\ct_cpuq_tmp.vbs"
  159. echo.strComputer = "." >> "%TEMP%\ct_cpuq_tmp.vbs"
  160. echo.Set objWMIService = GetObject("winmgmts:" _ >> "%TEMP%\ct_cpuq_tmp.vbs"
  161. echo. ^& "{impersonationLevel=impersonate}!\\" ^& strComputer ^& "\root\cimv2") >> "%TEMP%\ct_cpuq_tmp.vbs"
  162. echo.If objWMIService Is Nothing Then >> "%TEMP%\ct_cpuq_tmp.vbs"
  163. echo. objTextFile.WriteLine("Unable to bind to WMI!") >> "%TEMP%\ct_cpuq_tmp.vbs"
  164. echo.Else >> "%TEMP%\ct_cpuq_tmp.vbs"
  165. echo. ' Get Operating System information >> "%TEMP%\ct_cpuq_tmp.vbs"
  166. echo. Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem") >> "%TEMP%\ct_cpuq_tmp.vbs"
  167. echo. For Each objOS in colOSes >> "%TEMP%\ct_cpuq_tmp.vbs"
  168. echo. objTextFile.WriteLine("Operating System") >> "%TEMP%\ct_cpuq_tmp.vbs"
  169. echo. objTextFile.WriteLine(" Caption: " ^& objOS.Caption) >> "%TEMP%\ct_cpuq_tmp.vbs"
  170. echo. objTextFile.WriteLine(" Version: " ^& objOS.Version) >> "%TEMP%\ct_cpuq_tmp.vbs"
  171. echo. objTextFile.WriteLine("Computer Name: " ^& objOS.CSName) >> "%TEMP%\ct_cpuq_tmp.vbs"
  172. echo. Next >> "%TEMP%\ct_cpuq_tmp.vbs"
  173. echo. >> "%TEMP%\ct_cpuq_tmp.vbs"
  174. echo. ' Get DNS Domain >> "%TEMP%\ct_cpuq_tmp.vbs"
  175. echo. Set colDNSs = objWMIService.ExecQuery ("Select DNSDomain from Win32_NetworkAdapterConfiguration WHERE IPEnabled=True") >> "%TEMP%\ct_cpuq_tmp.vbs"
  176. echo. For Each objDNS in colDNSs >> "%TEMP%\ct_cpuq_tmp.vbs"
  177. echo. If Not IsNull(objDNS.DNSDomain) Then >> "%TEMP%\ct_cpuq_tmp.vbs"
  178. echo. objTextFile.WriteLine("DNS Domain: " ^& objDNS.DNSDomain) >> "%TEMP%\ct_cpuq_tmp.vbs"
  179. echo. End If >> "%TEMP%\ct_cpuq_tmp.vbs"
  180. echo. Next >> "%TEMP%\ct_cpuq_tmp.vbs"
  181. echo. >> "%TEMP%\ct_cpuq_tmp.vbs"
  182. echo. objTextFile.WriteLine("System") >> "%TEMP%\ct_cpuq_tmp.vbs"
  183. echo. >> "%TEMP%\ct_cpuq_tmp.vbs"
  184. echo. ' Get UUID >> "%TEMP%\ct_cpuq_tmp.vbs"
  185. echo. Set colUUID = objWMIService.ExecQuery("select uuid from Win32_ComputerSystemProduct") >> "%TEMP%\ct_cpuq_tmp.vbs"
  186. echo. For Each objUUID in colUUID >> "%TEMP%\ct_cpuq_tmp.vbs"
  187. echo. If Not IsNull(objUUID.UUID) Then >> "%TEMP%\ct_cpuq_tmp.vbs"
  188. echo. objTextFile.WriteLine("UUID=" ^& objUUID.UUID) >> "%TEMP%\ct_cpuq_tmp.vbs"
  189. echo. End If >> "%TEMP%\ct_cpuq_tmp.vbs"
  190. echo. Next >> "%TEMP%\ct_cpuq_tmp.vbs"
  191. echo. >> "%TEMP%\ct_cpuq_tmp.vbs"
  192. echo. ' Get System Machine information. >> "%TEMP%\ct_cpuq_tmp.vbs"
  193. echo. ' Check if script is running on a virtual machine >> "%TEMP%\ct_cpuq_tmp.vbs"
  194. echo. Set colCompSys = objWMIService.ExecQuery("Select * from Win32_ComputerSystem") >> "%TEMP%\ct_cpuq_tmp.vbs"
  195. echo. For Each objCS in colCompSys >> "%TEMP%\ct_cpuq_tmp.vbs"
  196. echo. If InStr(objCS.Manufacturer, "VMware") ^> 0 Then >> "%TEMP%\ct_cpuq_tmp.vbs"
  197. echo. objTextFile.WriteLine(" VIRTUAL MACHINE RUNNING: " ^& objCS.Manufacturer) >> "%TEMP%\ct_cpuq_tmp.vbs"
  198. echo. isVirtualMachine = True >> "%TEMP%\ct_cpuq_tmp.vbs"
  199. echo. ElseIf InStr(objCS.Manufacturer, "Xen") ^> 0 Then >> "%TEMP%\ct_cpuq_tmp.vbs"
  200. echo. objTextFile.WriteLine(" VIRTUAL MACHINE RUNNING: " ^& objCS.Manufacturer) >> "%TEMP%\ct_cpuq_tmp.vbs"
  201. echo. isVirtualMachine = True >> "%TEMP%\ct_cpuq_tmp.vbs"
  202. echo. ElseIf InStr(objCS.Manufacturer, "Red Hat") ^> 0 Then >> "%TEMP%\ct_cpuq_tmp.vbs"
  203. echo. objTextFile.WriteLine(" VIRTUAL MACHINE RUNNING: " ^& objCS.Manufacturer) >> "%TEMP%\ct_cpuq_tmp.vbs"
  204. echo. isVirtualMachine = True >> "%TEMP%\ct_cpuq_tmp.vbs"
  205. echo. ElseIf InStr(objCS.Manufacturer, "Microsoft Corporation") ^> 0 Then >> "%TEMP%\ct_cpuq_tmp.vbs"
  206. echo. objTextFile.WriteLine(" VIRTUAL MACHINE RUNNING: " ^& objCS.Manufacturer) >> "%TEMP%\ct_cpuq_tmp.vbs"
  207. echo. objTextFile.WriteLine(" If this is a Hyper-V Virtualized environment " ) >> "%TEMP%\ct_cpuq_tmp.vbs"
  208. echo. objTextFile.WriteLine(" please run ct_cpuq.cmd in the Root Partition" ) >> "%TEMP%\ct_cpuq_tmp.vbs"
  209. echo. isVirtualMachine = True >> "%TEMP%\ct_cpuq_tmp.vbs"
  210. echo. ElseIf InStr(objCS.Model, "VirtualBox") ^> 0 Then >> "%TEMP%\ct_cpuq_tmp.vbs"
  211. echo. objTextFile.WriteLine(" VIRTUAL MACHINE RUNNING: " ^& objCS.Model) >> "%TEMP%\ct_cpuq_tmp.vbs"
  212. echo. isVirtualMachine = True >> "%TEMP%\ct_cpuq_tmp.vbs"
  213. echo. End If >> "%TEMP%\ct_cpuq_tmp.vbs"
  214. echo. If isVirtualMachine = True Then >> "%TEMP%\ct_cpuq_tmp.vbs"
  215. echo. Wscript.StdOut.WriteBlankLines(1) >> "%TEMP%\ct_cpuq_tmp.vbs"
  216. echo. Wscript.StdOut.WriteLine "** NOTICE: VIRTUAL MACHINE RUNNING: " ^& objCS.Manufacturer ^& " " ^& objCS.Model >> "%TEMP%\ct_cpuq_tmp.vbs"
  217. echo. Wscript.StdOut.WriteLine "** Please provide Oracle with information about the hardware configuration " >> "%TEMP%\ct_cpuq_tmp.vbs"
  218. echo. Wscript.StdOut.WriteLine "** of the physical server which is hosting this Virtual Machine " >> "%TEMP%\ct_cpuq_tmp.vbs"
  219. echo. Wscript.StdOut.WriteLine "** If applicable, please run the script on the host operating system " >> "%TEMP%\ct_cpuq_tmp.vbs"
  220. echo. Wscript.StdOut.WriteLine "** Thank You." >> "%TEMP%\ct_cpuq_tmp.vbs"
  221. echo. objTextFile.WriteLine("CPUQ: CT-01104: WARNING: " ^& objCS.Manufacturer ^& " " ^& objCS.Model ^& " virtual machine, processor information is also needed for the physical machine") >> "%TEMP%\ct_cpuq_tmp.vbs"
  222. echo. Wscript.StdOut.WriteBlankLines(1) >> "%TEMP%\ct_cpuq_tmp.vbs"
  223. echo. If InStr(objCS.Manufacturer, "Microsoft Corporation") ^> 0 Then >> "%TEMP%\ct_cpuq_tmp.vbs"
  224. echo. Wscript.StdOut.WriteLine " If this is a Hyper-V Virtualized environment " >> "%TEMP%\ct_cpuq_tmp.vbs"
  225. echo. Wscript.StdOut.WriteLine " please run ct_cpuq.cmd in the Root Partition" >> "%TEMP%\ct_cpuq_tmp.vbs"
  226. echo. End If >> "%TEMP%\ct_cpuq_tmp.vbs"
  227. echo. End If >> "%TEMP%\ct_cpuq_tmp.vbs"
  228. echo. objTextFile.WriteLine(" Manufacturer: " ^& objCS.Manufacturer) >> "%TEMP%\ct_cpuq_tmp.vbs"
  229. echo. objTextFile.WriteLine(" Model: " ^& objCS.Model) >> "%TEMP%\ct_cpuq_tmp.vbs"
  230. echo. objTextFile.WriteLine(" NumberOfProcessors: " ^& objCS.NumberOfProcessors) >> "%TEMP%\ct_cpuq_tmp.vbs"
  231. echo. Next >> "%TEMP%\ct_cpuq_tmp.vbs"
  232. echo. >> "%TEMP%\ct_cpuq_tmp.vbs"
  233. echo. objTextFile.WriteLine("Processors") >> "%TEMP%\ct_cpuq_tmp.vbs"
  234. echo. >> "%TEMP%\ct_cpuq_tmp.vbs"
  235. echo. ' Get CPU information >> "%TEMP%\ct_cpuq_tmp.vbs"
  236. echo. Set colProcessors = objWMIService.ExecQuery("Select * from Win32_Processor") >> "%TEMP%\ct_cpuq_tmp.vbs"
  237. echo. For Each objProcessor in colProcessors >> "%TEMP%\ct_cpuq_tmp.vbs"
  238. echo. objTextFile.WriteLine(" CPU Name: " ^& objProcessor.Name) >> "%TEMP%\ct_cpuq_tmp.vbs"
  239. echo. objTextFile.WriteLine(" CPU Description: " ^& objProcessor.Description) >> "%TEMP%\ct_cpuq_tmp.vbs"
  240. echo. objTextFile.WriteLine(" CPU MaximumClockSpeed [MHz]: " ^& objProcessor.MaxClockSpeed) >> "%TEMP%\ct_cpuq_tmp.vbs"
  241. echo. objTextFile.WriteLine(" CPU NumberOfCores: " ^& objProcessor.NumberOfCores) >> "%TEMP%\ct_cpuq_tmp.vbs"
  242. echo. objTextFile.WriteLine(" CPU NumberOfLogicalProcessors: " ^& objProcessor.NumberOfLogicalProcessors) >> "%TEMP%\ct_cpuq_tmp.vbs"
  243. echo. Next >> "%TEMP%\ct_cpuq_tmp.vbs"
  244. echo. >> "%TEMP%\ct_cpuq_tmp.vbs"
  245. echo. ' NumberOfCores and NumberOfLogicalProcessors are only supported in the latest WMI version (available as a hotfix) >> "%TEMP%\ct_cpuq_tmp.vbs"
  246. echo. If Err.Number = 438 Then >> "%TEMP%\ct_cpuq_tmp.vbs"
  247. echo. objTextFile.WriteLine(" CPU NumberOfCores: PATCH NOT AVAILABLE (Error Number: " ^& Err.Number ^& "; Error Description: " ^& Err.Description ^& ")") >> "%TEMP%\ct_cpuq_tmp.vbs"
  248. echo. objTextFile.WriteLine(" CPU NumberOfLogicalProcessors: PATCH NOT AVAILABLE (Error Number: " ^& Err.Number ^& "; Error Description: " ^& Err.Description ^& ")") >> "%TEMP%\ct_cpuq_tmp.vbs"
  249. echo. End If >> "%TEMP%\ct_cpuq_tmp.vbs"
  250. echo. >> "%TEMP%\ct_cpuq_tmp.vbs"
  251. echo. objTextFile.WriteLine("IP Address") >> "%TEMP%\ct_cpuq_tmp.vbs"
  252. echo. >> "%TEMP%\ct_cpuq_tmp.vbs"
  253. echo. ' Get IP Address(es) >> "%TEMP%\ct_cpuq_tmp.vbs"
  254. echo. Set IPConfigSet = objWMIService.ExecQuery ("Select IPAddress from Win32_NetworkAdapterConfiguration WHERE IPEnabled=True") >> "%TEMP%\ct_cpuq_tmp.vbs"
  255. echo. For Each IPConfig in IPConfigSet >> "%TEMP%\ct_cpuq_tmp.vbs"
  256. echo. If Not IsNull(IPConfig.IPAddress) Then >> "%TEMP%\ct_cpuq_tmp.vbs"
  257. echo. For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress) >> "%TEMP%\ct_cpuq_tmp.vbs"
  258. echo. If IPConfig.IPAddress(i) ^<^> "0.0.0.0" Then objTextFile.WriteLine(" IP Address: " ^& IPConfig.IPAddress(i)) >> "%TEMP%\ct_cpuq_tmp.vbs"
  259. echo. Next >> "%TEMP%\ct_cpuq_tmp.vbs"
  260. echo. End If >> "%TEMP%\ct_cpuq_tmp.vbs"
  261. echo. Next >> "%TEMP%\ct_cpuq_tmp.vbs"
  262. echo.End if >> "%TEMP%\ct_cpuq_tmp.vbs"
  263. echo Preparing to run VB Script file "%TEMP%\ct_cpuq_tmp.vbs": >> %RETURN_FILE%
  264. echo to query Windows Management Instrumentation (WMI) >> %RETURN_FILE%
  265. echo ################################ >> %RETURN_FILE%
  266. type "%TEMP%\ct_cpuq_tmp.vbs" >> %RETURN_FILE%
  267. echo ################################ >> %RETURN_FILE%
  268. %SystemRoot%\System32\cscript.exe "%TEMP%\ct_cpuq_tmp.vbs" 2> "%TEMP%\cpu_info.err"
  269. echo %SystemRoot%\System32\cscript.exe "%TEMP%\ct_cpuq_tmp.vbs" 2^> "%TEMP%\cpu_info.err" >> %RETURN_FILE%
  270. echo ################################ >> %RETURN_FILE%
  271. type "%TEMP%\ct_cpuq_tmp.txt" >> %RETURN_FILE%
  272. type "%TEMP%\cpu_info.err" >> %RETURN_FILE%
  273. del "%TEMP%\ct_cpuq_tmp.txt"
  274. del "%TEMP%\cpu_info.err"
  275. del "%TEMP%\ct_cpuq_tmp.vbs"
  276. echo Script End Time: %time% >> %RETURN_FILE%
  277. echo ################################ >> %RETURN_FILE%
  278. if not exist "%*" (
  279. echo Done.
  280. echo Please collect the output file: %RETURN_FILE%
  281. )
  282. goto ct_cpu_info
  283. :ct_cpu_info
  284. endlocal
  285. echo.
  286. :EOF