Jump to content

Trong

Active Members
  • Posts

    1,102
  • Joined

  • Days Won

    2

Trong last won the day on August 20 2017

Trong had the most liked content!

About Trong

  • Birthday October 15

Profile Information

  • Member Title
    Newbie
  • Location
    Vietnam
  • WWW
    https://www.trong.pro/
  • Interests
    Lovely Girls

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Trong's Achievements

  1. Overview of Functionality The primary exported function is ImageSearch. This versatile function scans a designated area of the screen (or the entire screen) to locate one or more specified images. It's designed to be robust, offering options for approximate matching and handling variations in image appearance. Key Features: Multiple Image Search: Allows searching for several images in a single call by providing a | (pipe) separated list of file paths. Region-Specific Search: Users can define a specific rectangular area on the screen (iLeft, iTop, iRight, iBottom) to narrow down the search, improving performance. If iRight or iBottom are not set, the full screen dimensions are used. Color Tolerance: Supports inexact matching through a iTolerance parameter (0 for an exact match, up to 255 for maximum tolerance). This helps find images even if their colors are slightly different. Multi-Result: Can find and return multiple occurrences of the image(s) if iMultiResults is set to a value greater than 0. Coordinate Customization: Can return either the top-left coordinates or the center coordinates of the found image(s) via the iCenterPOS flag. Debugging Information: Optional debug information can be appended to the result string for troubleshooting. 🌟 Advanced Search Capabilities Two particularly powerful features of the ImageSearch function are its ability to find scaled images and to handle transparency: Scaled Image Search The function can search for images even if they appear on the screen at a different size than the source image file. This is controlled by three parameters: fMinScale: The minimum scaling factor to test (e.g., 0.5 for 50% of original size). fMaxScale: The maximum scaling factor (e.g., 1.5 for 150% of original size). fScaleStep: The increment used to iterate through scales between fMinScale and fMaxScale. The DLL will systematically resize the search image according to these parameters and attempt to find a match. If a scaled version is found, the fScaleSuccess value in the debug information will indicate the scale at which the match occurred. Transparent Background Search The iTransparent parameter allows specifying a color (in COLORREF format) that should be treated as transparent during the search. Any pixels in the source image that match this transparent color will be ignored when comparing against the screen. This is invaluable for finding irregularly shaped images or icons that are displayed over varying backgrounds. The default value CLR_NONE (0xFFFFFFFF) indicates no transparency. Input Arguments for ImageSearchDll The ImageSearch function accepts the following parameters: sImageFile (char*) A string containing one or more image file paths, separated by |. iLeft (int, optional): The left coordinate of the search area. Defaults to 0. iTop (int, optional): The top coordinate of the search area. Defaults to 0. iRight (int, optional): The right coordinate of the search area. Defaults to the screen width if 0 or less than iLeft. iBottom (int, optional): The bottom coordinate of the search area. Defaults to the screen height if 0 or less than iTop. iTolerance (int, optional): Color variation tolerance from 0 (exact) to 255. Defaults to 0. iTransparent (int, optional): The color to be treated as transparent. Defaults to CLR_NONE = -1. iMultiResults (int, optional): Set to 0 to find only the first match, or a higher number to find up to that many matches. Defaults to 0. iCenterPOS (int, optional): If 1, results are center coordinates; otherwise, top-left. Defaults to 1. iReturnDebug (int, optional): If non-zero, appends debug information to the result string. Defaults to 0. fMinScale (float, optional): Minimum scaling factor for the image (0.1 to 1.0). Defaults to 1.0f. fMaxScale (float, optional): Maximum scaling factor (1.0 to 3.0). Defaults to 1.0f. fScaleStep (float, optional): Step to increment scale between min and max. Defaults to 0.1f. Return Format The function returns a char* (C-string) with the results formatted as follows: Match Found: "{<match_count>}[<match_result(s)>]" Example for one match: "{1}[x|y|w|h]" Example for multiple matches: "{2}[x1|y1|w1|h1,x2|y2|w2|h2]" (results are comma-separated) x, y are the coordinates of the found image (top-left or center based on iCenterPOS). w, h are the width and height of the image as found on screen (which might be scaled). No Match Found: "0[]" Error Occurred: "{<negative_error_code>}[<error_message>]" Example: "{E<-2>}[Failed to load image]" (Error codes are defined in GetErrorMessage) If iReturnDebug is enabled, additional debug information is appended in parentheses, detailing the parameters used for the search and the success scale factor, e.g., (...debug_info...). For errors, fScaleSuccess is reported as 0.00 in the debug info. ImageSearchUDF supports Windows XP! Download Autoit ImageSearchUDF here:
  2. The article is a bit long, I will add more example code below when finished!
  3. Using BarCodeGenerator.dll in AutoIt: A Comprehensive Guide This guide introduces you to the BarCodeGenerator.dll—a dynamic link library designed for generating various types of barcodes and QR codes. You will learn about the structure of its exported functions, the necessary parameters, and how you can integrate and call these functions from an AutoIt script. The article also includes example code to illustrate both the in-memory image handling (using GDIPlus) as well as file-based output. 1. Exported Functions Overview The DLL exports two primary functions: a) CreateBarcode Purpose: Generates a barcode or QR code based on the provided text and other configuration parameters. Depending on the parameters, the function either returns an HBITMAP (when no file path is provided and when the output format is an image such as PNG, BMP, JPG, or TGA) or returns a text result with configuration details (for console output, SVG, or when output is generated to a file). Exported Signature (C/C++ Prototype): DLL_API void* __stdcall CreateBarcode( const wchar_t* textContent, const wchar_t* outputType, const wchar_t* eccStr, const wchar_t* qrColorHex, const wchar_t* bgColorHex, const wchar_t* outputFormat, const wchar_t* filePath, int sizeParam, int scale, int borderModules ); Parameters: textContent: The string content that you want to encode. For example, "Hello World". outputType: A string that defines the type of barcode/QR code. Accepted values include "qr", "code128", "code39", and "ean128". eccStr: Specifies the error correction level (primarily used for QR codes). Example values are "low", "medium", "quartile", and "high". qrColorHex and bgColorHex: These parameters represent the barcode (foreground) and background colors in hexadecimal notation. For example, passing "000000" for black and an empty string for the default background. outputFormat: Sets the desired output format. Valid options include "bmp", "png", "jpg", "jpeg", "tga", "svg", and "console". filePath: When provided with a valid path, the DLL saves the generated file to disk. If this parameter is an empty string, the function instead returns an HBITMAP (if the output is an image) that can be handled via GDIPlus in AutoIt. sizeParam: Indicates the desired overall size for the generated image. scale: The scale factor. If set to 0 (or less), the scale is determined automatically based on size and border parameters. borderModules: Determines the number of border modules (padding) around the generated symbol. Return Value: The function returns a pointer to a structure—BarcodeResult. This structure contains: A fixed-length wide-character array (wchar_t info[4096]) that includes the configuration details along with the generation result. A pointer (hBitmap) that will hold a valid HBITMAP if the output is generated in memory (i.e., when no file path is provided). b) GetBarcodeInfo Purpose: This function returns static information about the DLL, including version and author details. Exported Signature (C/C++ Prototype): DLL_API wchar_t* __stdcall GetBarcodeInfo(); Return Value: A pointer to a wide-character string containing DLL information (for example, version, author, etc.). 2. Structure Definition in the Header File For smooth integration with AutoIt, the DLL uses a predefined structure for the return value of CreateBarcode. Below is an example of the header file content (named BarCodeGenerator.h😞 #ifndef BARCODEGENERATOR_H #define BARCODEGENERATOR_H #ifdef _WIN32 #ifdef DLL_EXPORTS #define DLL_API __declspec(dllexport) #else #define DLL_API __declspec(dllimport) #endif #else #define DLL_API #endif // Define the size of the buffer to store info details. #define INFO_BUFFER_SIZE 4096 #ifdef __cplusplus extern "C" { #endif // Structure returned from CreateBarcode typedef struct _BarcodeResult { wchar_t info[INFO_BUFFER_SIZE]; #ifdef _WIN32 void* hBitmap; // HBITMAP handle on Windows platforms #else void* hBitmap; #endif } BarcodeResult; // Exported function to create a barcode/QR code. DLL_API void* __stdcall CreateBarcode( const wchar_t* textContent, const wchar_t* outputType, const wchar_t* eccStr, const wchar_t* qrColorHex, const wchar_t* bgColorHex, const wchar_t* outputFormat, const wchar_t* filePath, int sizeParam, int scale, int borderModules ); // Exported function to get general renderer information. DLL_API wchar_t* __stdcall GetBarcodeInfo(); #ifdef __cplusplus } #endif #endif // BARCODEGENERATOR_H This header file clearly defines the exported functions and makes it easier to write AutoIt scripts to call these functions via the DllCall mechanism. 3. Using the DLL in AutoIt When integrating this DLL in AutoIt, you must create a structure that matches BarcodeResult. Typically, you'll use DllStructCreate() with a format string such as "wchar[4096];ptr hBitmap". Example AutoIt Workflow: Call CreateBarcode to generate a QR code in memory. Pass an empty string as the filePath parameter so that the DLL returns an HBITMAP for in-memory processing. Use GDIPlus (via the GDIPlus UDF) to convert the HBITMAP to a PNG image and save it to disk. Call CreateBarcode to output directly to a file. Provide a valid filePath (e.g., "C:\Temp\qr_output.png") so that the DLL writes the file to the disk and also returns a text report with the configuration and operation details. Call GetBarcodeInfo to retrieve additional information about the DLL. Below is a sample AutoIt code snippet that demonstrates how to call these functions: #RequireAdmin ;~ #Region ;**** Directives created by AutoIt3Wrapper_GUI **** ;~ #AutoIt3Wrapper_UseX64=y ;~ #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;~ #pragma compile(x64, true) ; For test FileDelete(@ScriptDir & "\output_qr.png") FileDelete(@ScriptDir & "\output_code128.png") ; Path to the DLL (adjust according to the actual location of the DLL on your system) Global Const $g_sDllPath = @AutoItX64 ? @ScriptDir & "\BarCodeGenerator_x64.dll" : @ScriptDir & "\BarCodeGenerator_x86.dll" ; Path to the DLL (update to the correct path) #include <GDIPlus.au3> ; Define the BarcodeResult structure as follows: ; - wchar[4096]: a text string containing configuration and result information (fixed at 4096 characters) ; - ptr hBitmap: the hBitmap pointer returned when using in-memory image output Local $tBarcodeResultDef = "wchar[4096];ptr hBitmap" ConsoleWrite("; EG 1 -----------------------------" & @CRLF) ; ----------------------------- ; PART 1: Call CreateBarcode to generate a QR code in-memory ; (Since FilePath is "" the function returns an HBITMAP, and the PNG image will be saved using _GDIPlus) Local $aRet = DllCall($g_sDllPath, "ptr", "CreateBarcode", _ "wstr", "Hello World", _ ; textContent "wstr", "qr", _ ; outputType "wstr", "medium", _ ; eccStr "wstr", "000000", _ ; qrColorHex "wstr", "", _ ; bgColorHex (empty means default) "wstr", "png", _ ; outputFormat "wstr", "", _ ; filePath = empty => create image in memory "int", 128, _ ; sizeParam "int", 0, _ ; scale "int", 1) ; borderModules If Not IsArray($aRet) Then ConsoleWrite("CreateBarcode call failed." & @CRLF) Else ; $aRet[0] is the pointer to the BarcodeResult structure. Local $pResult = $aRet[0] ; Map the returned pointer to the BarcodeResult structure. Local $sBarcodeResult = DllStructCreate($tBarcodeResultDef, $pResult) ; Retrieve the configuration and status message string. Local $sInfo = DllStructGetData($sBarcodeResult, 1) ConsoleWrite("In-memory QR generation result info:" & @CRLF & $sInfo & @CRLF) ; Get the HBITMAP Local $hBmp = DllStructGetData($sBarcodeResult, 2) If @error Then ConsoleWrite("! Error in DllStructGetData, Code: " & @error & @CRLF) EndIf ; Use _GDIPlus to save this HBITMAP to a PNG file. _GDIPlus_Startup() ; Convert HBITMAP to a GDI+ Bitmap object Local $hBmpGp = _GDIPlus_BitmapCreateFromHBITMAP($hBmp) If $hBmpGp = 0 Then ConsoleWrite("Failed to convert HBITMAP to GDI+ Bitmap." & @CRLF) Else ; Save the image to a file If _GDIPlus_ImageSaveToFile($hBmpGp, @ScriptDir & "\output_qr.png") Then ConsoleWrite("Saved in-memory QR code to file " & @ScriptDir & "\output_qr.png" & @CRLF) If FileExists(@ScriptDir & "\output_qr.png") Then ShellExecute(@ScriptDir & "\output_qr.png"); show qr Else ConsoleWrite("! Failed to save the image to file." & @CRLF) EndIf _GDIPlus_ImageDispose($hBmpGp) EndIf _GDIPlus_Shutdown() EndIf ConsoleWrite("; EG 2 -----------------------------" & @CRLF) ; ----------------------------- ; PART 2: Call CreateBarcode to output the result directly to a file. ; Here, since filePath is provided, the DLL will write the file to disk. Local $aRet2 = DllCall($g_sDllPath, "ptr", "CreateBarcode", _ "wstr", "Hello World", _ "wstr", "code128", _ "wstr", "medium", _ "wstr", "000000", _ "wstr", "", _ "wstr", "png", _ "wstr", @ScriptDir & "\output_code128.png", _ ; Direct output to file "int", 128, _ "int", 0, _ "int", 4) If Not IsArray($aRet2) Then ConsoleWrite("! File output CreateBarcode call failed." & @CRLF) Else Local $pResult2 = $aRet2[0] Local $sBarcodeResult2 = DllStructCreate($tBarcodeResultDef, $pResult2) Local $sInfo2 = DllStructGetData($sBarcodeResult2, 1) If FileExists(@ScriptDir & "\output_code128.png") Then ShellExecute(@ScriptDir & "\output_code128.png") ; show bar code 128 ConsoleWrite("File output QR generation result info:" & @CRLF & $sInfo2 & @CRLF) EndIf ConsoleWrite("; Test 3 -----------------------------" & @CRLF) ; ----------------------------- ; PART 3: Call GetBarcodeInfo to retrieve additional information about the author, version, etc. Local $aRet3 = DllCall($g_sDllPath, "wstr", "GetBarcodeInfo") If Not IsArray($aRet3) Then ConsoleWrite("! GetBarcodeInfo call failed." & @CRLF) Else MsgBox(64 + 262144, "About ", $aRet3[0] & @CRLF) ;MsgBox(64 + 262144, "GetBarcodeInfo: ", CorrectFromCP1252ToUTF8($aRet3[0]) & @CRLF) EndIf ; Function to convert strings misinterpreted as CP1252 to proper UTF-8 Func CorrectFromCP1252ToUTF8($sMisinterpreted) ; Convert the string (encoded as CP1252) to binary. Local $aBinary = StringToBinary($sMisinterpreted, 0) ; Create an ADODB.Stream object to perform encoding conversion. Local $oStream = ObjCreate("ADODB.Stream") If Not IsObj($oStream) Then MsgBox(16, "Error", "Unable to create ADODB.Stream object.") Return $sMisinterpreted EndIf ; Write the binary data to the stream. $oStream.Type = 1 ; 1: Binary $oStream.Open $oStream.Write($aBinary) ; Reset stream position and switch to text mode. $oStream.Position = 0 $oStream.Type = 2 ; 2: Text $oStream.Charset = "utf-8" ; Read data as UTF-8. Local $sCorrect = $oStream.ReadText() $oStream.Close() Return $sCorrect EndFunc ;==>CorrectFromCP1252ToUTF8 Explanation of the AutoIt Code: Structure Initialization: The structure for the result (BarcodeResult) is defined in AutoIt using DllStructCreate with "wchar[4096];ptr hBitmap". This matches the DLL’s definition. Function Calls: For the first call to CreateBarcode, an empty filePath tells the DLL to generate the image in memory. The returned HBITMAP is then processed via _GDIPlus for conversion and saving. For the second call, a valid file path is provided so the DLL writes the image file directly to disk while also returning a text-based log of the configuration and status. Finally, the static information is retrieved using GetBarcodeInfo. Output Display: Instead of using message boxes, all feedback and information are displayed using ConsoleWrite(). 4. Conclusion In this guide, we have covered the following: The structure and purpose of the exported functions from BarCodeGenerator.dll. Detailed descriptions of all necessary parameters—including text content, barcode/QR type, error correction level, colors, output format, and file handling. How to set up and call these functions from an AutoIt script using the DLL call mechanism. An example AutoIt code that demonstrates both in-memory image retrieval (with _GDIPlus) and direct file output, and how to retrieve additional DLL information. By following this guide, you should be able to effectively integrate the barcode generation capabilities of the DLL into your AutoIt projects and further customize the functionality to suit your requirements. Happy coding! _________________________________________ For Vietnamese: >> Link Download Dll/Exe (Because it contains exe cli file so to avoid warning when downloading I set password as number 1) Limitation: due to using c++17, it will not support running on windows XP ________________________________________________________ QR Code generator library (c) Nayuki
  4. It works fine on my computer, make sure that window and tab are active, if you open multiple tabs on the browser it will only report for the current active tab
  5. I have written a function to run the ps command and get the result back, but the semicolon problem has been driving me crazy, as the command sent to ps quotes seems to have problems and cannot run the command correctly! no matter I try to add 2 double quotes or use single quotes, it still does not work properly. ; *** Add a program to Windows Defender Exclusions using PowerShell *** #RequireAdmin #include <AutoItConstants.au3> ; *** Example Usage *** ; Get the list of running processes and filter for processes named "notepad" Local $commandToRun = "Get-Process | Where-Object {$_.ProcessName -eq 'notepad'} | Format-List Name, Id, MainWindowTitle" Local $powerShellResult = RunPowerShellCommand($commandToRun) If @error Then MsgBox(16, "Error", "Could not get results from PowerShell.") Else If $powerShellResult Then MsgBox(64, "PowerShell Result", "Result returned from PowerShell: " & $powerShellResult) Else MsgBox(64, "Information", "No processes match the criteria.") EndIf EndIf ; Another example: Get the PowerShell version Local $versionCommand = "$PSVersionTable.PSVersion" Local $powerShellVersion = RunPowerShellCommand($versionCommand) If Not @error Then MsgBox(64, "PowerShell Version", "PowerShell Version: " & $powerShellVersion) EndIf ;~ ; *** Example Usage *** ; **Change the program path and rule name according to your needs** Local $programToExclude = @Compiled ? @ScriptFullPath : @AutoItExe Local $firewallRuleName = "AutoIt3" ; Add to Windows Defender Exclusions using PowerShell If AddToDefenderExclusions_PS($programToExclude) Then MsgBox(64, "Success", "Successfully added '" & $programToExclude & "' to Windows Defender Exclusions (PowerShell).") Else MsgBox(16, "Failure", "Failed to add '" & $programToExclude & "' to Windows Defender Exclusions (PowerShell). Please check the path or run the script with administrator privileges.") EndIf ; Add to Windows Firewall Exclusions using PowerShell If AddToFirewallExclusions_PS($programToExclude, $firewallRuleName) Then MsgBox(64, "Success", "Successfully added Firewall rule for '" & $programToExclude & "' (PowerShell).") Else MsgBox(16, "Failure", "Failed to add Firewall rule for '" & $programToExclude & "' (PowerShell). Please check the path or run the script with administrator privileges.") EndIf Func RunPowerShellCommand($powerShellCommand) Local $output = "" Local $error = "" Local $command_r = "PowerShell -Command '" & '"' & $powerShellCommand & '"' & "'" ConsoleWrite('-> ' & $command_r & @CRLF) Local $pid = Run(@ComSpec & ' /c ' & $command_r, "", @SW_HIDE, $STDOUT_CHILD + $STDERR_CHILD) If Not $pid Then MsgBox(16, "Error", "Could not run PowerShell.") Return SetError(-1, 0, False) EndIf While 1 $line = StdoutRead($pid) If @error Then ExitLoop $output &= $line & @CRLF WEnd While 1 $line = StderrRead($pid) If @error Then ExitLoop $error &= $line & @CRLF WEnd ProcessClose($pid) $error = StringStripWS($error, 7) $output = StringStripWS($output, 7) If StringLen(StringStripWS($error, 8)) > 0 Then ConsoleWrite($output & @CRLF & $error & @CRLF) MsgBox(16, "PowerShell Error", "Error returned from PowerShell: " & $error) Return SetError(1, 0, $error) Else ConsoleWrite($output & @CRLF) Return SetError(0, 0, $output) EndIf EndFunc ;==>RunPowerShellCommand Func AddToDefenderExclusions_PS($programPath) Local $command = 'Add-MpPreference -ExclusionPath "' & $programPath & '"' Local $result = RunPowerShellCommand($command) If @error Then MsgBox(16, "Defender Error", "Error running PowerShell command to add to Defender Exclusion." & @CRLF & "" & $result & "") Return False Else If StringLen($result) > 0 Then MsgBox(16, "Defender return", "" & $result & "") Return True Else Return False EndIf EndIf EndFunc ;==>AddToDefenderExclusions_PS ; *** Add a program to Windows Firewall Exclusions using PowerShell *** Func AddToFirewallExclusions_PS($programPath, $ruleName) Return AddToFirewall_InboundExclusions_PS($programPath, $ruleName) And AddToFirewall_OutboundExclusions_PS($programPath, $ruleName) EndFunc ;==>AddToFirewallExclusions_PS Func AddToFirewall_InboundExclusions_PS($programPath, $ruleName) ; Create Inbound rule Local $inboundCommand = 'New-NetFirewallRule -DisplayName "' & $ruleName & ' (Inbound)" -Direction Inbound -Action Allow -Program "' & $programPath & '" -Enabled True' Local $inboundResult = RunPowerShellCommand($inboundCommand) If @error Then MsgBox(16, "Firewall Error", "Error running PowerShell command to add Inbound Firewall rule." & @CRLF & "" & $inboundResult & "") Return False Else If StringLen($inboundResult) > 0 Then MsgBox(16, "Defender return", "" & $inboundResult & "") Return True Else Return False EndIf EndIf EndFunc ;==>AddToFirewall_InboundExclusions_PS Func AddToFirewall_OutboundExclusions_PS($programPath, $ruleName) ; Create Outbound rule Local $outboundCommand = 'New-NetFirewallRule -DisplayName "' & $ruleName & ' (Outbound)" -Direction Outbound -Action Allow -Program "' & $programPath & '" -Enabled True' Local $outboundResult = RunPowerShellCommand($outboundCommand) If @error Then MsgBox(16, "Firewall Error", "Error running PowerShell command to add OutboundFirewall rule." & @CRLF & "" & $outboundResult & "") Return False Else If StringLen($outboundResult) > 0 Then MsgBox(16, "Defender return", "" & $outboundResult & "") Return True Else Return False EndIf EndIf Return True EndFunc ;==>AddToFirewall_OutboundExclusions_PS
  6. How to show tray menu without clicking on tray icon? Or Click on tray icon automatically! #NoTrayIcon #include <MsgBoxConstants.au3> #include <StringConstants.au3> #include <TrayConstants.au3> ; Required for the $TRAY_ICONSTATE_SHOW constant. Opt("TrayMenuMode", 3) ; The default tray menu items will not be shown and items are not checked when selected. These are options 1 and 2 for TrayMenuMode. HotKeySet("{F12}", "_ShowTrayMenu") ; Đặt Hotkey là phím F12 Example() Func Example() Local $idAbout = TrayCreateItem("About") TrayCreateItem("") ; Create a separator line. Local $idExit = TrayCreateItem("Exit") TraySetState($TRAY_ICONSTATE_SHOW) ; Show the tray menu. While 1 Switch TrayGetMsg() Case $idAbout ; Display a message box about the AutoIt version and installation path of the AutoIt executable. MsgBox($MB_SYSTEMMODAL, "", "AutoIt tray menu example." & @CRLF & @CRLF & _ "Version: " & @AutoItVersion & @CRLF & _ "Install Path: " & StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1)) ; Find the folder of a full path. Case $idExit ; Exit the loop. ExitLoop EndSwitch WEnd EndFunc ;==>Example Func _ShowTrayMenu() ;??????????????????????????????????????? EndFunc
  7. Your file is locked by "windows defender" you need to wait for the scan to complete, it's best to add the working path to the whitelist to improve, but it's best to disable it.
  8. DirMove and DirCopy are different in usage, try to understand it. Here is an example script for backing up and restoring folders: #RequireAdmin ; ----------------------------------------------- #include <AutoItConstants.au3> #include <FileConstants.au3> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- ; ------------------------------------------------------------- INPUT : Global Const $sUserName = @UserName Global $sNAME_Path[6] $sNAME_Path[0] = 4 $sNAME_Path[1] = 'SAC64' ; App Folder Name $sNAME_Path[2] = 'Software Audio Console64' ; Start Menu Folder Name $sNAME_Path[3] = 'SAWStudio' ; App Folder Name $sNAME_Path[4] = 'SAWStudio' ; Start Menu Folder Name $sNAME_Path[5] = 'RML' ; App Data Folder Name Global Const $aDirNAME_Path = $sNAME_Path Global Const $sORGAPP_Path = @HomeDrive Global Const $sBACKUP_Path = "D:\Backup" Global Const $sPathDir_BACKUP_Data = $sBACKUP_Path & "\Data" Global Const $sPathDir_BACKUP_App = $sBACKUP_Path & "\Apps" Global Const $sPathDir_BACKUP_Start_Menu = $sBACKUP_Path & "\Start_Menu" Global Const $iSleep_Time = 2500 ; ms Stop Show Result ; ---------------------------------------------------------------------- Global Const $sPathDir_ORG_StartMenuPrograms = @HomeDrive & "\Users\" & $sUserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs" ; @AppDataDir & "\Microsoft\Windows\Start Menu\Programs" Global $sPathDir_ORG[6] $sPathDir_ORG[0] = 5 $sPathDir_ORG[1] = $sORGAPP_Path & "\" & $aDirNAME_Path[1] $sPathDir_ORG[2] = $sPathDir_ORG_StartMenuPrograms & '\' & $aDirNAME_Path[2] $sPathDir_ORG[3] = $sORGAPP_Path & "\" & $aDirNAME_Path[3] $sPathDir_ORG[4] = $sPathDir_ORG_StartMenuPrograms & '\' & $aDirNAME_Path[4] $sPathDir_ORG[5] = $sPathDir_ORG_StartMenuPrograms & '\' & $aDirNAME_Path[5] Global Const $aPathDir_ORG = $sPathDir_ORG ; ---------------------------------------------------------------------- Global $sPathDir_BACKUP[6] $sPathDir_BACKUP[0] = 5 $sPathDir_BACKUP[1] = $sPathDir_BACKUP_App & "\" & $aDirNAME_Path[1] $sPathDir_BACKUP[2] = $sPathDir_BACKUP_Start_Menu & "\" & $aDirNAME_Path[2] $sPathDir_BACKUP[3] = $sPathDir_BACKUP_App & "\" & $aDirNAME_Path[3] $sPathDir_BACKUP[4] = $sPathDir_BACKUP_Start_Menu & "\" & $aDirNAME_Path[4] $sPathDir_BACKUP[5] = $sPathDir_BACKUP_Data & "\" & $aDirNAME_Path[5] Global Const $aPathDir_BACKUP = $sPathDir_BACKUP ; ---------------------------------------------------------------------- _Remove_RMLData_Backup() _Backup_RMLData() ;_Remove_RMLData_AppDir() ;_Restore_RMLData() ; ----------------------------------------------- Func _Backup_RMLData() ; ----------------------------------------------- Local $sResult, $iResult = 0, $sMessage = "Backup data..." & @CRLF & @CRLF ; ----------------------------------------------- For $i = 1 To $aPathDir_ORG[0] ToolTip('> COPY: ' & $aPathDir_ORG[$i] & ' -> TO: ' & $aPathDir_BACKUP[$i], (@DesktopWidth / 2) - 50, 5, 'Backing up data [' & $i & '/' & $aPathDir_ORG[0] & '] please wait...') ConsoleWrite('> COPY: ' & $aPathDir_ORG[$i] & ' (FileExists: ' & FileExists($aPathDir_ORG[$i]) & ') ' & @CRLF) ConsoleWrite('- TO: ' & $aPathDir_BACKUP[$i] & ' (FileExists: ' & FileExists($aPathDir_BACKUP[$i]) & ') ' & @CRLF) ConsoleWrite('! Please wait: Copying ....' & @CRLF) If Not FileExists($aPathDir_BACKUP[$i]) Then DirCreate($aPathDir_BACKUP[$i]) If FileExists($aPathDir_ORG[$i]) Then $sResult = DirCopy($aPathDir_ORG[$i], $aPathDir_BACKUP[$i], $FC_OVERWRITE) Else $sResult = 0 EndIf Switch $sResult Case 0 ConsoleWrite('!> Result (0): ERROR: Data was not backed-up! (' & $aDirNAME_Path[$i] & ' - FileExists: ' & FileExists($aPathDir_BACKUP[$i]) & ') ' & @CRLF) $sResult = "[" & $aDirNAME_Path[$i] & "] ERROR: Data was not backed up" Case 1 $iResult += 1 ConsoleWrite('-> Result (1): The data WAS backed-up successfully! (' & $aDirNAME_Path[$i] & ' - FileExists: ' & FileExists($aPathDir_BACKUP[$i]) & ') ' & @CRLF) $sResult = "[" & $aDirNAME_Path[$i] & "] The data WAS backed-up successfully!" EndSwitch ; ----------------- $sMessage &= $sResult & @CRLF $sResult = '' ToolTip('') Next ToolTip('') ; ----------------------------------------------- $sMessage &= @CRLF & "The Backup of data completed..." & @CRLF ; ----------------------------------------------- ToolTip($sMessage, (@DesktopWidth / 2) - 50, 5, "NOTICE!!", 1) Sleep($iSleep_Time) ToolTip('') $sResult = $aPathDir_ORG[0] - $iResult If ($sResult < 1) Then ConsoleWrite('+> The data WAS backed-up successfully!' & @CRLF) Return True Else ConsoleWrite('!> ERROR: Data was not backed-up!' & @CRLF) Return False EndIf ; ----------------------------------------------- EndFunc ;==>_Backup_RMLData ; ----------------------------------------------- Func _Restore_RMLData() ; ----------------------------------------------- Local $sResult, $iResult = 0, $sMessage = "Restore data..." & @CRLF & @CRLF ; ----------------------------------------------- For $i = 1 To $aPathDir_BACKUP[0] ToolTip('> COPY: ' & $aPathDir_BACKUP[$i] & ' -> TO: ' & $aPathDir_ORG[$i], (@DesktopWidth / 2) - 50, 5, 'Restoring data [' & $i & '/' & $aPathDir_BACKUP[0] & '] please wait...') ConsoleWrite('- COPY: ' & $aPathDir_BACKUP[$i] & ' (FileExists: ' & FileExists($aPathDir_BACKUP[$i]) & ') ' & @CRLF) ConsoleWrite('> TO: ' & $aPathDir_ORG[$i] & ' (FileExists: ' & FileExists($aPathDir_ORG[$i]) & ') ' & @CRLF) ConsoleWrite('! Please wait: Copying ....' & @CRLF) If Not FileExists($aPathDir_ORG[$i]) Then DirCreate($aPathDir_ORG[$i]) If FileExists($aPathDir_BACKUP[$i]) Then $sResult = DirCopy($aPathDir_BACKUP[$i], $aPathDir_ORG[$i], $FC_OVERWRITE) Else $sResult = 0 EndIf Switch $sResult Case 0 ConsoleWrite('+> Result (0): ERROR: Data not restored! (' & $aDirNAME_Path[$i] & ' - FileExists: ' & FileExists($aPathDir_ORG[$i]) & ') ' & @CRLF) $sResult = "[" & $aDirNAME_Path[$i] & "] ERROR: Data not restored!" Case 1 $iResult += 1 ConsoleWrite('+> Result (1): Data restored successfully! (' & $aDirNAME_Path[$i] & ' - FileExists: ' & FileExists($aPathDir_ORG[$i]) & ') ' & @CRLF) $sResult = "[" & $aDirNAME_Path[$i] & "] Data restored successfully!" EndSwitch ; ----------------- $sMessage &= $sResult & @CRLF $sResult = '' ToolTip('') Next ToolTip('') ; ----------------------------------------------- $sMessage &= @CRLF & "Data recovery completed." & @CRLF ; ----------------------------------------------- ToolTip($sMessage, (@DesktopWidth / 2) - 50, 5, "NOTICE!!", 1) Sleep($iSleep_Time) ToolTip('') $sResult = $aPathDir_ORG[0] - $iResult If ($sResult < 1) Then ConsoleWrite('+> Data restored successfully!' & @CRLF) Return True Else ConsoleWrite('!> ERROR: Data not restored!' & @CRLF) Return False EndIf EndFunc ;==>_Restore_RMLData ; ----------------------------------------------- Func _Remove_RMLData_Backup() ; ----------------------------------------------- Local $sResult, $iResult = 0, $sMessage = "Remove data..." & @CRLF & @CRLF ; ----------------------------------------------- For $i = 1 To $aPathDir_BACKUP[0] ToolTip('> Remove: ' & $aPathDir_BACKUP[$i], (@DesktopWidth / 2) - 50, 5, 'Removing data [' & $i & '/' & $aPathDir_BACKUP[0] & '] please wait...') ConsoleWrite('! Remove: ' & $aPathDir_BACKUP[$i] & ' (FileExists: ' & FileExists($aPathDir_BACKUP[$i]) & ') ' & @CRLF) ConsoleWrite('- Please wait: removing...' & @CRLF) If FileExists($aPathDir_BACKUP[$i]) Then $sResult = DirRemove($aPathDir_BACKUP[$i], $DIR_REMOVE) Else $sResult = 1 EndIf Switch $sResult Case 0 ConsoleWrite('+> Result (0): ERROR: Data not Removed! (' & $aDirNAME_Path[$i] & ' - FileExists: ' & FileExists($aPathDir_BACKUP[$i]) & ') ' & @CRLF) $sResult = "[" & $aDirNAME_Path[$i] & "] ERROR: Data not Removed!" Case 1 $iResult += 1 ConsoleWrite('+> Result (1): Data Removed successfully! (' & $aDirNAME_Path[$i] & ' - FileExists: ' & FileExists($aPathDir_BACKUP[$i]) & ') ' & @CRLF) $sResult = "[" & $aDirNAME_Path[$i] & "] Data Removed successfully!" EndSwitch ; ----------------- $sMessage &= $sResult & @CRLF $sResult = '' ToolTip('') Next ToolTip('') ; ----------------------------------------------- $sMessage &= @CRLF & "Data Removal Completed." & @CRLF ; ----------------------------------------------- ToolTip($sMessage, (@DesktopWidth / 2) - 50, 5, "NOTICE!!", 1) Sleep($iSleep_Time) ToolTip('') $sResult = $aPathDir_ORG[0] - $iResult If ($sResult < 1) Then ConsoleWrite('+> Data Removed successfully!' & @CRLF) Return True Else ConsoleWrite('!> ERROR: Data not Removed!' & @CRLF) Return False EndIf EndFunc ;==>_Remove_RMLData_Backup ; ----------------------------------------------- Func _Remove_RMLData_AppDir() ; ----------------------------------------------- Local $sResult, $iResult = 0, $sMessage = "Remove data..." & @CRLF & @CRLF ; ----------------------------------------------- For $i = 1 To $aPathDir_ORG[0] ToolTip('> Remove: ' & $aPathDir_ORG[$i], (@DesktopWidth / 2) - 50, 5, 'Removing data [' & $i & '/' & $aPathDir_ORG[0] & '] please wait...') ConsoleWrite('!> Remove: ' & $aPathDir_ORG[$i] & ' (FileExists: ' & FileExists($aPathDir_ORG[$i]) & ') ' & @CRLF) ConsoleWrite('- Please wait: removing ....' & @CRLF) If FileExists($aPathDir_ORG[$i]) Then $sResult = DirRemove($aPathDir_ORG[$i], $DIR_REMOVE) Else $sResult = 1 EndIf Switch $sResult Case 0 ConsoleWrite('+> Result (0): ERROR: Data not Removed! (' & $aDirNAME_Path[$i] & ' - FileExists: ' & FileExists($aPathDir_ORG[$i]) & ') ' & @CRLF) $sResult = "[" & $aDirNAME_Path[$i] & "] ERROR: Data not Removed!" Case 1 $iResult += 1 ConsoleWrite('+> Result (1): Data Removed successfully! (' & $aDirNAME_Path[$i] & ' - FileExists: ' & FileExists($aPathDir_ORG[$i]) & ') ' & @CRLF) $sResult = "[" & $aDirNAME_Path[$i] & "] Data Removed successfully!" EndSwitch ; ----------------- $sMessage &= $sResult & @CRLF $sResult = '' ToolTip('') Next ToolTip('') ; ----------------------------------------------- $sMessage &= @CRLF & "Data Removal Completed." & @CRLF ; ----------------------------------------------- ToolTip($sMessage, (@DesktopWidth / 2) - 50, 5, "NOTICE!!", 1) Sleep($iSleep_Time) ToolTip('') $sResult = $aPathDir_ORG[0] - $iResult If ($sResult < 1) Then ConsoleWrite('+> Data Removed successfully!' & @CRLF) Return True Else ConsoleWrite('!> ERROR: Data not Removed!' & @CRLF) Return False EndIf EndFunc ;==>_Remove_RMLData_AppDir ; -----------------------------------------------
  9. Thank you AspirinJunkie and pixelsearch for helping make my work easier.
  10. Thanks, I will research further 140 is the sum of the "all products that have been produce" quantity of "all orders" , Each order is 1 line. Column 1 is the total quantity of 1 order Column 2 is the number of products that have been produced Column 3 is the number of remaining unproduced products.
  11. I have to report hourly production and mental calculation or adding up the numbers seems to take a long time, so I'm trying to write a script to do the calculation quickly, but my logic is a bit bad, hope for help! Input data: (The exact data copied from the master management software table can be downloaded from here: https://www.liteon.vn/Big_Data.txt AND https://www.liteon.vn/Lite_Data.txt) N05 8587652 96908-003760A000 FG,GSUBUSW-Flex_NA,Packing FCC (USW 1-Nesscessary FATP FATP_PACKING_02 100 90 10 N Y N05 8587651 96908-003760A000 FG,GSUBUSW-Flex_NA,Packing US (USW 1-Nesscessary FATP FATP_PACKING_02 110 20 80 N Y N05 8587602 96908-003760A000 FG,GSUBUSW-Flex_NA,Packing UK (USW 1-Nesscessary FATP FATP_PACKING_02 105 10 95 N Y N05 8587252 96908-003760A000 FG,GSUBUSW-Flex_NA,Packing ASSY (UK 1-Nesscessary FATP FATP_PACKING_02 120 20 100 N Y N05 8587612 96908-003760A000 FG,GSUBUSW-Flex_NA,Packing FCC (USW 1-Nesscessary FATP FATP_FT_02 100 90 10 N Y N05 8587621 96908-003760A000 FG,GSUBUSW-Flex_NA,Packing US (USW 1-Nesscessary FATP FATP_FT_02 110 20 80 N Y N05 8587632 96908-003760A000 FG,GSUBUSW-Flex_NA,Packing UK (USW 1-Nesscessary FATP FATP_FT_02 105 10 95 N Y N05 8587242 96908-003760A000 FG,GSUBUSW-Flex_NA,Packing ASSY (UK 1-Nesscessary FATP FATP_FT_02 120 20 100 N Y N05 8587612 96908-003760A000 FG,GSUBUSW-Flex_NA,Packing FCC (USW 1-Nesscessary FATP FATP_FT_03 100 90 10 N Y N05 8587621 96908-003760A000 FG,GSUBUSW-Flex_NA,Packing US (USW 1-Nesscessary FATP FATP_FT_03 110 20 80 N Y N05 8587632 96908-003760A000 FG,GSUBUSW-Flex_NA,Packing UK (USW 1-Nesscessary FATP FATP_FT_03 105 10 95 N Y N05 8587242 96908-003760A000 FG,GSUBUSW-Flex_NA,Packing ASSY (UK 1-Nesscessary FATP FATP_FT_03 120 20 100 N Y N06 8584568 96801-002910A000 FG,WPUBUK-Ultra_NA,Packing FCC 1-Nesscessary FATP FATP_PRINT_01 100 10 90 N N N06 8584548 96801-002910A000 FG,WPUBUK-Ultra_NA,Packing US 1-Nesscessary FATP FATP_PRINT_01 101 10 91 N N N06 8584528 96801-002910A000 FG,WPUBUK-Ultra_NA,Packing ASSY (UK 1-Nesscessary FATP FATP_PRINT_01 110 10 100 N N N06 8586247 96801-003400A000 FG,WPUBU7-Pro_NA,Packing ASSY FCC (U7 1-Nesscessary FATP FATP_FT_01 102 12 90 N N N06 8586217 96801-003400A000 FG,WPUBU7-Pro_NA,Packing ASSY US (U7 1-Nesscessary FATP FATP_FT_01 104 14 90 N N N06 8586287 96801-003400A000 FG,WPUBU7-Pro_NA,Packing ASSY (UK 1-Nesscessary FATP FATP_FT_01 108 10 98 N N The table displays the desired output: PROCESS >>> |FATP_PACKING_02 | FATP_FT_01| FATP_FT_02 | FATP_FT_03| FATP_PRINT_01 MODEL ⇓ GSUBUSW-Flex | 140 | 0 | 140 | 140 | 0 WPUBUK-Ultra | 0 | 0 | 0 | 0 | 30 WPUBU7-Pro | 0 | 36 | 0 | 0 | 0 GSUBUSW-Flex FATP_PACKING_02 | 140 FATP_FT_02 | 140 FATP_FT_03 | 140 WPUBUK-Ultra FATP_PRINT_01 | 30 WPUBU7-Pro FATP_FT_01 | 36 I am stuck on how to save and retrieve data from array: #include <Array.au3> _GetYield() Func _GetYield() Global $aPROCESS_List = StringSplit('PC MAP-CASE|PC-AS-LQC|FATP-AS-GULE Filling1|FATP-AS-GULE Filling2|PC-BI-INPUT|PC-BI-OUTPUT|PC-PK-LOAD|PC-PK-HIPOT1|PC-PK-FIN-ATE1|PC-PK-PF-TEST1|PC-PK-UNLOAD|PC-PK-LQC2|PC-PK-LQC1|PC-PK-PACKING|PC-OQC|SMT_TOP_MAPPING_02|SMT_TOP_AOI|PWR-PC-HI-INPUT|PC_TU_ICT|PC_TU_INT|AI_INPUT|AI_OUTPUT|RI_INPUT|RI_OUTPUT|RI_VMI|SMT_TOP_INPUT|SMT_TOP_MOUNT|PC-PK-LASER|SMT_BOT_MAPPING_01|SMT_BOT_AOI|PC-USW-01|FATP-AS-USW-check1|FATP-AS-USW-Check2|PC-TU-INT-R|PK-AS-Thrust|PC-AS-LQC1|PC-PK-MAP-More material|SMT_BOT_INPUT|SMT_BOT_MOUNT|NB-KB-CHAS-Input|NB-KB-CHAS-AOI|NB-KB-CHAS-Packing|PC_Packing|PC_ASSY2|PC_Check|PC_QC|FATP_ASSY_06|Packing_OQC|DIP_INPUT|DIP_VMI_01|DIP_PACKING|DIP_OBA|FATP_INPUT|FATP_PCBA_01|FATP_PCBA_02|FATP_RUN IN|FATP_FT_01|FATP_PRINT_01|FATP_AOI_03|FATP_PRINT_02|FATP_AOI_04|FATP_AOI_05|FATP_PACKING_02|FATP_PCBA_03|FATP_LASER|FATP_AOI_01|FATP_FT_02|FATP_FT_03|FATP_ASSY_01|FATP_HIPOT_TEST|FATP_BURN_IN|FATP_FT_04|FATP_FT_05|FATP_MAPPING_01|FATP_Leak Test|FATP_AOI_02|FATP_FCD TEST|FATP_ASSY_LCM|FATP_AOI_06|FATP_VMI_01|PC_Packing_SP|PC_CCD|PC_Check_SP|Tampo|KM_ASM_Cosmetic|KM_TES_ATE|KM_ASM_Mapping|KM_ASM_Box|KM_PAC_Carton|PC_OQC|KM_PAC_Pallet|KM_TES_AOI|KM_TES_Pair test|KM_FATP_KB_Input|KM_TES_RF test|KM_Semi_Output|QC-FT01|FATP_FT_06|QC-FT02|FATP_ASSY_02|KM_ASM_SN|FATP_OQC|KM_ASM_Input|KM_TES_bluetooth|KM_TES_Backlight|FATP-LASER_02|QC_IR_TEST|QC-FT04|FATP_ASSY_04|FATP_AOI_07|FATP_AOI_08|FATP_ASSY_03|FATP_CHECK|FATP_PRINT_03|FATP_GLUE_IN|FATP_GLUE_OUT|FATP_TEST_PULL|FATP_Leak Test02|FATP_PCBA_04|PL_PACKING|SMT_BOT_PRINT|DIP_TU|DIP_PCBA_01|DIP_PCBA Test02|DIP_Funtion Test|DIP_OQC|DIP_INSERT_01|DIP_PCBA Test03|DIP_WAVESOLDER|DIP_RF Test|DIP_Assy 01|DIP_ICT_01|DIP_ICT_02|SMT Laser|CIPS-TU-FUNCTION|DIP_FCD_01|PWR-PC-HI-LQC|RI_Mapping|DIP_AOI_01|COB_INPUT|COB_Test_01|COB_Test_02|COB_VMI|SMT_XRAY_BOT|DIP_ Tes Wheel|SMT_TOP_VMI|DIP_Test ADD FW|DIP_Test Adaptor 1|DIP_Test Adaptor 2|DIP_Keo|DIP_TEST FW|CIPS-HISN-MAP|CIPS-TU-LQC1-MAP|CIPS-TU-LeadLength|CIPS-TU-AOI-Check|CIPS-TU-ICT|CIPS-TU-LQC2|CIPS-AS-LQC1|AS-SSN-MAP|CIPS-AS-FRU-W|CIPS-AS-IAC|CIPS-AS-PRE-ATE|CIPS-BI-Input|CIPS-BI-Output|CIPS-PK-PRINT|CIPS-PK-Hipot|CIPS-PK-FINAL-ATE|CIPS-PK-FRU-V|CIPS-PK-Measure|CIPS-PK-LQC1|CIPS-PK-LQC2|CIPS-Packing|SMT_Test_ICT|FATP_PACKING_05|PS_QC|PS_Machine|PS_Packing|PL_OBA|PL_Machine_4201|PL_Machine_4202|SMT_OBA|SMT_TOP_SPI|SMT_TOP_AOI_BR|SMT_TOP_MOUNT_02|SMT_PACKING|NB-KB-FINAL-Pull Key|NB-KB-FINAL-LED Test|NB-KB-FINAL-Autofeeling|NB-KB-FINAL-BL Test|NB-KB-FINAL-FQC|NB-KB-FINAL-AOI|NB-KB-FINAL-Packing|NB-KB-FINAL-OBA|NB-KB-FINAL-Input|NB-KB-FINAL-VI|KM_ASM_Flatness|KM_ASM_AOI|PC-PK-SCP-OVP|PC-PK-FIN-ATE2|PC-AS-ICBURN|PC-AS-PT|PC-PK-MAP-Cable|CIPS-PK-ACC-V|CIPS-OQC-Hipot|CIPS-OQC-ATE|CIPS-OQC-FRU-V|PC_TU_LQC1|PC-OQC-HIPOT|PC-OQC-ATE|PC-PK-FAN LED|PC-PK-SDQ|PC-PK-LQC3|PC-PK-LQC4|PC MAP-CASE-CCD|PC-AS-Leak test|PC-TU-AOI|PC-AS-LQC2|PC-PK-ID-SSN-MAP|PC-PK-ID-SSN-MAP-READ', '|') Global $aMODEL_List Local $CSV_Yield = ClipGet() If Not StringInStr($CSV_Yield, @TAB) Then $CSV_Yield = FileRead(@ScriptDir & "\Lite_Data.txt") ;MsgBox(48 + 262144, 'Yield Report', 'Please COPY ' & @CRLF & 'PDLINE_NAME' & @CRLF & 'WORK_ORDER' & @CRLF & 'PART_NO' & @CRLF & 'MODEL_NAME' & @CRLF & 'PROCESS_TYPE' & @CRLF & 'STAGE_NAME' & @CRLF & 'PROCESS_NAME' & @CRLF & 'TARGET_QTY' & @CRLF & 'OUTPUT_QTY' & @CRLF & 'WAIT_INPUT' & @CRLF & 'STAGE_INPUT' & @CRLF & 'STAGE_OUTPUT' & @CRLF &'xong thi BAM OK', 60) ;$CSV_Yield = ClipGet() EndIf If Not StringInStr($CSV_Yield, @TAB) Then Exit $CSV_Yield = StringReplace($CSV_Yield, @CRLF, @LF) $CSV_Yield = StringReplace($CSV_Yield, @TAB, '|') While StringInStr($CSV_Yield, ' ' & ' ') $CSV_Yield = StringReplace($CSV_Yield, ' ' & ' ', ' ') WEnd Local $NewContent, $iNewContent, $xNewContent, $PROCESS_List, $MODEL_List Local $aLine, $iLine, $aArray_Yield = StringSplit($CSV_Yield, @LF) If IsArray($aArray_Yield) Then Local $iModelName, $iProcessName, $iOutput Local $a_PROCESS_List[1], $a_MODEL_List[1] For $i = 1 To $aArray_Yield[0] $aLine = StringSplit($aArray_Yield[$i], '|', 3) If IsArray($aLine) Then If UBound($aLine) > 8 Then _Get_Info($iModelName, $iProcessName, $iOutput, $aArray_Yield[$i]) If (StringLen($iModelName) > 1) And (StringLen($iProcessName) > 1) And ($iOutput > 0) Then If Not StringInStr($MODEL_List, $iModelName) Then $MODEL_List&=$iModelName&'|' If Not StringInStr($PROCESS_List, $iProcessName) Then $PROCESS_List&=$iModelName&'|' _ArrayAdd($a_MODEL_List, $iModelName) _ArrayAdd($a_PROCESS_List, $iProcessName) EndIf EndIf EndIf $iModelName = '' $iProcessName = '' $iOutput = 0 $aLine = 0 Next _ArrayUnique($a_MODEL_List) _ArrayUnique($a_PROCESS_List) ;~ For $i = 1 To $aArray_Yield[0] ;~ ;ConsoleWrite("$a [" & $i & "] _ " & $aArray_Yield[$i] & @CRLF) ;~ $aLine = StringSplit($aArray_Yield[$i], '|', 3) ;~ If IsArray($aLine) Then ;~ If UBound($aLine) > 8 Then ;~ ;ConsoleWrite('-$aLine: '&UBound($aLine)&@CRLF) ;~ _Get_Info($iModelName, $iProcessName, $iOutput, $aArray_Yield[$i]) ;~ If (StringLen($iModelName) > 1) And (StringLen($iProcessName) > 1) And ($iOutput > 0) Then ;~ ;ConsoleWrite('-Model: ' & $iModelName & ' -Process: ' & $iProcessName & ' -Output: ' & $iOutput & @CRLF) ;~ ; Array: MODEL | PROCESS | OUTPUT ;~ ;~ ; | PROCESS_1 | PROCESS_2 | PROCESS_3 | PROCESS_N ;~ ;MODEL_1 | OUTPUT_X | OUTPUT_X | OUTPUT_X | OUTPUT_X ;~ ;MODEL_2 | OUTPUT_X | OUTPUT_X | OUTPUT_X | OUTPUT_X ;~ ;MODEL_3 | OUTPUT_X | OUTPUT_X | OUTPUT_X | OUTPUT_X ;~ ;MODEL_N | OUTPUT_X | OUTPUT_X | OUTPUT_X | OUTPUT_X ;~ EndIf ;~ EndIf ;~ EndIf ;~ $iModelName = '' ;~ $iProcessName = '' ;~ $iOutput = 0 ;~ $aLine = 0 ;~ Next EndIf ;~ ConsoleWrite($MODEL_List&@CRLF) ;~ ConsoleWrite($PROCESS_List&@CRLF) ;~ ConsoleWrite($xNewContent&@CRLF) ;~ ConsoleWrite($NewContent&@CRLF) EndFunc ;==>_TinhYield Func _Get_Info(ByRef $iModelName, ByRef $iProcessName, ByRef $iOutput, $iLine = '|') Local $aLine = StringSplit($iLine, '|', 3) If IsArray($aLine) Then If (UBound($aLine) > 8) Then $iLine = _Get_ModelName($aLine[4]) If (StringLen($iLine) > 1) Then ;ConsoleWrite('-$aLine: '&UBound($aLine)&@CRLF) $iModelName = $iLine $iProcessName = $aLine[7] If Int($aLine[9]) > 0 Then $iOutput = $aLine[9] Else $iOutput = 0 EndIf ;ConsoleWrite('-Model: '&$aLine[4]&' -Process: '&$aLine[7]&' -Output: '&$aLine[9]&@CRLF) EndIf EndIf EndIf EndFunc ;==>_Get_Info Func _Get_ModelName($iLine = ',,,,', $iRetunNoCountry = True) Local $aLine = StringSplit($iLine & ',,,,', ',', 3) If IsArray($aLine) Then StringReplace($iLine, ',', '') If (@extended < 2) Then If (StringLen($aLine[0]) > 1) And (StringLen($aLine[1]) > 1) Then ;ConsoleWrite('-0: ' & $aLine[0] & ' -1: ' & $aLine[1] & ' -2: ' & $aLine[2] & ' -3: ' & $aLine[3] & @CRLF) $iLine = StringReplace($aLine[0] & '_' & $aLine[1], ' ', '-') Return $iLine EndIf Else If (StringLen($aLine[1]) > 1) Then ;ConsoleWrite('-0: ' & $aLine[0] & ' -1: ' & $aLine[1] & ' -2: ' & $aLine[2] & ' -3: ' & $aLine[3] & @CRLF) $iLine = StringReplace($aLine[1], '_NA', '') If (StringStripWS($iLine, 8) <> '') Then If $iRetunNoCountry Then Return $iLine If StringInStr($aLine[2], 'Packing ASSY FCC') Then Return $iLine & '_FCC' ElseIf StringInStr($aLine[2], 'Packing ASSY US') Then Return $iLine & '_US' ElseIf StringInStr($aLine[2], 'Packing ASSY WW') Then Return $iLine & '_WW' ElseIf StringInStr($aLine[2], 'Packing ASSY EU') Then Return $iLine & '_EU' ElseIf StringInStr($aLine[2], 'Packing ASSY UK') Then Return $iLine & '_UK' Else Return $iLine EndIf EndIf Return '' EndIf EndIf EndIf EndFunc ;==>_Get_ModelName Thanks a lot
  12. LOL It looks similar to your script but I created it from Computer Info UDF HTML I took from a vbs file at my company NAS.
  13. I created the relay server myself and installed RustDesk using the auto install script via ps. It seems your UDF is not detecting it.
  14. Get system information and Create reports in HTML and CSV format: ;#NoTrayIcon ;Opt("MustDeclareVars", 1) Global $oMyError = ObjEvent("AutoIt.Error", "__PCinfo_ObjErrorFunc") Global Const $cI_CompName = @ComputerName, $sBlankMAC = "00:00:00:00:00:00", $ERR_NO_INFO = "Array contains no information", $ERR_NOT_OBJ = "$colItems isnt an object" Global $isWin64 = False, $softCount = 0, $sAdapterInfo If StringInStr(@OSArch, "64") Then $isWin64 = True Global $Report_SaveDir = @ScriptDir If Not __PCinfo_Singleton("PC_Scan_Info") Then Exit If Not FileExists($Report_SaveDir) Then DirCreate($Report_SaveDir) Global $sHTML_Content, $sFilePath_SaveHTML = $Report_SaveDir & "\" & @ComputerName & "_HTML.htm" Global $sLogs_Content, $sFilePath_SaveLog = $Report_SaveDir & "\" & @ComputerName & "_Csv.log" _Get_PCinformation() Func _Get_PCinformation() ToolTip('System Info Getting...', (@DesktopWidth / 2) - 20, 10) __PCinfo_HTML_AddHeader(@ComputerName & " System Information") Local $error, $extended, $sPC_Info $sPC_Info &= @CRLF Local $__PCinfo_Get_SysOverview = __PCinfo_Get_SysOverview() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_SysOverview') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_SysOverview') EndSwitch Else __Write_PCinfo($__PCinfo_Get_SysOverview, 'System_Overview', @ComputerName & ',System Infomation') EndIf Local $Network_Adapters = __PCinfo_Get_AdaptersInfo() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_AdaptersInfo') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_AdaptersInfo') EndSwitch Else __Write_PCinfo($Network_Adapters, 'Network_Adapters', 'Index,Network_Adapters,Name,Status,IPType,IP,SubNetIP,MAC,GetwayIP,MAC,Speed,DNS1,DNS2,DNS3,DNS4,DNS5,DNS6,DNS7,DNS8,DNS_Num') EndIf $sPC_Info &= @CRLF Local $Drives = __PCinfo_Get_Drives() If @error Then $error = @error $extended = @extended __PCinfo_DebugMsg("DriveGetDrive Error!", '__PCinfo_Get_Drives') Else __Write_PCinfo($Drives, 'Drives', 'Drive,DriveType,DriveStatus,FileSystem,Label,Serial,SpaceFree(GB),SpaceTotal(GB),DriveBusType,MapTo,IsSSD') EndIf $sPC_Info &= @CRLF Local $SystemProduct = __PCinfo_Get_SystemProduct() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_SystemProduct') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_SystemProduct') EndSwitch Else __Write_PCinfo($SystemProduct, 'SystemProduct', 'Name,IdentifyingNumber,SKUNumber,UUID,Description,Vendor,Version') EndIf $sPC_Info &= @CRLF Local $OSs = __PCinfo_Get_OSs() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_OSs') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_OSs') EndSwitch Else __Write_PCinfo($OSs, 'OS', 'Name,BootDevice,BuildNumber,BuildType,Description,CodeSet,CountryCode,CreationClassName,CSCreationClassName,CSDVersion,CSName,CurrentTimeZone,DataExecutionPrevention_32BitApplications,DataExecutionPrevention_Available,DataExecutionPrevention_Drivers,DataExecutionPrevention_SupportPolicy,Debug,Distributed,EncryptionLevel,ForegroundApplicationBoost,FreePhysicalMemory,FreeSpaceInPagingFiles,FreeVirtualMemory,InstALLDate,LargeSystemCache,LastBootUpTime,LocalDateTime,Locale,Manufacturer,MaxNumberOfProcesses,MaxProcessMemorySize,NumberOfLicensedUsers,NumberOfProcesses,NumberOfUsers,Organization,OSLanguage,OSProductSuite,OSType,OtherTypeDescription,PlusProductID,PlusVersionNumber,Primary,ProductType,QuantumLength,QuantumType,RegisteredUser,SerialNumber,ServicePackMajorVersion,ServicePackMinorVersion,SizeStoredInPagingFiles,Status,SuiteMask,SystemDevice,SystemDirectory,SystemDrive,TotalSwapSpaceSize,TotalVirtualMemorySize,TotalVisibleMemorySize,Version,WindowsDirectory') EndIf $sPC_Info &= @CRLF Local $Users = __PCinfo_Get_Users() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Users') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_Users') EndSwitch Else __Write_PCinfo($Users, 'Users', 'Name,Domain,Status,LocalAccount,SID,SIDType,Description,FullName,Disabled,Lockout,PasswordChangeable,PasswordExpires,PasswordRequired,AccountType') EndIf $sPC_Info &= @CRLF Local $Groups = __PCinfo_Get_Groups() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Groups') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_Groups') EndSwitch Else __Write_PCinfo($Groups, 'Groups', 'Name,Domain,Status,LocalAccount,SID,SIDType,Description') EndIf $sPC_Info &= @CRLF Local $sFilePath_SaveHTMLgedOnUser = __PCinfo_Get_LoggedOnUsers() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_LoggedOnUsers') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_LoggedOnUsers') EndSwitch Else __Write_PCinfo($sFilePath_SaveHTMLgedOnUser, 'Logged Users', 'DomainName,UserName,LogonID') EndIf Local $Desktop = __PCinfo_Get_Desktops() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Desktops') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_Desktops') EndSwitch Else __Write_PCinfo($Desktop, 'Desktops', 'Name,BorderWidth,CoolSwitch,CursorBlinkRate,Description,DragFullWindows,GridGranularity,IconSpacing,IconTitleFaceName,IconTitleSize,IconTitleWrap,Pattern,ScreenSaverActive,ScreenSaverExecutable,ScreenSaverSecure,ScreenSaverTimeout,SettingID,WALLpaper,WALLpaperStretched,WALLpaperTiled') EndIf $sPC_Info &= @CRLF Local $Shares = __PCinfo_Get_Shares() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Shares') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_Shares') EndSwitch Else __Write_PCinfo($Shares, 'Shares', 'Name,AccessMask,ALLowMaximum,MaximumALLowed,Description,Path,Status,Type') EndIf $sPC_Info &= @CRLF Local $Startup = __PCinfo_Get_Startup() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Startup') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_Startup') EndSwitch Else __Write_PCinfo($Startup, 'Startup', 'Name,User,Location,Command,Description,SettingID') EndIf $sPC_Info &= @CRLF Local $System = __PCinfo_Get_System() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_System') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_System') EndSwitch Else __Write_PCinfo($System, 'System', 'Name,AdminPasswordStatus,AutomaticResetBootOption,AutomaticResetCapability,Description,BootOptionOnLimit,BootOptionOnWatchDog,BootROMSupported,BootupState,ChassisBootupState,CreationClassName,CurrentTimeZone,DaylightInEffect,Domain,DomainRole,EnableDaylightSavingsTime,FrontPanelResetStatus,InfraredSupported,InitiALLoadInfo,KeyboardPasswordStatus,LastLoadInfo,Manufacturer,Model,NameFormat,NetworkServerModeEnabled,NumberOfProcessors,OEMLogoBitmap,OEMStringArray,PartOfDomain,PauseAfterReset,PowerManagementCapabilities,PowerManagementSupported,PowerOnPasswordStatus,PowerState,PowerSupplyState,PrimaryOwnerContact,PrimaryOwnerName,ResetCapability,ResetCount,ResetLimit,Roles,Status,SupportContactDescription,SystemStartupDelay,SystemStartupOptions,SystemStartupSetting,SystemType,ThermalState,TotalPhysicalMemory,UserName,WakeUpType,Workgroup') EndIf $sPC_Info &= @CRLF Local $BIOS = __PCinfo_Get_BIOS() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_BIOS') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_BIOS') EndSwitch Else __Write_PCinfo($BIOS, 'BIOS', 'Name,Status,BIOSCharacteristics,BIOSVersion,Description,BuildNumber,CodeSet,CurrentLanguage,IdentificationCode,InstALLableLanguages,LanguageEdition,ListofLanguages,Manufacturer,OtherTargetOS,PrimaryBIOS,ReleaseDate,SerialNumber,SMBIOSBIOSVersion,SMBIOSMajorVersion,SMBIOSMinorVersion,SMBIOSPresent,SoftwareElementID,SoftwareElementState,TargetOperatingSystem,Version') EndIf $sPC_Info &= @CRLF Local $Keyboard = __PCinfo_Get_Keyboard() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Keyboard') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_Keyboard') EndSwitch Else __Write_PCinfo($Keyboard, 'Keyboard', 'Name,Availability,ConfigManagerErrorCode,ConfigManagerUserConfig,Description,CreationClassName,DeviceID,ErrorCleared,ErrorDescription,IsLocked,LastErrorCode,Layout,NumberofFunctionKeys,Password,PNPDeviceID,PowerManagementCapabilities,PowerManagementSupported,Status,StatusInfo,SystemCreationClassName,SystemName') EndIf $sPC_Info &= @CRLF Local $Memory = __PCinfo_Get_Memory() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Memory') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_Memory') EndSwitch Else __Write_PCinfo($Memory, 'Memory', 'Name,BankLabel,Capacity,CreationClassName,Description,DataWidth,DeviceLocator,FormFactor,HotSwappable,InterleaveDataDepth,InterleavePosition,Manufacturer,MemoryType,Model,OtherIdentifyingInfo,PartNumber,PositionInRow,PoweredOn,Removable,Replaceable,SerialNumber,SKU,Speed,Status,Tag,TotalWidth,TypeDetail,Version') EndIf $sPC_Info &= @CRLF Local $Monitor = __PCinfo_Get_Monitors() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Monitors') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_Monitors') EndSwitch Else __Write_PCinfo($Monitor, 'Monitor', 'Name,Availability,Bandwidth,ConfigManagerErrorCode,Description,ConfigManagerUserConfig,CreationClassName,DeviceID,DisplayType,ErrorCleared,ErrorDescription,IsLocked,LastErrorCode,MonitorManufacturer,MonitorType,PixelsPerXLogicalInch,PixelsPerYLogicalInch,PNPDeviceID,PowerManagementCapabilities,PowerManagementSupported,ScreenHeight,ScreenWidth,Status,StatusInfo,SystemCreationClassName,SystemName') EndIf $sPC_Info &= @CRLF Local $Motherboard = __PCinfo_Get_Motherboard() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Motherboard') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_Motherboard') EndSwitch Else __Write_PCinfo($Motherboard, 'Motherboard', 'Name,Availability,ConfigManagerErrorCode,ConfigManagerUserConfig,Description,CreationClassName,DeviceID,ErrorCleared,ErrorDescription,LastErrorCode,PNPDeviceID,PowerManagementCapabilities,PowerManagementSupported,PrimaryBusType,RevisionNumber,SecondaryBusType,Status,StatusInfo,SystemCreationClassName,SystemName') EndIf $sPC_Info &= @CRLF Local $Mouse = __PCinfo_Get_Mouse() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Mouse') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_Mouse') EndSwitch Else __Write_PCinfo($Mouse, 'Mouse', 'Name,Availability,ConfigManagerErrorCode,ConfigManagerUserConfig,Description,CreationClassName,DeviceID,DeviceInterface,DoubleSpeedThreshold,ErrorCleared,ErrorDescription,Handedness,HardwareType,InfFileName,InfSection,IsLocked,LastErrorCode,Manufacturer,NumberOfButtons,PNPDeviceID,PointingType,PowerManagementCapabilities,PowerManagementSupported,QuadSpeedThreshold,Resolution,SampleRate,Status,StatusInfo,Synch,SystemCreationClassName,SystemName') EndIf $sPC_Info &= @CRLF Local $NetworkCards = __PCinfo_Get_NetworkCards() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_NetworkCards') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_NetworkCards') EndSwitch Else __Write_PCinfo($NetworkCards, 'NetworkCards', 'Name,AdapterType,AdapterTypeID,AutoSense,Description,Availability,ConfigManagerErrorCode,ConfigManagerUserConfig,CreationClassName,DeviceID,ErrorCleared,ErrorDescription,Index,InstALLed,LastErrorCode,MACAddress,Manufacturer,MaxNumberControlled,MaxSpeed,NetConnectionID,NetConnectionStatus,NetworkAddresses,PermanentAddress,PNPDeviceID,PowerManagementCapabilities,PowerManagementSupported,ProductName,ServiceName,Speed,Status,StatusInfo,SystemCreationClassName,SystemName,TimeOfLastReset') EndIf $sPC_Info &= @CRLF Local $Print = __PCinfo_Get_Printers() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Printers') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_Printers') EndSwitch Else __Write_PCinfo($Print, 'Print', 'Name,Attributes,Availability,AvailableJobSheets,Description,AveragePagesPerMinute,Capabilities,CapabilityDescriptions,CharSetsSupported,Comment,ConfigManagerErrorCode,ConfigManagerUserConfig,CreationClassName,CurrentCapabilities,CurrentCharSet,CurrentLanguage,CurrentMimeType,CurrentNaturALLanguage,CurrentPaperType,Default,DefaultCapabilities,DefaultCopies,DefaultLanguage,DefaultMimeType,DefaultNumberUp,DefaultPaperType,DefaultPriority,DetectedErrorState,DeviceID,Direct,DoCompleteFirst,DriverName,EnableBIDI,EnableDevQueryPrint,ErrorCleared,ErrorDescription,ErrorInformation,ExtendedDetectedErrorState,ExtendedPrinttatus,Hidden,HorizontalResolution,JobCountSinceLastReset,KeepPrintedJobs,LanguagesSupported,LastErrorCode,Local,Location,MarkingTechnology,MaxCopies,MaxNumberUp,MaxSizeSupported,MimeTypesSupported,NaturALLanguagesSupported,Network,PaperSizesSupported,PaperTypesAvailable,Parameters,PNPDeviceID,PortName,PowerManagementCapabilities,PowerManagementSupported,PrinterPaperNames,Printtate,Printtatus,PrintJobDataType,PrintProcessor,Priority,Published,Queued,RawOnly,SeparatorFile,ServerName,Shared,ShareName,SpoolEnabled,Status,StatusInfo,SystemCreationClassName,SystemName,VerticalResolution,WorkOffline') EndIf $sPC_Info &= @CRLF Local $Processors = __PCinfo_Get_Processors() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Processors') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_Processors') EndSwitch Else __Write_PCinfo($Processors, 'Processors', 'Name,AddressWidth,Architecture,Availability,Description,ConfigManagerErrorCode,ConfigManagerUserConfig,CPUStatus,CreationClassName,CurrentClockSpeed,CurrentVoltage,DataWidth,DeviceID,ErrorCleared,ErrorDescription,ExtClock,Family,L2CacheSize,L2CacheSpeed,LastErrorCode,Level,LoadPercentage,Manufacturer,MaxClockSpeed,OtherFamilyDescription,PNPDeviceID,PowerManagementCapabilities,PowerManagementSupported,ProcessorID,ProcessorType,Revision,Role,SocketDesignation,Status,StatusInfo,Stepping,SystemCreationClassName,SystemName,UniqueID,UpgradeMethod,Version,VoltageCaps') EndIf $sPC_Info &= @CRLF Local $SoundCards = __PCinfo_Get_SoundCards() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_SoundCards') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_SoundCards') EndSwitch Else __Write_PCinfo($SoundCards, 'SoundCards', 'Name,Availability,ConfigManagerErrorCode,ConfigManagerUserConfig,Description,CreationClassName,DeviceID,DMABufferSize,ErrorCleared,ErrorDescription,LastErrorCode,Manufacturer,MPU401Address,PNPDeviceID,PowerManagementCapabilities,PowerManagementSupported,ProductName,Status,StatusInfo,SystemCreationClassName,SystemName') EndIf $sPC_Info &= @CRLF Local $VideoCards = __PCinfo_Get_VideoCards() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_VideoCards') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_VideoCards') EndSwitch Else __Write_PCinfo($VideoCards, 'VideoCards', 'Name,AcceleratorCapabilities,AdapterCompatibility,AdapterDACType,Description,AdapterRAM,Availability,CapabilityDescriptions,ColorTableEntries,ConfigManagerErrorCode,ConfigManagerUserConfig,CreationClassName,CurrentBitsPerPixel,CurrentHorizontalResolution,CurrentNumberOfColors,CurrentNumberOfColumns,CurrentNumberOfRows,CurrentRefreshRate,CurrentScanMode,CurrentVerticalResolution,DeviceID,DeviceSpecificPens,DitherType,DriverDate,DriverVersion,ErrorCleared,ErrorDescription,ICMIntent,ICMMethod,InfFilename,InfSection,InstALLedDisplayDrivers,LastErrorCode,MaxMemorySupported,MaxNumberControlled,MaxRefreshRate,MinRefreshRate,Monochrome,NumberOfColorPlanes,NumberOfVideoPages,PNPDeviceID,PowerManagementCapabilities,PowerManagementSupported,ProtocolSupported,ReservedSystemPaletteEntries,SpecificationVersion,Status,StatusInfo,SystemCreationClassName,SystemName,SystemPaletteEntries,TimeOfLastReset,VideoArchitecture,VideoMemoryType,VideoMode,VideoModeDescription,VideoProcessor') EndIf $sPC_Info &= @CRLF Local $Software = __PCinfo_Get_Software() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Software') EndSwitch Else __Write_PCinfo($Software, 'Software', 'DisplayName,DisplayVersion,Publisher,InstALLDate,EstimatedSize,NoElevateOnModify,NoModify,NoRemove,NoRepair,InstALLLocation,UninstALLString') EndIf $sPC_Info &= @CRLF Local $Services = __PCinfo_Get_Services("ALL") If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Services') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_Services') EndSwitch Else __Write_PCinfo($Services, 'Services', 'Name,State,Status,AcceptPause,AcceptStop,CheckPoint,CreationClassName,DesktopInteract,DisplayName,ErrorControl,ExitCode,PathName,ProcessId,ServiceSpecificExitCode,ServiceType,Started,StartMode,StartName,SystemCreationClassName,SystemName,TagId,WaitHint,Descriptiont') EndIf $sPC_Info &= @CRLF Local $Battery = __PCinfo_Get_Battery() If @error Then $error = @error $extended = @extended Switch $extended Case 1 __PCinfo_DebugMsg($ERR_NO_INFO, '__PCinfo_Get_Battery') Case 2 __PCinfo_DebugMsg($ERR_NOT_OBJ, '__PCinfo_Get_Battery') EndSwitch Else __Write_PCinfo($Battery, 'Battery', 'Name,Availability,BatteryRechargeTime,BatteryStatus,Description,Chemistry,ConfigManagerErrorCode,ConfigManagerUserConfig,CreationClassName,DesignCapacity,DesignVoltage,DeviceID,ErrorCleared,ErrorDescription,EstimatedChargeRemaining,EstimatedRunTime,ExpectedBatteryLife,ExpectedLife,FullChargeCapacity,LastErrorCode,MaxRechargeTime,PNPDeviceID,PowerManagementCapabilities,PowerManagementSupported,SmartBatteryVersion,Status,StatusInfo,SystemCreationClassName,SystemName,TimeOnBattery,TimeToFullCharge') EndIf __PCinfo_HTML_AddFooter() Global $hO_HTML = FileOpen($sFilePath_SaveHTML, 2 + 8 + 128) FileWrite($hO_HTML, $sHTML_Content) FileClose($hO_HTML) ShellExecute($sFilePath_SaveHTML) Global $hO_Logs = FileOpen($sFilePath_SaveLog, 2 + 8 + 128) FileWrite($hO_Logs, $sLogs_Content) FileClose($hO_Logs) ShellExecute($sFilePath_SaveLog) ToolTip('') Return $sPC_Info EndFunc ;==>_Get_PCinformation Func __Write_PCinfo(ByRef $iArray, $sTitle, $iHeader) __PCinfo_Write_Array2HTML($iArray, $sTitle, $iHeader) __PCinfo_Write_Array2CSVlog($iArray, $sTitle, $iHeader) EndFunc ;==>__Write_PCinfo Func __PCinfo_DebugMsg($message, $time = 0) ConsoleWrite("! Error: " & $message & ' - Time: ' & $time & @CRLF) EndFunc ;==>__PCinfo_DebugMsg Func __PCinfo_Get_Drives($sDriveType = "ALL") Local $cDrive Local $aArray = DriveGetDrive($sDriveType) If @error Then Return Else Dim $aDriveInfo[UBound($aArray)][11] $aDriveInfo[0][0] = $aArray[0] For $i = 1 To $aArray[0] $cDrive = StringUpper($aArray[$i]) $aDriveInfo[$i][0] = $cDrive & '\' $sDriveType = DriveGetType($cDrive) $aDriveInfo[$i][1] = $sDriveType $aDriveInfo[$i][2] = DriveStatus($cDrive) $aDriveInfo[$i][3] = DriveGetFileSystem($cDrive) $aDriveInfo[$i][4] = DriveGetLabel($cDrive) $aDriveInfo[$i][5] = DriveGetSerial($cDrive) $aDriveInfo[$i][6] = Round(DriveSpaceFree($cDrive) / 1024, 2) $aDriveInfo[$i][7] = Round(DriveSpaceTotal($cDrive) / 1024, 2) $aDriveInfo[$i][8] = DriveGetType($cDrive, 3) Switch $sDriveType Case "Network" $aDriveInfo[$i][9] = DriveMapGet($cDrive) $aDriveInfo[$i][8] = 'SMB' Case "Fixed" $aDriveInfo[$i][10] = (StringUpper(DriveGetType($cDrive, 2)) == 'SSD') ? True : False EndSwitch $sDriveType = '' Next Return $aDriveInfo EndIf Return SetError(1, 0, 0) EndFunc ;==>__PCinfo_Get_Drives Func __PCinfo_Get_Desktops() Local $colItems, $objWMIService, $objItem Dim $aDesktopInfo[1][20], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Desktop", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aDesktopInfo[UBound($aDesktopInfo) + 1][20] $aDesktopInfo[$i][0] = $objItem.Name $aDesktopInfo[$i][1] = $objItem.BorderWidth $aDesktopInfo[$i][2] = $objItem.CoolSwitch $aDesktopInfo[$i][3] = $objItem.CursorBlinkRate $aDesktopInfo[$i][4] = $objItem.Description $aDesktopInfo[$i][5] = $objItem.DragFullWindows $aDesktopInfo[$i][6] = $objItem.GridGranularity $aDesktopInfo[$i][7] = $objItem.IconSpacing $aDesktopInfo[$i][8] = $objItem.IconTitleFaceName $aDesktopInfo[$i][9] = $objItem.IconTitleSize $aDesktopInfo[$i][10] = $objItem.IconTitleWrap $aDesktopInfo[$i][11] = $objItem.Pattern $aDesktopInfo[$i][12] = $objItem.ScreenSaverActive $aDesktopInfo[$i][13] = $objItem.ScreenSaverExecutable $aDesktopInfo[$i][14] = $objItem.ScreenSaverSecure $aDesktopInfo[$i][15] = $objItem.ScreenSaverTimeout $aDesktopInfo[$i][16] = $objItem.SettingID $aDesktopInfo[$i][17] = $objItem.WALLpaper $aDesktopInfo[$i][18] = $objItem.WALLpaperStretched $aDesktopInfo[$i][19] = $objItem.WALLpaperTiled $i += 1 Next $aDesktopInfo[0][0] = UBound($aDesktopInfo) - 1 If $aDesktopInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aDesktopInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_Desktops Func __PCinfo_Get_Groups() Local $colItems, $objWMIService, $objItem Dim $aGroupInfo[1][7], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Group", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aGroupInfo[UBound($aGroupInfo) + 1][7] $aGroupInfo[$i][0] = $objItem.Name $aGroupInfo[$i][1] = $objItem.Domain $aGroupInfo[$i][2] = $objItem.Status $aGroupInfo[$i][3] = $objItem.LocalAccount $aGroupInfo[$i][4] = $objItem.Description $aGroupInfo[$i][5] = $objItem.SID $aGroupInfo[$i][6] = $objItem.SIDType $i += 1 Next $aGroupInfo[0][0] = UBound($aGroupInfo) - 1 If $aGroupInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aGroupInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_Groups Func __PCinfo_Get_LoggedOnUsers() Local $colItems, $objWMIService, $objItem Local $sFilePath_SaveHTMLgedOnUserInfo, $linePattern, $aExpRet Dim $aLoggedOnUserInfo[1][3], $i = 1 $linePattern = '(?i)(?:=")([^"]*)' $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_LoggedOnUser", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems $sFilePath_SaveHTMLgedOnUserInfo &= $objItem.Antecedent $sFilePath_SaveHTMLgedOnUserInfo &= $objItem.Dependent Next $aExpRet = StringRegExp($sFilePath_SaveHTMLgedOnUserInfo, $linePattern, 3) ReDim $aLoggedOnUserInfo[UBound($aExpRet) / 3 + 1][3] Local $j = 0 For $i = 1 To UBound($aLoggedOnUserInfo) - 1 Step 1 $aLoggedOnUserInfo[$i][0] = $aExpRet[$j] $aLoggedOnUserInfo[$i][1] = $aExpRet[$j + 1] $aLoggedOnUserInfo[$i][2] = $aExpRet[$j + 2] $j += 3 Next $aLoggedOnUserInfo[0][0] = UBound($aLoggedOnUserInfo) - 1 If $aLoggedOnUserInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aLoggedOnUserInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_LoggedOnUsers Func __PCinfo_Get_OSs() Local $colItems, $objWMIService, $objItem Dim $aOSInfo[1][60], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aOSInfo[UBound($aOSInfo) + 1][60] $aOSInfo[$i][0] = $objItem.Name $aOSInfo[$i][1] = $objItem.BootDevice $aOSInfo[$i][2] = $objItem.BuildNumber $aOSInfo[$i][3] = $objItem.BuildType $aOSInfo[$i][4] = $objItem.Description $aOSInfo[$i][5] = $objItem.CodeSet $aOSInfo[$i][6] = $objItem.CountryCode $aOSInfo[$i][7] = $objItem.CreationClassName $aOSInfo[$i][8] = $objItem.CSCreationClassName $aOSInfo[$i][9] = $objItem.CSDVersion $aOSInfo[$i][10] = $objItem.CSName $aOSInfo[$i][11] = $objItem.CurrentTimeZone $aOSInfo[$i][12] = $objItem.DataExecutionPrevention_32BitApplications $aOSInfo[$i][13] = $objItem.DataExecutionPrevention_Available $aOSInfo[$i][14] = $objItem.DataExecutionPrevention_Drivers $aOSInfo[$i][15] = $objItem.DataExecutionPrevention_SupportPolicy $aOSInfo[$i][16] = $objItem.Debug $aOSInfo[$i][17] = $objItem.Distributed $aOSInfo[$i][18] = $objItem.EncryptionLevel $aOSInfo[$i][19] = $objItem.ForegroundApplicationBoost $aOSInfo[$i][20] = $objItem.FreePhysicalMemory $aOSInfo[$i][21] = $objItem.FreeSpaceInPagingFiles $aOSInfo[$i][22] = $objItem.FreeVirtualMemory $aOSInfo[$i][23] = __StringToDate($objItem.InstALLDate) $aOSInfo[$i][24] = $objItem.LargeSystemCache $aOSInfo[$i][25] = __StringToDate($objItem.LastBootUpTime) $aOSInfo[$i][26] = __StringToDate($objItem.LocalDateTime) $aOSInfo[$i][27] = $objItem.Locale $aOSInfo[$i][28] = $objItem.Manufacturer $aOSInfo[$i][29] = $objItem.MaxNumberOfProcesses $aOSInfo[$i][30] = $objItem.MaxProcessMemorySize $aOSInfo[$i][31] = $objItem.NumberOfLicensedUsers $aOSInfo[$i][32] = $objItem.NumberOfProcesses $aOSInfo[$i][33] = $objItem.NumberOfUsers $aOSInfo[$i][34] = $objItem.Organization $aOSInfo[$i][35] = $objItem.OSLanguage $aOSInfo[$i][36] = $objItem.OSProductSuite $aOSInfo[$i][37] = $objItem.OSType $aOSInfo[$i][38] = $objItem.OtherTypeDescription $aOSInfo[$i][39] = $objItem.PlusProductID $aOSInfo[$i][40] = $objItem.PlusVersionNumber $aOSInfo[$i][41] = $objItem.Primary $aOSInfo[$i][42] = $objItem.ProductType $aOSInfo[$i][45] = $objItem.RegisteredUser $aOSInfo[$i][46] = $objItem.SerialNumber $aOSInfo[$i][47] = $objItem.ServicePackMajorVersion $aOSInfo[$i][48] = $objItem.ServicePackMinorVersion $aOSInfo[$i][49] = $objItem.SizeStoredInPagingFiles $aOSInfo[$i][50] = $objItem.Status $aOSInfo[$i][51] = $objItem.SuiteMask $aOSInfo[$i][52] = $objItem.SystemDevice $aOSInfo[$i][53] = $objItem.SystemDirectory $aOSInfo[$i][54] = $objItem.SystemDrive $aOSInfo[$i][55] = $objItem.TotalSwapSpaceSize $aOSInfo[$i][56] = $objItem.TotalVirtualMemorySize $aOSInfo[$i][57] = $objItem.TotalVisibleMemorySize $aOSInfo[$i][58] = $objItem.Version $aOSInfo[$i][59] = $objItem.WindowsDirectory $i += 1 Next $aOSInfo[0][0] = UBound($aOSInfo) - 1 If $aOSInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aOSInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_OSs Func __PCinfo_Get_Services($sState = "ALL") Local $wbemFlagReturnImmediately = 0x10, $wbemFlagForwardOnly = 0x20 Local $colItems, $objWMIService, $objItem Dim $aServicesInfo[1][23], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Service", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) Then For $objItem In $colItems If $sState <> "ALL" Then If $sState = "Stopped" And $objItem.State <> "Stopped" Then ContinueLoop If $sState = "Running" And $objItem.State <> "Running" Then ContinueLoop EndIf ReDim $aServicesInfo[UBound($aServicesInfo) + 1][23] $aServicesInfo[$i][0] = $objItem.Name $aServicesInfo[$i][1] = $objItem.State $aServicesInfo[$i][2] = $objItem.Status $aServicesInfo[$i][3] = $objItem.AcceptPause $aServicesInfo[$i][4] = $objItem.AcceptStop $aServicesInfo[$i][5] = $objItem.CheckPoint $aServicesInfo[$i][6] = $objItem.CreationClassName $aServicesInfo[$i][7] = $objItem.DesktopInteract $aServicesInfo[$i][8] = $objItem.DisplayName $aServicesInfo[$i][9] = $objItem.ErrorControl $aServicesInfo[$i][10] = $objItem.ExitCode $aServicesInfo[$i][11] = $objItem.PathName $aServicesInfo[$i][12] = $objItem.ProcessId $aServicesInfo[$i][13] = $objItem.ServiceSpecificExitCode $aServicesInfo[$i][14] = $objItem.ServiceType $aServicesInfo[$i][15] = $objItem.Started $aServicesInfo[$i][16] = $objItem.StartMode $aServicesInfo[$i][17] = $objItem.StartName $aServicesInfo[$i][18] = $objItem.SystemCreationClassName $aServicesInfo[$i][19] = $objItem.SystemName $aServicesInfo[$i][20] = $objItem.TagId $aServicesInfo[$i][21] = $objItem.WaitHint $aServicesInfo[$i][22] = $objItem.Description $i += 1 Next $aServicesInfo[0][0] = UBound($aServicesInfo) - 1 If $aServicesInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aServicesInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_Services Func __PCinfo_Get_Shares() Local $colItems, $objWMIService, $objItem Dim $aShareInfo[1][8], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Share", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aShareInfo[UBound($aShareInfo) + 1][8] $aShareInfo[$i][0] = $objItem.Name $aShareInfo[$i][1] = $objItem.AccessMask $aShareInfo[$i][2] = $objItem.ALLowMaximum $aShareInfo[$i][3] = $objItem.MaximumALLowed $aShareInfo[$i][4] = $objItem.Description $aShareInfo[$i][5] = $objItem.Path $aShareInfo[$i][6] = $objItem.Status $aShareInfo[$i][7] = $objItem.Type $i += 1 Next $aShareInfo[0][0] = UBound($aShareInfo) - 1 If $aShareInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aShareInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_Shares Func __PCinfo_Get_Software() Local Const $UnInstKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\UninstALL" Local $i = 1, $SoftName, $Count = 1, $AppKey Dim $aSoftwareInfo[1][11] While 1 $AppKey = RegEnumKey($UnInstKey, $i) If @error <> 0 Then ExitLoop $SoftName = StringStripWS(StringReplace(RegRead($UnInstKey & "\" & $AppKey, "DisplayName"), "(remove only)", ""), 3) $i += 1 If ($SoftName == '') Then ContinueLoop ReDim $aSoftwareInfo[UBound($aSoftwareInfo) + 1][11] $aSoftwareInfo[$Count][0] = $SoftName $aSoftwareInfo[$Count][1] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "DisplayVersion"), 3) $aSoftwareInfo[$Count][2] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "Publisher"), 3) $aSoftwareInfo[$Count][3] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "InstALLDate"), 3) $aSoftwareInfo[$Count][4] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "EstimatedSize"), 3) $aSoftwareInfo[$Count][5] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "NoElevateOnModify"), 3) $aSoftwareInfo[$Count][6] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "NoModify"), 3) $aSoftwareInfo[$Count][7] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "NoRemove"), 3) $aSoftwareInfo[$Count][8] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "NoRepair"), 3) $aSoftwareInfo[$Count][9] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "InstALLLocation"), 3) $aSoftwareInfo[$Count][10] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "UninstALLString"), 3) $Count += 1 $AppKey = '' $SoftName = '' WEnd $aSoftwareInfo[0][0] = UBound($aSoftwareInfo, 1) - 1 If $aSoftwareInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aSoftwareInfo EndFunc ;==>__PCinfo_Get_Software Func __PCinfo_Get_Startup() Local $colItems, $objWMIService, $objItem Dim $aStartupInfo[1][6], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_StartupCommand", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aStartupInfo[UBound($aStartupInfo) + 1][6] $aStartupInfo[$i][0] = $objItem.Name $aStartupInfo[$i][1] = $objItem.User $aStartupInfo[$i][2] = $objItem.Location $aStartupInfo[$i][3] = $objItem.Command $aStartupInfo[$i][4] = $objItem.Description $aStartupInfo[$i][5] = $objItem.SettingID $i += 1 Next $aStartupInfo[0][0] = UBound($aStartupInfo) - 1 If $aStartupInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aStartupInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_Startup Func __PCinfo_Get_Users() Local $colItems, $objWMIService, $objItem Dim $aUserInfo[1][14], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_UserAccount", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aUserInfo[UBound($aUserInfo) + 1][14] $aUserInfo[$i][0] = $objItem.Name $aUserInfo[$i][1] = $objItem.Domain $aUserInfo[$i][2] = $objItem.Status $aUserInfo[$i][3] = $objItem.LocalAccount $aUserInfo[$i][4] = $objItem.Description $aUserInfo[$i][5] = $objItem.SIDType $aUserInfo[$i][6] = $objItem.SID $aUserInfo[$i][7] = $objItem.FullName $aUserInfo[$i][8] = $objItem.Disabled $aUserInfo[$i][9] = $objItem.Lockout $aUserInfo[$i][10] = $objItem.PasswordChangeable $aUserInfo[$i][11] = $objItem.PasswordExpires $aUserInfo[$i][12] = $objItem.PasswordRequired $aUserInfo[$i][13] = $objItem.AccountType $i += 1 Next $aUserInfo[0][0] = UBound($aUserInfo) - 1 If $aUserInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aUserInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_Users Func __PCinfo_Get_Battery() Local $colItems, $objWMIService, $objItem Dim $aBatteryInfo[1][31], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Battery", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aBatteryInfo[UBound($aBatteryInfo) + 1][31] $aBatteryInfo[$i][0] = $objItem.Name $aBatteryInfo[$i][1] = $objItem.Availability $aBatteryInfo[$i][2] = $objItem.BatteryRechargeTime $aBatteryInfo[$i][3] = $objItem.BatteryStatus $aBatteryInfo[$i][4] = $objItem.Description $aBatteryInfo[$i][5] = $objItem.Chemistry $aBatteryInfo[$i][6] = $objItem.ConfigManagerErrorCode $aBatteryInfo[$i][7] = $objItem.ConfigManagerUserConfig $aBatteryInfo[$i][8] = $objItem.CreationClassName $aBatteryInfo[$i][9] = $objItem.DesignCapacity $aBatteryInfo[$i][10] = $objItem.DesignVoltage $aBatteryInfo[$i][11] = $objItem.DeviceID $aBatteryInfo[$i][12] = $objItem.ErrorCleared $aBatteryInfo[$i][13] = $objItem.ErrorDescription $aBatteryInfo[$i][14] = $objItem.EstimatedChargeRemaining $aBatteryInfo[$i][15] = $objItem.EstimatedRunTime $aBatteryInfo[$i][16] = $objItem.ExpectedBatteryLife $aBatteryInfo[$i][17] = $objItem.ExpectedLife $aBatteryInfo[$i][18] = $objItem.FullChargeCapacity $aBatteryInfo[$i][19] = $objItem.LastErrorCode $aBatteryInfo[$i][20] = $objItem.MaxRechargeTime $aBatteryInfo[$i][21] = $objItem.PNPDeviceID $aBatteryInfo[$i][22] = $objItem.PowerManagementCapabilities(0) $aBatteryInfo[$i][23] = $objItem.PowerManagementSupported $aBatteryInfo[$i][24] = $objItem.SmartBatteryVersion $aBatteryInfo[$i][25] = $objItem.Status $aBatteryInfo[$i][26] = $objItem.StatusInfo $aBatteryInfo[$i][27] = $objItem.SystemCreationClassName $aBatteryInfo[$i][28] = $objItem.SystemName $aBatteryInfo[$i][29] = $objItem.TimeOnBattery $aBatteryInfo[$i][30] = $objItem.TimeToFullCharge $i += 1 Next $aBatteryInfo[0][0] = UBound($aBatteryInfo) - 1 If $aBatteryInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aBatteryInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_Battery Func __PCinfo_Get_BIOS() Local $colItems, $objWMIService, $objItem Dim $aBIOSInfo[1][25], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aBIOSInfo[UBound($aBIOSInfo) + 1][25] $aBIOSInfo[$i][0] = $objItem.Name $aBIOSInfo[$i][1] = $objItem.Status $aBIOSInfo[$i][2] = $objItem.BiosCharacteristics(0) $aBIOSInfo[$i][3] = $objItem.BIOSVersion(0) $aBIOSInfo[$i][4] = $objItem.Description $aBIOSInfo[$i][5] = $objItem.BuildNumber $aBIOSInfo[$i][6] = $objItem.CodeSet $aBIOSInfo[$i][7] = $objItem.CurrentLanguage $aBIOSInfo[$i][8] = $objItem.IdentificationCode $aBIOSInfo[$i][9] = $objItem.InstALLableLanguages $aBIOSInfo[$i][10] = $objItem.LanguageEdition $aBIOSInfo[$i][11] = $objItem.ListOfLanguages(0) $aBIOSInfo[$i][12] = $objItem.Manufacturer $aBIOSInfo[$i][13] = $objItem.OtherTargetOS $aBIOSInfo[$i][14] = $objItem.PrimaryBIOS $aBIOSInfo[$i][15] = __StringToDate($objItem.ReleaseDate) $aBIOSInfo[$i][16] = $objItem.SerialNumber $aBIOSInfo[$i][17] = $objItem.SMBIOSBIOSVersion $aBIOSInfo[$i][18] = $objItem.SMBIOSMajorVersion $aBIOSInfo[$i][19] = $objItem.SMBIOSMinorVersion $aBIOSInfo[$i][20] = $objItem.SMBIOSPresent $aBIOSInfo[$i][21] = $objItem.SoftwareElementID $aBIOSInfo[$i][22] = $objItem.SoftwareElementState $aBIOSInfo[$i][23] = $objItem.TargetOperatingSystem $aBIOSInfo[$i][24] = $objItem.Version $i += 1 Next $aBIOSInfo[0][0] = UBound($aBIOSInfo) - 1 If $aBIOSInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aBIOSInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_BIOS Func __PCinfo_Get_Keyboard() Local $colItems, $objWMIService, $objItem Dim $aKeyboardInfo[1][21], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Keyboard", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aKeyboardInfo[UBound($aKeyboardInfo) + 1][21] $aKeyboardInfo[$i][0] = $objItem.Name $aKeyboardInfo[$i][1] = $objItem.Availability $aKeyboardInfo[$i][2] = $objItem.ConfigManagerErrorCode $aKeyboardInfo[$i][3] = $objItem.ConfigManagerUserConfig $aKeyboardInfo[$i][4] = $objItem.Description $aKeyboardInfo[$i][5] = $objItem.CreationClassName $aKeyboardInfo[$i][6] = $objItem.DeviceID $aKeyboardInfo[$i][7] = $objItem.ErrorCleared $aKeyboardInfo[$i][8] = $objItem.ErrorDescription $aKeyboardInfo[$i][9] = $objItem.IsLocked $aKeyboardInfo[$i][10] = $objItem.LastErrorCode $aKeyboardInfo[$i][11] = $objItem.Layout $aKeyboardInfo[$i][12] = $objItem.NumberOfFunctionKeys $aKeyboardInfo[$i][13] = $objItem.Password $aKeyboardInfo[$i][14] = $objItem.PNPDeviceID $aKeyboardInfo[$i][15] = $objItem.PowerManagementCapabilities(0) $aKeyboardInfo[$i][16] = $objItem.PowerManagementSupported $aKeyboardInfo[$i][17] = $objItem.Status $aKeyboardInfo[$i][18] = $objItem.StatusInfo $aKeyboardInfo[$i][19] = $objItem.SystemCreationClassName $aKeyboardInfo[$i][20] = $objItem.SystemName $i += 1 Next $aKeyboardInfo[0][0] = UBound($aKeyboardInfo) - 1 If $aKeyboardInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aKeyboardInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_Keyboard Func __PCinfo_Get_Memory() Local $colItems, $objWMIService, $objItem Dim $aMemoryInfo[1][28], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMemory", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aMemoryInfo[UBound($aMemoryInfo) + 1][28] $aMemoryInfo[$i][0] = $objItem.Name $aMemoryInfo[$i][1] = $objItem.BankLabel $aMemoryInfo[$i][2] = $objItem.Capacity $aMemoryInfo[$i][3] = $objItem.CreationClassName $aMemoryInfo[$i][4] = $objItem.Description $aMemoryInfo[$i][5] = $objItem.DataWidth $aMemoryInfo[$i][6] = $objItem.DeviceLocator $aMemoryInfo[$i][7] = $objItem.FormFactor $aMemoryInfo[$i][8] = $objItem.HotSwappable $aMemoryInfo[$i][9] = $objItem.InterleaveDataDepth $aMemoryInfo[$i][10] = $objItem.InterleavePosition $aMemoryInfo[$i][11] = $objItem.Manufacturer $aMemoryInfo[$i][12] = $objItem.MemoryType $aMemoryInfo[$i][13] = $objItem.Model $aMemoryInfo[$i][14] = $objItem.OtherIdentifyingInfo $aMemoryInfo[$i][15] = $objItem.PartNumber $aMemoryInfo[$i][16] = $objItem.PositionInRow $aMemoryInfo[$i][17] = $objItem.PoweredOn $aMemoryInfo[$i][18] = $objItem.Removable $aMemoryInfo[$i][19] = $objItem.Replaceable $aMemoryInfo[$i][20] = $objItem.SerialNumber $aMemoryInfo[$i][21] = $objItem.SKU $aMemoryInfo[$i][22] = $objItem.Speed $aMemoryInfo[$i][23] = $objItem.Status $aMemoryInfo[$i][24] = $objItem.Tag $aMemoryInfo[$i][25] = $objItem.TotalWidth $aMemoryInfo[$i][26] = $objItem.TypeDetail $aMemoryInfo[$i][27] = $objItem.Version $i += 1 Next $aMemoryInfo[0][0] = UBound($aMemoryInfo) - 1 If $aMemoryInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aMemoryInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_Memory Func __PCinfo_Get_Monitors() Local $colItems, $objWMIService, $objItem Dim $aMonitorInfo[1][26], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_DesktopMonitor", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aMonitorInfo[UBound($aMonitorInfo) + 1][26] $aMonitorInfo[$i][0] = $objItem.Name $aMonitorInfo[$i][1] = $objItem.Availability $aMonitorInfo[$i][2] = $objItem.Bandwidth $aMonitorInfo[$i][3] = $objItem.ConfigManagerErrorCode $aMonitorInfo[$i][4] = $objItem.Description $aMonitorInfo[$i][5] = $objItem.ConfigManagerUserConfig $aMonitorInfo[$i][6] = $objItem.CreationClassName $aMonitorInfo[$i][7] = $objItem.DeviceID $aMonitorInfo[$i][8] = $objItem.DisplayType $aMonitorInfo[$i][9] = $objItem.ErrorCleared $aMonitorInfo[$i][10] = $objItem.ErrorDescription $aMonitorInfo[$i][11] = $objItem.IsLocked $aMonitorInfo[$i][12] = $objItem.LastErrorCode $aMonitorInfo[$i][13] = $objItem.MonitorManufacturer $aMonitorInfo[$i][14] = $objItem.MonitorType $aMonitorInfo[$i][15] = $objItem.PixelsPerXLogicalInch $aMonitorInfo[$i][16] = $objItem.PixelsPerYLogicalInch $aMonitorInfo[$i][17] = $objItem.PNPDeviceID $aMonitorInfo[$i][18] = $objItem.PowerManagementCapabilities(0) $aMonitorInfo[$i][19] = $objItem.PowerManagementSupported $aMonitorInfo[$i][20] = $objItem.ScreenHeight $aMonitorInfo[$i][21] = $objItem.ScreenWidth $aMonitorInfo[$i][22] = $objItem.Status $aMonitorInfo[$i][23] = $objItem.StatusInfo $aMonitorInfo[$i][24] = $objItem.SystemCreationClassName $aMonitorInfo[$i][25] = $objItem.SystemName $i += 1 Next $aMonitorInfo[0][0] = UBound($aMonitorInfo) - 1 If $aMonitorInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aMonitorInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_Monitors Func __PCinfo_Get_Motherboard() Local $colItems, $objWMIService, $objItem Dim $aMotherboardInfo[1][20], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_MotherboardDevice", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aMotherboardInfo[UBound($aMotherboardInfo) + 1][20] $aMotherboardInfo[$i][0] = $objItem.Name $aMotherboardInfo[$i][1] = $objItem.Availability $aMotherboardInfo[$i][2] = $objItem.ConfigManagerErrorCode $aMotherboardInfo[$i][3] = $objItem.ConfigManagerUserConfig $aMotherboardInfo[$i][4] = $objItem.Description $aMotherboardInfo[$i][5] = $objItem.CreationClassName $aMotherboardInfo[$i][6] = $objItem.DeviceID $aMotherboardInfo[$i][7] = $objItem.ErrorCleared $aMotherboardInfo[$i][8] = $objItem.ErrorDescription $aMotherboardInfo[$i][9] = $objItem.LastErrorCode $aMotherboardInfo[$i][10] = $objItem.PNPDeviceID $aMotherboardInfo[$i][11] = $objItem.PowerManagementCapabilities(0) $aMotherboardInfo[$i][12] = $objItem.PowerManagementSupported $aMotherboardInfo[$i][13] = $objItem.PrimaryBusType $aMotherboardInfo[$i][14] = $objItem.RevisionNumber $aMotherboardInfo[$i][15] = $objItem.SecondaryBusType $aMotherboardInfo[$i][16] = $objItem.Status $aMotherboardInfo[$i][17] = $objItem.StatusInfo $aMotherboardInfo[$i][18] = $objItem.SystemCreationClassName $aMotherboardInfo[$i][19] = $objItem.SystemName $i += 1 Next $aMotherboardInfo[0][0] = UBound($aMotherboardInfo) - 1 If $aMotherboardInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aMotherboardInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_Motherboard Func __PCinfo_Get_Mouse() Local $colItems, $objWMIService, $objItem Dim $aMouseInfo[1][31], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PointingDevice", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aMouseInfo[UBound($aMouseInfo) + 1][31] $aMouseInfo[$i][0] = $objItem.Name $aMouseInfo[$i][1] = $objItem.Availability $aMouseInfo[$i][2] = $objItem.ConfigManagerErrorCode $aMouseInfo[$i][3] = $objItem.ConfigManagerUserConfig $aMouseInfo[$i][4] = $objItem.Description $aMouseInfo[$i][5] = $objItem.CreationClassName $aMouseInfo[$i][6] = $objItem.DeviceID $aMouseInfo[$i][7] = $objItem.DeviceInterface $aMouseInfo[$i][8] = $objItem.DoubleSpeedThreshold $aMouseInfo[$i][9] = $objItem.ErrorCleared $aMouseInfo[$i][10] = $objItem.ErrorDescription $aMouseInfo[$i][11] = $objItem.Handedness $aMouseInfo[$i][12] = $objItem.HardwareType $aMouseInfo[$i][13] = $objItem.InfFileName $aMouseInfo[$i][14] = $objItem.InfSection $aMouseInfo[$i][15] = $objItem.IsLocked $aMouseInfo[$i][16] = $objItem.LastErrorCode $aMouseInfo[$i][17] = $objItem.Manufacturer $aMouseInfo[$i][18] = $objItem.NumberOfButtons $aMouseInfo[$i][19] = $objItem.PNPDeviceID $aMouseInfo[$i][20] = $objItem.PointingType $aMouseInfo[$i][21] = $objItem.PowerManagementCapabilities(0) $aMouseInfo[$i][22] = $objItem.PowerManagementSupported $aMouseInfo[$i][23] = $objItem.QuadSpeedThreshold $aMouseInfo[$i][24] = $objItem.Resolution $aMouseInfo[$i][25] = $objItem.SampleRate $aMouseInfo[$i][26] = $objItem.Status $aMouseInfo[$i][27] = $objItem.StatusInfo $aMouseInfo[$i][28] = $objItem.Synch $aMouseInfo[$i][29] = $objItem.SystemCreationClassName $aMouseInfo[$i][30] = $objItem.SystemName $i += 1 Next $aMouseInfo[0][0] = UBound($aMouseInfo) - 1 If $aMouseInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aMouseInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_Mouse Func __PCinfo_Get_NetworkCards() Local $colItems, $objWMIService, $objItem Dim $aNetworkInfo[1][34], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aNetworkInfo[UBound($aNetworkInfo) + 1][34] $aNetworkInfo[$i][0] = $objItem.Name $aNetworkInfo[$i][1] = $objItem.AdapterType $aNetworkInfo[$i][2] = $objItem.AdapterTypeId $aNetworkInfo[$i][3] = $objItem.AutoSense $aNetworkInfo[$i][4] = $objItem.Description $aNetworkInfo[$i][5] = $objItem.Availability $aNetworkInfo[$i][6] = $objItem.ConfigManagerErrorCode $aNetworkInfo[$i][7] = $objItem.ConfigManagerUserConfig $aNetworkInfo[$i][8] = $objItem.CreationClassName $aNetworkInfo[$i][9] = $objItem.DeviceID $aNetworkInfo[$i][10] = $objItem.ErrorCleared $aNetworkInfo[$i][11] = $objItem.ErrorDescription $aNetworkInfo[$i][12] = $objItem.Index $aNetworkInfo[$i][13] = $objItem.InstALLed $aNetworkInfo[$i][14] = $objItem.LastErrorCode $aNetworkInfo[$i][15] = $objItem.MACAddress $aNetworkInfo[$i][16] = $objItem.Manufacturer $aNetworkInfo[$i][17] = $objItem.MaxNumberControlled $aNetworkInfo[$i][18] = $objItem.MaxSpeed $aNetworkInfo[$i][19] = $objItem.NetConnectionID $aNetworkInfo[$i][20] = $objItem.NetConnectionStatus $aNetworkInfo[$i][21] = $objItem.NetworkAddresses(0) $aNetworkInfo[$i][22] = $objItem.PermanentAddress $aNetworkInfo[$i][23] = $objItem.PNPDeviceID $aNetworkInfo[$i][24] = $objItem.PowerManagementCapabilities(0) $aNetworkInfo[$i][25] = $objItem.PowerManagementSupported $aNetworkInfo[$i][26] = $objItem.ProductName $aNetworkInfo[$i][27] = $objItem.ServiceName $aNetworkInfo[$i][28] = $objItem.Speed $aNetworkInfo[$i][29] = $objItem.Status $aNetworkInfo[$i][30] = $objItem.StatusInfo $aNetworkInfo[$i][31] = $objItem.SystemCreationClassName $aNetworkInfo[$i][32] = $objItem.SystemName $aNetworkInfo[$i][33] = __StringToDate($objItem.TimeOfLastReset) $i += 1 Next $aNetworkInfo[0][0] = UBound($aNetworkInfo) - 1 If $aNetworkInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aNetworkInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_NetworkCards Func __PCinfo_Get_Printers() Local $colItems, $objWMIService, $objItem Dim $aPrinterInfo[1][85], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Printer", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aPrinterInfo[UBound($aPrinterInfo) + 1][85] $aPrinterInfo[$i][0] = $objItem.Name $aPrinterInfo[$i][1] = $objItem.Attributes $aPrinterInfo[$i][2] = $objItem.Availability $aPrinterInfo[$i][3] = $objItem.AvailableJobSheets(0) $aPrinterInfo[$i][4] = $objItem.Description $aPrinterInfo[$i][5] = $objItem.AveragePagesPerMinute $aPrinterInfo[$i][6] = $objItem.Capabilities(0) $aPrinterInfo[$i][7] = $objItem.CapabilityDescriptions(0) $aPrinterInfo[$i][8] = $objItem.CharSetsSupported(0) $aPrinterInfo[$i][9] = $objItem.Comment $aPrinterInfo[$i][10] = $objItem.ConfigManagerErrorCode $aPrinterInfo[$i][11] = $objItem.ConfigManagerUserConfig $aPrinterInfo[$i][12] = $objItem.CreationClassName $aPrinterInfo[$i][13] = $objItem.CurrentCapabilities(0) $aPrinterInfo[$i][14] = $objItem.CurrentCharSet $aPrinterInfo[$i][15] = $objItem.CurrentLanguage $aPrinterInfo[$i][16] = $objItem.CurrentMimeType $aPrinterInfo[$i][17] = $objItem.CurrentNaturALLanguage $aPrinterInfo[$i][18] = $objItem.CurrentPaperType $aPrinterInfo[$i][19] = $objItem.Default $aPrinterInfo[$i][20] = $objItem.DefaultCapabilities(0) $aPrinterInfo[$i][21] = $objItem.DefaultCopies $aPrinterInfo[$i][22] = $objItem.DefaultLanguage $aPrinterInfo[$i][23] = $objItem.DefaultMimeType $aPrinterInfo[$i][24] = $objItem.DefaultNumberUp $aPrinterInfo[$i][25] = $objItem.DefaultPaperType $aPrinterInfo[$i][26] = $objItem.DefaultPriority $aPrinterInfo[$i][27] = $objItem.DetectedErrorState $aPrinterInfo[$i][28] = $objItem.DeviceID $aPrinterInfo[$i][29] = $objItem.Direct $aPrinterInfo[$i][30] = $objItem.DoCompleteFirst $aPrinterInfo[$i][31] = $objItem.DriverName $aPrinterInfo[$i][32] = $objItem.EnableBIDI $aPrinterInfo[$i][33] = $objItem.EnableDevQueryPrint $aPrinterInfo[$i][34] = $objItem.ErrorCleared $aPrinterInfo[$i][35] = $objItem.ErrorDescription $aPrinterInfo[$i][36] = $objItem.ErrorInformation(0) $aPrinterInfo[$i][37] = $objItem.ExtendedDetectedErrorState $aPrinterInfo[$i][38] = $objItem.ExtendedPrinterStatus $aPrinterInfo[$i][39] = $objItem.Hidden $aPrinterInfo[$i][40] = $objItem.HorizontalResolution $aPrinterInfo[$i][41] = __StringToDate($objItem.InstALLDate) $aPrinterInfo[$i][42] = $objItem.JobCountSinceLastReset $aPrinterInfo[$i][43] = $objItem.KeepPrintedJobs $aPrinterInfo[$i][44] = $objItem.LanguagesSupported(0) $aPrinterInfo[$i][45] = $objItem.LastErrorCode $aPrinterInfo[$i][46] = $objItem.Local $aPrinterInfo[$i][47] = $objItem.Location $aPrinterInfo[$i][48] = $objItem.MarkingTechnology $aPrinterInfo[$i][49] = $objItem.MaxCopies $aPrinterInfo[$i][50] = $objItem.MaxNumberUp $aPrinterInfo[$i][51] = $objItem.MaxSizeSupported $aPrinterInfo[$i][52] = $objItem.MimeTypesSupported(0) $aPrinterInfo[$i][53] = $objItem.NaturALLanguagesSupported(0) $aPrinterInfo[$i][54] = $objItem.Network $aPrinterInfo[$i][55] = $objItem.PaperSizesSupported(0) $aPrinterInfo[$i][56] = $objItem.PaperTypesAvailable(0) $aPrinterInfo[$i][57] = $objItem.Parameters $aPrinterInfo[$i][58] = $objItem.PNPDeviceID $aPrinterInfo[$i][59] = $objItem.PortName $aPrinterInfo[$i][60] = $objItem.PowerManagementCapabilities(0) $aPrinterInfo[$i][61] = $objItem.PowerManagementSupported $aPrinterInfo[$i][62] = $objItem.PrinterPaperNames(0) $aPrinterInfo[$i][63] = $objItem.PrinterState $aPrinterInfo[$i][64] = $objItem.PrinterStatus $aPrinterInfo[$i][65] = $objItem.PrintJobDataType $aPrinterInfo[$i][66] = $objItem.PrintProcessor $aPrinterInfo[$i][67] = $objItem.Priority $aPrinterInfo[$i][68] = $objItem.Published $aPrinterInfo[$i][69] = $objItem.Queued $aPrinterInfo[$i][70] = $objItem.RawOnly $aPrinterInfo[$i][71] = $objItem.SeparatorFile $aPrinterInfo[$i][72] = $objItem.ServerName $aPrinterInfo[$i][73] = $objItem.Shared $aPrinterInfo[$i][74] = $objItem.ShareName $aPrinterInfo[$i][75] = $objItem.SpoolEnabled $aPrinterInfo[$i][76] = __StringToDate($objItem.StartTime) $aPrinterInfo[$i][77] = $objItem.Status $aPrinterInfo[$i][78] = $objItem.StatusInfo $aPrinterInfo[$i][79] = $objItem.SystemCreationClassName $aPrinterInfo[$i][80] = $objItem.SystemName $aPrinterInfo[$i][81] = __StringToDate($objItem.TimeOfLastReset) $aPrinterInfo[$i][82] = __StringToDate($objItem.UntilTime) $aPrinterInfo[$i][83] = $objItem.VerticalResolution $aPrinterInfo[$i][84] = $objItem.WorkOffline $i += 1 Next $aPrinterInfo[0][0] = UBound($aPrinterInfo) - 1 If $aPrinterInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aPrinterInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_Printers Func __PCinfo_Get_Processors() Local $colItems, $objWMIService, $objItem Dim $aProcessorInfo[1][42], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aProcessorInfo[UBound($aProcessorInfo) + 1][42] $aProcessorInfo[$i][0] = StringStripWS($objItem.Name, 1) $aProcessorInfo[$i][1] = $objItem.AddressWidth $aProcessorInfo[$i][2] = $objItem.Architecture $aProcessorInfo[$i][3] = $objItem.Availability $aProcessorInfo[$i][4] = $objItem.Description $aProcessorInfo[$i][5] = $objItem.ConfigManagerErrorCode $aProcessorInfo[$i][6] = $objItem.ConfigManagerUserConfig $aProcessorInfo[$i][7] = $objItem.CpuStatus $aProcessorInfo[$i][8] = $objItem.CreationClassName $aProcessorInfo[$i][9] = $objItem.CurrentClockSpeed $aProcessorInfo[$i][10] = $objItem.CurrentVoltage $aProcessorInfo[$i][11] = $objItem.DataWidth $aProcessorInfo[$i][12] = $objItem.DeviceID $aProcessorInfo[$i][13] = $objItem.ErrorCleared $aProcessorInfo[$i][14] = $objItem.ErrorDescription $aProcessorInfo[$i][15] = $objItem.ExtClock $aProcessorInfo[$i][16] = $objItem.Family $aProcessorInfo[$i][17] = $objItem.L2CacheSize $aProcessorInfo[$i][18] = $objItem.L2CacheSpeed $aProcessorInfo[$i][19] = $objItem.LastErrorCode $aProcessorInfo[$i][20] = $objItem.Level $aProcessorInfo[$i][21] = $objItem.LoadPercentage $aProcessorInfo[$i][22] = $objItem.Manufacturer $aProcessorInfo[$i][23] = $objItem.MaxClockSpeed $aProcessorInfo[$i][24] = $objItem.OtherFamilyDescription $aProcessorInfo[$i][25] = $objItem.PNPDeviceID $aProcessorInfo[$i][26] = $objItem.PowerManagementCapabilities(0) $aProcessorInfo[$i][27] = $objItem.PowerManagementSupported $aProcessorInfo[$i][28] = $objItem.ProcessorId $aProcessorInfo[$i][29] = $objItem.ProcessorType $aProcessorInfo[$i][30] = $objItem.Revision $aProcessorInfo[$i][31] = $objItem.Role $aProcessorInfo[$i][32] = $objItem.SocketDesignation $aProcessorInfo[$i][33] = $objItem.Status $aProcessorInfo[$i][34] = $objItem.StatusInfo $aProcessorInfo[$i][35] = $objItem.Stepping $aProcessorInfo[$i][36] = $objItem.SystemCreationClassName $aProcessorInfo[$i][37] = $objItem.SystemName $aProcessorInfo[$i][38] = $objItem.UniqueId $aProcessorInfo[$i][39] = $objItem.UpgradeMethod $aProcessorInfo[$i][40] = $objItem.Version $aProcessorInfo[$i][41] = $objItem.VoltageCaps $i += 1 Next $aProcessorInfo[0][0] = UBound($aProcessorInfo) - 1 If $aProcessorInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aProcessorInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_Processors Func __PCinfo_Get_SoundCards() Local $colItems, $objWMIService, $objItem Dim $aSoundCardInfo[1][21], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_SoundDevice", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aSoundCardInfo[UBound($aSoundCardInfo) + 1][21] $aSoundCardInfo[$i][0] = $objItem.Name $aSoundCardInfo[$i][1] = $objItem.Availability $aSoundCardInfo[$i][2] = $objItem.ConfigManagerErrorCode $aSoundCardInfo[$i][3] = $objItem.ConfigManagerUserConfig $aSoundCardInfo[$i][4] = $objItem.Description $aSoundCardInfo[$i][5] = $objItem.CreationClassName $aSoundCardInfo[$i][6] = $objItem.DeviceID $aSoundCardInfo[$i][7] = $objItem.DMABufferSize $aSoundCardInfo[$i][8] = $objItem.ErrorCleared $aSoundCardInfo[$i][9] = $objItem.ErrorDescription $aSoundCardInfo[$i][10] = $objItem.LastErrorCode $aSoundCardInfo[$i][11] = $objItem.Manufacturer $aSoundCardInfo[$i][12] = $objItem.MPU401Address $aSoundCardInfo[$i][13] = $objItem.PNPDeviceID $aSoundCardInfo[$i][14] = $objItem.PowerManagementCapabilities(0) $aSoundCardInfo[$i][15] = $objItem.PowerManagementSupported $aSoundCardInfo[$i][16] = $objItem.ProductName $aSoundCardInfo[$i][17] = $objItem.Status $aSoundCardInfo[$i][18] = $objItem.StatusInfo $aSoundCardInfo[$i][19] = $objItem.SystemCreationClassName $aSoundCardInfo[$i][20] = $objItem.SystemName $i += 1 Next $aSoundCardInfo[0][0] = UBound($aSoundCardInfo) - 1 If $aSoundCardInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aSoundCardInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_SoundCards Func __PCinfo_Get_System() Local $colItems, $objWMIService, $objItem Dim $aSystemInfo[1][52], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aSystemInfo[UBound($aSystemInfo) + 1][52] $aSystemInfo[$i][0] = $objItem.Name $aSystemInfo[$i][1] = $objItem.AdminPasswordStatus $aSystemInfo[$i][2] = $objItem.AutomaticResetBootOption $aSystemInfo[$i][3] = $objItem.AutomaticResetCapability $aSystemInfo[$i][4] = $objItem.Description $aSystemInfo[$i][5] = $objItem.BootOptionOnLimit $aSystemInfo[$i][6] = $objItem.BootOptionOnWatchDog $aSystemInfo[$i][7] = $objItem.BootROMSupported $aSystemInfo[$i][8] = $objItem.BootupState $aSystemInfo[$i][9] = $objItem.ChassisBootupState $aSystemInfo[$i][10] = $objItem.CreationClassName $aSystemInfo[$i][11] = $objItem.CurrentTimeZone $aSystemInfo[$i][12] = $objItem.DaylightInEffect $aSystemInfo[$i][13] = $objItem.Domain $aSystemInfo[$i][14] = $objItem.DomainRole $aSystemInfo[$i][15] = $objItem.EnableDaylightSavingsTime $aSystemInfo[$i][16] = $objItem.FrontPanelResetStatus $aSystemInfo[$i][17] = $objItem.InfraredSupported $aSystemInfo[$i][18] = $objItem.InitiALLoadInfo(0) $aSystemInfo[$i][19] = $objItem.KeyboardPasswordStatus $aSystemInfo[$i][20] = $objItem.LastLoadInfo $aSystemInfo[$i][21] = $objItem.Manufacturer $aSystemInfo[$i][22] = $objItem.Model $aSystemInfo[$i][23] = $objItem.NameFormat $aSystemInfo[$i][24] = $objItem.NetworkServerModeEnabled $aSystemInfo[$i][25] = $objItem.NumberOfProcessors $aSystemInfo[$i][26] = $objItem.OEMLogoBitmap(0) $aSystemInfo[$i][27] = $objItem.OEMStringArray(0) $aSystemInfo[$i][28] = $objItem.PartOfDomain $aSystemInfo[$i][29] = $objItem.PauseAfterReset $aSystemInfo[$i][30] = $objItem.PowerManagementCapabilities(0) $aSystemInfo[$i][31] = $objItem.PowerManagementSupported $aSystemInfo[$i][32] = $objItem.PowerOnPasswordStatus $aSystemInfo[$i][33] = $objItem.PowerState $aSystemInfo[$i][34] = $objItem.PowerSupplyState $aSystemInfo[$i][35] = $objItem.PrimaryOwnerContact $aSystemInfo[$i][36] = $objItem.PrimaryOwnerName $aSystemInfo[$i][37] = $objItem.ResetCapability $aSystemInfo[$i][38] = $objItem.ResetCount $aSystemInfo[$i][39] = $objItem.ResetLimit $aSystemInfo[$i][40] = $objItem.Roles(0) $aSystemInfo[$i][41] = $objItem.Status $aSystemInfo[$i][42] = $objItem.SupportContactDescription(0) $aSystemInfo[$i][43] = $objItem.SystemStartupDelay $aSystemInfo[$i][44] = $objItem.SystemStartupOptions(0) $aSystemInfo[$i][45] = $objItem.SystemStartupSetting $aSystemInfo[$i][46] = $objItem.SystemType $aSystemInfo[$i][47] = $objItem.ThermalState $aSystemInfo[$i][48] = $objItem.TotalPhysicalMemory $aSystemInfo[$i][49] = $objItem.UserName $aSystemInfo[$i][50] = $objItem.WakeUpType $aSystemInfo[$i][51] = $objItem.Workgroup $i += 1 Next $aSystemInfo[0][0] = UBound($aSystemInfo) - 1 If $aSystemInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aSystemInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_System Func __PCinfo_Get_SystemProduct() Local $colItems, $objWMIService, $objItem Dim $aSysProductInfo[1][7], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystemProduct", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aSysProductInfo[UBound($aSysProductInfo) + 1][7] $aSysProductInfo[$i][0] = $objItem.Name $aSysProductInfo[$i][1] = $objItem.IdentifyingNumber $aSysProductInfo[$i][2] = $objItem.SKUNumber $aSysProductInfo[$i][3] = $objItem.UUID $aSysProductInfo[$i][4] = $objItem.Description $aSysProductInfo[$i][5] = $objItem.Vendor $aSysProductInfo[$i][6] = $objItem.Version $i += 1 Next $aSysProductInfo[0][0] = UBound($aSysProductInfo) - 1 If $aSysProductInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aSysProductInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_SystemProduct Func __PCinfo_Get_VideoCards() Local $colItems, $objWMIService, $objItem Dim $aVideoInfo[1][59], $i = 1 $objWMIService = ObjGet("winmgmts:\\" & $cI_CompName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_VideoController", "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems ReDim $aVideoInfo[UBound($aVideoInfo) + 1][59] $aVideoInfo[$i][0] = $objItem.Name $aVideoInfo[$i][1] = $objItem.AcceleratorCapabilities(0) $aVideoInfo[$i][2] = $objItem.AdapterCompatibility $aVideoInfo[$i][3] = $objItem.AdapterDACType $aVideoInfo[$i][4] = $objItem.Description $aVideoInfo[$i][5] = $objItem.AdapterRAM $aVideoInfo[$i][6] = $objItem.Availability $aVideoInfo[$i][7] = $objItem.CapabilityDescriptions(0) $aVideoInfo[$i][8] = $objItem.ColorTableEntries $aVideoInfo[$i][9] = $objItem.ConfigManagerErrorCode $aVideoInfo[$i][10] = $objItem.ConfigManagerUserConfig $aVideoInfo[$i][11] = $objItem.CreationClassName $aVideoInfo[$i][12] = $objItem.CurrentBitsPerPixel $aVideoInfo[$i][13] = $objItem.CurrentHorizontalResolution $aVideoInfo[$i][14] = $objItem.CurrentNumberOfColors $aVideoInfo[$i][15] = $objItem.CurrentNumberOfColumns $aVideoInfo[$i][16] = $objItem.CurrentNumberOfRows $aVideoInfo[$i][17] = $objItem.CurrentRefreshRate $aVideoInfo[$i][18] = $objItem.CurrentScanMode $aVideoInfo[$i][19] = $objItem.CurrentVerticalResolution $aVideoInfo[$i][20] = $objItem.DeviceID $aVideoInfo[$i][21] = $objItem.DeviceSpecificPens $aVideoInfo[$i][22] = $objItem.DitherType $aVideoInfo[$i][23] = __StringToDate($objItem.DriverDate) $aVideoInfo[$i][24] = $objItem.DriverVersion $aVideoInfo[$i][25] = $objItem.ErrorCleared $aVideoInfo[$i][26] = $objItem.ErrorDescription $aVideoInfo[$i][27] = $objItem.ICMIntent $aVideoInfo[$i][28] = $objItem.ICMMethod $aVideoInfo[$i][29] = $objItem.InfFilename $aVideoInfo[$i][30] = $objItem.InfSection $aVideoInfo[$i][31] = $objItem.InstALLedDisplayDrivers $aVideoInfo[$i][32] = $objItem.LastErrorCode $aVideoInfo[$i][33] = $objItem.MaxMemorySupported $aVideoInfo[$i][34] = $objItem.MaxNumberControlled $aVideoInfo[$i][35] = $objItem.MaxRefreshRate $aVideoInfo[$i][36] = $objItem.MinRefreshRate $aVideoInfo[$i][37] = $objItem.Monochrome $aVideoInfo[$i][38] = $objItem.NumberOfColorPlanes $aVideoInfo[$i][39] = $objItem.NumberOfVideoPages $aVideoInfo[$i][40] = $objItem.PNPDeviceID $aVideoInfo[$i][41] = $objItem.PowerManagementCapabilities(0) $aVideoInfo[$i][42] = $objItem.PowerManagementSupported $aVideoInfo[$i][43] = $objItem.ProtocolSupported $aVideoInfo[$i][44] = $objItem.ReservedSystemPaletteEntries $aVideoInfo[$i][45] = $objItem.SpecificationVersion $aVideoInfo[$i][46] = $objItem.Status $aVideoInfo[$i][47] = $objItem.StatusInfo $aVideoInfo[$i][48] = $objItem.SystemCreationClassName $aVideoInfo[$i][49] = $objItem.SystemName $aVideoInfo[$i][50] = $objItem.SystemPaletteEntries $aVideoInfo[$i][51] = __StringToDate($objItem.TimeOfLastReset) $aVideoInfo[$i][52] = $objItem.VideoArchitecture $aVideoInfo[$i][53] = $objItem.VideoMemoryType $aVideoInfo[$i][54] = $objItem.VideoMode $aVideoInfo[$i][55] = $objItem.VideoModeDescription $aVideoInfo[$i][56] = $objItem.VideoProcessor $i += 1 Next $aVideoInfo[0][0] = UBound($aVideoInfo) - 1 If $aVideoInfo[0][0] < 1 Then SetError(1, 1, 0) EndIf Return $aVideoInfo Else SetError(1, 2, 0) EndIf EndFunc ;==>__PCinfo_Get_VideoCards Func __StringToDate($dtmDate) Return (StringMid($dtmDate, 5, 2) & "/" & StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) & " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate, 13, 2)) EndFunc ;==>__StringToDate Func __PCinfo_Write_Array2HTML($iArray, $sTitle = '', $TableHeader = '') Local $varRowColorValue, $xDim = UBound($iArray, 1) - 1 Local $yDim = UBound($iArray, 2) - 1 $sHTML_Content &= "<div class=""container""><h3><a href='#" & StringReplace($sTitle, " ", "_") & "' data-toggle='collapse'>" & $sTitle & "</a></h3>" & @CRLF $sHTML_Content &= "<div id='" & StringReplace($sTitle, " ", "_") & "' class='collapse'><table border='0'>" & @CRLF If ($TableHeader <> "") And ($TableHeader <> Default) Then If StringInStr($TableHeader, ',') Then Local $aHeader = StringSplit($TableHeader, ',', 1) If IsArray($aHeader) Then $sHTML_Content &= '<tr bgcolor="#C4E1FF">' & @CRLF For $h = 1 To $aHeader[0] If ($h == 1) Then $sHTML_Content &= "<td><center>" & $aHeader[$h] & "</center></td>" & @CRLF Else $sHTML_Content &= "<td>" & $aHeader[$h] & "</td>" & @CRLF EndIf Next $sHTML_Content &= "</tr>" & @CRLF EndIf EndIf EndIf Local $varRowColor = 0 For $x = 0 To $xDim If $varRowColor = 0 Then $varRowColor = 1 $varRowColorValue = "#9BCDFF" Else $varRowColor = 0 $varRowColorValue = "#C4E1FF" EndIf $sHTML_Content &= "<tr bgcolor='" & $varRowColorValue & "'>" & @CRLF For $y = 0 To $yDim If ($y == 0) Then $sHTML_Content &= "<td><center>" & StringReplace($iArray[$x][$y], '|', @CRLF) & "</center></td>" & @CRLF Else $sHTML_Content &= "<td>" & StringReplace($iArray[$x][$y], '|', @CRLF) & "</td>" & @CRLF EndIf Next $sHTML_Content &= "</tr>" & @CRLF Next $sHTML_Content &= "</table></div></div></br>" & @CRLF & @CRLF EndFunc ;==>__PCinfo_Write_Array2HTML Func __PCinfo_Write_Array2CSVlog($iArray, $sTitle = '', $LogHeader = '') Local $xDim = UBound($iArray, 1) - 1 Local $yDim = UBound($iArray, 2) - 1 $sLogs_Content &= @CRLF & '# ' & $sTitle & ' :---------------------------------------------\' & @CRLF If ($LogHeader <> "") And ($LogHeader <> Default) Then $sLogs_Content &= $LogHeader & @CRLF For $x = 0 To $xDim For $y = 0 To $yDim If (StringStripWS($iArray[$x][$y], 8) == '') Then ContinueLoop $sLogs_Content &= '"' & $iArray[$x][$y] & '"' If $y < $yDim Then $sLogs_Content &= "," Else $sLogs_Content &= @CRLF EndIf Next Next $sLogs_Content &= @CRLF & '# ' & $sTitle & ' :---------------------------------------------/' & @CRLF & @CRLF EndFunc ;==>__PCinfo_Write_Array2CSVlog Func __PCinfo_HTML_AddHeader($sTitle = @ComputerName & " System Info") $sHTML_Content &= '<html>' & @CRLF $sHTML_Content &= '<head><meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" /><title>' & $sTitle & '</title>' & @CRLF $sHTML_Content &= '<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">' & @CRLF $sHTML_Content &= '<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>' & @CRLF $sHTML_Content &= '<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>' & @CRLF $sHTML_Content &= '<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>-->' & @CRLF $sHTML_Content &= '</head>' & @CRLF $sHTML_Content &= "<body><title>" & $sTitle & "</title>" & @CRLF & "<div class=""jumbotron jumbotron-fluid""><div class=""container""><center><h1>" & $sTitle & "</h1></div></div>" & "<div class=""container"">Scan Initiated: " & @MON & "/" & @MDAY & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & "</br></br></br></div>" & @CRLF EndFunc ;==>__PCinfo_HTML_AddHeader Func __PCinfo_HTML_AddFooter() $sHTML_Content &= "</div></br><div class=""container"">Scan Complete: " & @MON & "/" & @MDAY & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & "</div>" & @CRLF $sHTML_Content &= '</body></html>' & @CRLF EndFunc ;==>__PCinfo_HTML_AddFooter Func __PCinfo_Get_SysOverview() Dim $aWin_Info[13][2] $aWin_Info[0][0] = 12 $aWin_Info[1][0] = '' & 'ComputerName' $aWin_Info[1][1] = '' & @ComputerName $aWin_Info[2][0] = 'UserName' $aWin_Info[2][1] = @UserName Local $_winver = FileGetVersion(@SystemDir & "\ntoskrnl.exe") If @error Then $_winver = FileGetVersion(@SystemDir & "\winver.exe") If $isWin64 Then $aWin_Info[3][0] = '' & 'ProductName' $aWin_Info[3][1] = RegRead('HKLM64\SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'ProductName') & ' ' & RegRead('HKLM64\SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'DisplayVersion') & ' ' & $_winver & ' ' & @CPUArch & ((@OSServicePack <> '') ? ' ' & @OSServicePack : '') Else $aWin_Info[3][0] = '' & 'ProductName' $aWin_Info[3][1] = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'ProductName') & ' ' & RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'DisplayVersion') & ' ' & $_winver & ' ' & @CPUArch & ((@OSServicePack <> '') ? ' ' & @OSServicePack : '') EndIf Local $cpu_ProcessorName = RegRead('HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0', "ProcessorNameString") Local $cpu_Identifier = RegRead('HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0', "Identifier") If $cpu_ProcessorName = '' Then $cpu_ProcessorName = RegRead('HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\1', "ProcessorNameString") If $cpu_Identifier = '' Then $cpu_Identifier = RegRead('HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\1', "Identifier") Local $main_Manufacturer = RegRead('HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS', "BaseBoardManufacturer") If $main_Manufacturer <> '' Then $main_Manufacturer = RegRead('HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS', "BIOSVendor") If $main_Manufacturer <> '' Then $main_Manufacturer = RegRead('HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS', "SystemManufacturer") Local $main_Family = RegRead('HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS', "SystemFamily") If $main_Family = '' Then $main_Family = RegRead('HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS', "SystemVersion") Local $main_ProductName = RegRead('HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS', "SystemProductName") If $cpu_ProcessorName <> '' Then If $cpu_Identifier <> '' Then $aWin_Info[4][0] = '' & 'ProcessorName' $aWin_Info[4][1] = '' & $cpu_ProcessorName & ' / ' & $cpu_Identifier Else $aWin_Info[4][0] = '' & 'ProcessorName' $aWin_Info[4][1] = '' & $cpu_ProcessorName EndIf EndIf Local $aMemStats = MemGetStats() If IsArray($aMemStats) Then If UBound($aMemStats) = 7 Then $aWin_Info[5][0] = '' & 'RAM' $aWin_Info[5][1] = 'Physical: ' & Round($aMemStats[1] / 1024 / 1024, 2) & ' GB (Free: ' & Round($aMemStats[2] / 1024 / 1024, 2) & ' GB) / Page Size: ' & Round($aMemStats[3] / 1024 / 1024, 2) & ' GB (Free: ' & Round($aMemStats[4] / 1024 / 1024, 2) & ' GB)' EndIf EndIf Local $sManufacturer If $main_Manufacturer <> '' Then If $main_Family <> '' Then $sManufacturer &= '' & $main_Manufacturer & ' / ' & $main_Family EndIf If $main_ProductName <> '' Then $sManufacturer &= '' & $main_Manufacturer & ' / ' & $main_Family & ' / ' & $main_ProductName EndIf $aWin_Info[6][0] = '' & 'Manufacturer' $aWin_Info[6][1] = $sManufacturer EndIf Local $tzinfo = __PCinfo_dtGetTimeZoneInformation() If IsArray($tzinfo) Then If $tzinfo[2] <> '' Then $aWin_Info[7][0] = 'TimeZone' $aWin_Info[7][1] = '' & $tzinfo[2] EndIf EndIf $aWin_Info[8][0] = '' & 'OS' $aWin_Info[8][1] = 'OSVersion: ' & @OSVersion & ' / OSArch: ' & @OSArch & ' / OSLang: ' & @OSLang & ' / OSType: ' & @OSType & ' / OSBuild: ' & @OSBuild & ' / MUILang: ' & @MUILang & ' / Keyboard Layout: ' & @KBLayout $aWin_Info[9][0] = '' & 'Desktop' $aWin_Info[9][1] = 'Width x Height: ' & @DesktopWidth & ' x ' & @DesktopHeight & ' / ColorDepth: ' & @DesktopDepth & ' / Refresh: ' & @DesktopRefresh $aWin_Info[10][0] = '' & 'Environment [Path]' $aWin_Info[10][1] = '' & EnvGet("Path") $aWin_Info[11][0] = '' & 'Home' $aWin_Info[11][1] = '[HomeDrive: ' & @HomeDrive & '] [HomePath: ' & @HomePath & '] [HomeShare: ' & @HomeShare & ']' $aWin_Info[12][0] = '' & 'Logon' $aWin_Info[12][1] = '[Domain: ' & @LogonDomain & '] [Server: ' & @LogonServer & '] [DNS: ' & @LogonDNSDomain & ']' Return $aWin_Info EndFunc ;==>__PCinfo_Get_SysOverview Func __PCinfo_StringStripCRWS($String, $removeSpace = 0) $String = StringStripCR($String) $String = StringStripWS($String, 7) $String = StringReplace($String, @LF, ' ') $String = StringReplace($String, @CRLF, ' ') $String = StringReplace($String, @CR, ' ') While StringInStr($String, ' ' & ' ') $String = StringReplace($String, ' ' & ' ', ' ') WEnd If $removeSpace > 0 Then Return StringStripWS($String, 8) If StringStripWS($String, 8) == '' Then Return '' Return $String EndFunc ;==>__PCinfo_StringStripCRWS Func __PCinfo_Get_AdaptersInfo($sComputer = ".") Local $Cols = 20, $strIndex, $objVAR, $objVARx, $zAdapter, $zAdapterName, $zSpeed, $zIndex, $zInterfaceIndex, $zGetIPType, $zAdapterStatus, $zIP, $zMAC, $zSubNetIP, $zGetwayIP, $zGetwayMAC Local $aReturn[1][$Cols] = [[0, $Cols]] If $sComputer = Default Then $sComputer = @ComputerName Local $sListIndexInterfaceName = __PCinfo_Get_ListIndexInterfaceName() Local $objwmi = ObjGet("winmgmts:\\" & $sComputer & "\root\cimv2") Local $objWQLx = $objwmi.ExecQuery("SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionID != NULL", "WQL", 0x30) If Not @error And IsObj($objWQLx) Then For $objVARx In $objWQLx $zAdapterName = $objVARx.NetConnectionID If (__PCinfo_StringStripCRWS($zAdapterName) = "") Then ContinueLoop $zSpeed = __PCinfo_ByteSuffixRound($objVARx.Speed) If Int($zSpeed) <= 0 Then For $z = 0 To UBound($sListIndexInterfaceName) - 1 If $sListIndexInterfaceName[$z][1] = $zAdapterName Then $zSpeed = __PCinfo_ByteSuffixRound(__PCinfo_Get_InterfaceIndexSpeed($sListIndexInterfaceName[$z][0])) Next EndIf $zAdapterStatus = $objVARx.NetConnectionStatus Switch $zAdapterStatus Case 0, 3 $zAdapterStatus = "Disable" Case 1, 2 $zAdapterStatus = "Connected" Case $zAdapterStatus = 7 $zAdapterStatus = "unPlugged" Case Else $zAdapterStatus = "N/A" EndSwitch $strIndex = $objVARx.Index Local $objWQL = $objwmi.ExecQuery('SELECT * FROM Win32_NetworkAdapterConfiguration WHERE Index=' & $strIndex, "WQL", 0x30) If Not @error And IsObj($objWQL) Then For $objVAR In $objWQL $zAdapter = $objVAR.Description $aReturn[0][0] += 1 $zIndex = $aReturn[0][0] ReDim $aReturn[$zIndex * 2][$aReturn[0][1]] $zInterfaceIndex = $objVAR.InterfaceIndex If Int($zInterfaceIndex) <= 0 Then For $z = 0 To UBound($sListIndexInterfaceName) - 1 If $sListIndexInterfaceName[$z][1] = $zAdapterName Then $zInterfaceIndex = $sListIndexInterfaceName[$z][0] Next EndIf $aReturn[$zIndex][0] = $zInterfaceIndex $aReturn[$zIndex][1] = $zAdapter $aReturn[$zIndex][2] = $zAdapterName $aReturn[$zIndex][3] = $zAdapterStatus $zGetIPType = $objVAR.DHCPEnabled If $zGetIPType Then $zGetIPType = "DHCP" Else $zGetIPType = "StaticIP" EndIf $aReturn[$zIndex][4] = $zGetIPType $zIP = $objVAR.IPAddress(0) If __PCinfo_StringStripCRWS($zIP) = "" Then $zIP = "N/A" $aReturn[$zIndex][5] = $zIP $zSubNetIP = $objVAR.IPSubnet(0) If __PCinfo_StringStripCRWS($zSubNetIP) = "" Then $zSubNetIP = "N/A" $aReturn[$zIndex][6] = $zSubNetIP $zMAC = $objVAR.MACAddress If __PCinfo_StringStripCRWS($zMAC) = "" Then $zMAC = "N/A" $aReturn[$zIndex][7] = $zMAC $zGetwayIP = $objVAR.DefaultIPGateway(0) If __PCinfo_StringStripCRWS($zGetwayIP) = "" Then $zGetwayIP = "N/A" $aReturn[$zIndex][8] = $zGetwayIP $zGetwayMAC = "N/A" If __PCinfo_StringStripCRWS($zGetwayIP) <> "N/A" Then $zGetwayMAC = __PCinfo_Get_MACFromIP($zGetwayIP) $aReturn[$zIndex][9] = $zGetwayMAC If Number($zSpeed) = 0 Then $zSpeed = "N/A" $aReturn[$zIndex][10] = $zSpeed $aReturn[$zIndex][11] = "N/A" $aReturn[$zIndex][12] = "N/A" $aReturn[$zIndex][13] = "N/A" $aReturn[$zIndex][14] = "N/A" $aReturn[$zIndex][15] = "N/A" $aReturn[$zIndex][16] = "N/A" $aReturn[$zIndex][17] = "N/A" $aReturn[$zIndex][18] = "N/A" Local $zDNS = $objVAR.DNSServerSearchOrder() Local $dnsCount = UBound($zDNS) $aReturn[$zIndex][19] = $dnsCount If IsArray($zDNS) Then Switch $dnsCount Case 1 $aReturn[$zIndex][11] = $zDNS[0] Case 2 $aReturn[$zIndex][11] = $zDNS[0] $aReturn[$zIndex][12] = $zDNS[1] Case 3 $aReturn[$zIndex][11] = $zDNS[0] $aReturn[$zIndex][12] = $zDNS[1] $aReturn[$zIndex][13] = $zDNS[2] Case 4 $aReturn[$zIndex][11] = $zDNS[0] $aReturn[$zIndex][12] = $zDNS[1] $aReturn[$zIndex][13] = $zDNS[2] $aReturn[$zIndex][14] = $zDNS[3] Case 5 $aReturn[$zIndex][11] = $zDNS[0] $aReturn[$zIndex][12] = $zDNS[1] $aReturn[$zIndex][13] = $zDNS[2] $aReturn[$zIndex][14] = $zDNS[3] $aReturn[$zIndex][15] = $zDNS[4] Case 6 $aReturn[$zIndex][11] = $zDNS[0] $aReturn[$zIndex][12] = $zDNS[1] $aReturn[$zIndex][13] = $zDNS[2] $aReturn[$zIndex][14] = $zDNS[3] $aReturn[$zIndex][15] = $zDNS[4] $aReturn[$zIndex][16] = $zDNS[5] Case 7 $aReturn[$zIndex][11] = $zDNS[0] $aReturn[$zIndex][12] = $zDNS[1] $aReturn[$zIndex][13] = $zDNS[2] $aReturn[$zIndex][14] = $zDNS[3] $aReturn[$zIndex][15] = $zDNS[4] $aReturn[$zIndex][16] = $zDNS[5] $aReturn[$zIndex][17] = $zDNS[6] Case 8 $aReturn[$zIndex][11] = $zDNS[0] $aReturn[$zIndex][12] = $zDNS[1] $aReturn[$zIndex][13] = $zDNS[2] $aReturn[$zIndex][14] = $zDNS[3] $aReturn[$zIndex][15] = $zDNS[4] $aReturn[$zIndex][16] = $zDNS[5] $aReturn[$zIndex][17] = $zDNS[6] $aReturn[$zIndex][18] = $zDNS[7] Case Else $aReturn[$zIndex][11] = $zDNS[0] EndSwitch EndIf Next EndIf Next Return $aReturn EndIf Return SetError(1, 0, "") EndFunc ;==>__PCinfo_Get_AdaptersInfo Func __PCinfo_Get_ListIndexInterfaceName() Local Const $tagIP_ADAPTER_ADDRESSES = "ulong Length;dword IfIndex;ptr Next;ptr AdapterName;ptr FirstUnicastAddress;" & "ptr FirstAnycastAddress;ptr FirstMulticastAddress;ptr FirstDnsServerAddress;ptr DnsSuffix;ptr Description;" & "ptr FriendlyName;byte PhysicalAddress[8];dword PhysicalAddressLength;dword Flags;dword Mtu;dword IfType;int OperStatus;" & "dword Ipv6IfIndex;dword ZoneIndices[16];ptr FirstPrefix;" & "uint64 TransmitLinkSpeed;uint64 ReceiveLinkSpeed;ptr FirstWinsServerAddress;ptr FirstGatewayAddress;" & "ulong Ipv4Metric;ulong Ipv6Metric;uint64 Luid;STRUCT;ptr Dhcpv4ServerSockAddr;int Dhcpv4ServerSockAddrLen;ENDSTRUCT;" & "ulong CompartmentId;STRUCT;ulong NetworkGuidData1;word NetworkGuidData2;word NetworkGuidData3;byte NetworkGuidData4[8];ENDSTRUCT;" & "int ConnectionType;int TunnelType;STRUCT;ptr Dhcpv6ServerSockAddr;int Dhcpv6ServerSockAddrLen;ENDSTRUCT;byte Dhcpv6ClientDuid[130];" & "ulong Dhcpv6ClientDuidLength;ulong Dhcpv6Iaid;ptr FirstDnsSuffix;" Local $aret, $nBufSize, $stBuffer, $stIP_ADAPTER_ADDRESSES, $pIPAAStruct, $nIPAAStSize Local $pTemp, $nTemp, $nEntries, $aIndexEntries $aret = DllCall("iphlpapi.dll", "ulong", "GetAdaptersAddresses", "ulong", 0, "ulong", 0x86, "ptr", 0, "ptr", 0, "ulong*", 0) If @error Then Return SetError(1, @error, "") If $aret[0] Then If $aret[0] <> 111 Or Not $aret[5] Then Return SetError(2, $aret[0], "") EndIf $nBufSize = $aret[5] $stBuffer = DllStructCreate("int64;byte [" & $nBufSize & "];") $aret = DllCall("iphlpapi.dll", "ulong", "GetAdaptersAddresses", "ulong", 0, "ulong", 0x86, "ptr", 0, "ptr", DllStructGetPtr($stBuffer), "ulong*", $nBufSize) If @error Then Return SetError(1, @error, "") If $aret[0] Then Return SetError(2, $aret[0], "") Dim $aIndexEntries[Floor($nBufSize / 72)][2] $nEntries = 0 $pIPAAStruct = DllStructGetPtr($stBuffer) While $pIPAAStruct <> 0 $stIP_ADAPTER_ADDRESSES = DllStructCreate($tagIP_ADAPTER_ADDRESSES, $pIPAAStruct) $nIPAAStSize = DllStructGetData($stIP_ADAPTER_ADDRESSES, "Length") $nTemp = DllStructGetData($stIP_ADAPTER_ADDRESSES, "OperStatus") If ($nTemp = 2 And Not False) Or DllStructGetData($stIP_ADAPTER_ADDRESSES, "IfType") = 24 Then Else $pTemp = DllStructGetData($stIP_ADAPTER_ADDRESSES, "FirstUnicastAddress") If $pTemp <> 0 Then $aIndexEntries[$nEntries][0] = DllStructGetData($stIP_ADAPTER_ADDRESSES, "IfIndex") $aIndexEntries[$nEntries][1] = __PCinfo_Get_StringWFromPtr(DllStructGetData($stIP_ADAPTER_ADDRESSES, "FriendlyName")) $nEntries += 1 EndIf EndIf $pIPAAStruct = DllStructGetData($stIP_ADAPTER_ADDRESSES, "Next") WEnd If $nEntries = 0 Then Return SetError(-1, 0, "") ReDim $aIndexEntries[$nEntries][2] Return SetExtended($nEntries, $aIndexEntries) EndFunc ;==>__PCinfo_Get_ListIndexInterfaceName Func __PCinfo_Get_InterfaceIndexSpeed($IfIndex) Local $tBuffer, $pBuffer, $iResult, $iSpeed $tBuffer = DllStructCreate("wchar[256];dword[5];byte[8];dword[16];char[256]") $pBuffer = DllStructGetPtr($tBuffer) DllStructSetData($tBuffer, 2, $IfIndex, 1) $iResult = DllCall("iphlpapi.dll", "long", "GetIfEntry", "ptr", $pBuffer) If @error Then Return SetError(@error, @extended, 0) $iSpeed = DllStructGetData($tBuffer, 2, 4) $tBuffer = 0 Return SetError($iResult[0], $iSpeed / 1000 / 1000, $iSpeed) EndFunc ;==>__PCinfo_Get_InterfaceIndexSpeed Func __PCinfo_Get_StringWFromPtr($pStr) If Not IsPtr($pStr) Or $pStr = 0 Then Return SetError(1, 0, "") Local $aret = DllCall("kernel32.dll", "ptr", "lstrcpynW", "wstr", "", "ptr", $pStr, "int", 32767) If @error Or Not $aret[0] Then Return SetError(@error, 0, "") Return $aret[1] EndFunc ;==>__PCinfo_Get_StringWFromPtr Func __PCinfo_Get_MACFromIP($rMAC) If ($rMAC = "") Or ($rMAC = "N/A") Then Return "N/A" Local $sbMAC = DllStructCreate("byte[6]") Local $siMAC = DllStructCreate("int") DllStructSetData($siMAC, 1, 6) Local $rHexMAC = DllCall("Ws2_32.dll", "int", "inet_addr", "str", $rMAC) $rMAC = $rHexMAC[0] $rHexMAC = DllCall("iphlpapi.dll", "int", "SendARP", "int", $rMAC, "int", 0, "ptr", DllStructGetPtr($sbMAC), "ptr", DllStructGetPtr($siMAC)) $rMAC = "" For $i = 0 To 5 If $i Then $rMAC &= ":" $rMAC = $rMAC & Hex(DllStructGetData($sbMAC, 1, $i + 1), 2) Next If ($rMAC = "") Or ($rMAC = $sBlankMAC) Or ($rMAC = "N/A") Then Return "N/A" Return $rMAC EndFunc ;==>__PCinfo_Get_MACFromIP Func __PCinfo_ByteSuffixRound($iBytes, $iRound = 2) $iBytes = Number($iBytes) If $iBytes > 1000000000 Then Return "N/A" Local $a, $aArray[5] = ["Bps", "Kbps", "Mbps", "Gbps", "Tbps"] While $iBytes > 999 $a += 1 If $a > 3 Then ExitLoop $iBytes /= 1000 WEnd Return Round($iBytes, $iRound) & " " & $aArray[$a] EndFunc ;==>__PCinfo_ByteSuffixRound Func __PCinfo_Singleton($sOccurrenceName, $iFlag = 0) Local Const $ERROR_ALREADY_EXISTS = 183 Local Const $SECURITY_DESCRIPTOR_REVISION = 1 Local $tSecurityAttributes = 0 If BitAND($iFlag, 2) Then Local $tSecurityDescriptor = DllStructCreate("byte;byte;word;ptr[4]") Local $aCALL = DllCall("advapi32.dll", "bool", "InitializeSecurityDescriptor", "struct*", $tSecurityDescriptor, "dword", $SECURITY_DESCRIPTOR_REVISION) If @error Then Return SetError(@error, @extended, 0) If $aCALL[0] Then $aCALL = DllCall("advapi32.dll", "bool", "SetSecurityDescriptorDacl", "struct*", $tSecurityDescriptor, "bool", 1, "ptr", 0, "bool", 0) If @error Then Return SetError(@error, @extended, 0) If $aCALL[0] Then $tSecurityAttributes = DllStructCreate("dword Length;ptr Descriptor;bool InheritHandle") DllStructSetData($tSecurityAttributes, 1, DllStructGetSize($tSecurityAttributes)) DllStructSetData($tSecurityAttributes, 2, DllStructGetPtr($tSecurityDescriptor)) DllStructSetData($tSecurityAttributes, 3, 0) EndIf EndIf EndIf Local $aHandle = DllCall("kernel32.dll", "handle", "CreateMutexW", "struct*", $tSecurityAttributes, "bool", 1, "wstr", $sOccurrenceName) If @error Then Return SetError(@error, @extended, 0) Local $aLastError = DllCall("kernel32.dll", "dword", "GetLastError") If @error Then Return SetError(@error, @extended, 0) If $aLastError[0] = $ERROR_ALREADY_EXISTS Then If BitAND($iFlag, 1) Then DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $aHandle[0]) If @error Then Return SetError(@error, @extended, 0) Return SetError($aLastError[0], $aLastError[0], 0) Else Exit -1 EndIf EndIf Return $aHandle[0] EndFunc ;==>__PCinfo_Singleton Func __PCinfo_dtCloneSystemTime($pSystemTime) Local $tagSYSTEMTIME = "struct;word Year;word Month;word Dow;word Day;word Hour;word Minute;word Second;word MSeconds;endstruct" Local $tSystemTime1 = DllStructCreate($tagSYSTEMTIME, $pSystemTime) Local $tSystemTime2 = DllStructCreate($tagSYSTEMTIME) DllStructSetData($tSystemTime2, "Month", DllStructGetData($tSystemTime1, "Month")) DllStructSetData($tSystemTime2, "Day", DllStructGetData($tSystemTime1, "Day")) DllStructSetData($tSystemTime2, "Year", DllStructGetData($tSystemTime1, "Year")) DllStructSetData($tSystemTime2, "Hour", DllStructGetData($tSystemTime1, "Hour")) DllStructSetData($tSystemTime2, "Minute", DllStructGetData($tSystemTime1, "Minute")) DllStructSetData($tSystemTime2, "Second", DllStructGetData($tSystemTime1, "Second")) DllStructSetData($tSystemTime2, "MSeconds", DllStructGetData($tSystemTime1, "MSeconds")) DllStructSetData($tSystemTime2, "DOW", DllStructGetData($tSystemTime1, "DOW")) Return $tSystemTime2 EndFunc ;==>__PCinfo_dtCloneSystemTime Func __PCinfo_dtGetTimeZoneInformation() Local $tagTIME_ZONE_INFORMATION = "struct;long Bias;wchar StdName[32];word StdDate[8];long StdBias;wchar DayName[32];word DayDate[8];long DayBias;endstruct" Local $tTimeZone = DllStructCreate($tagTIME_ZONE_INFORMATION) Local $aCALL = DllCall("kernel32.dll", "dword", "GetTimeZoneInformation", "struct*", $tTimeZone) If @error Then Return SetError(@error, @extended, 0) If $aCALL[0] = -1 Then Return SetError(10, 0, 0) Local $aInfo[8] $aInfo[0] = $aCALL[0] $aInfo[1] = DllStructGetData($tTimeZone, "Bias") $aInfo[2] = DllStructGetData($tTimeZone, "StdName") $aInfo[3] = __PCinfo_dtCloneSystemTime(DllStructGetPtr($tTimeZone, "StdDate")) $aInfo[4] = DllStructGetData($tTimeZone, "StdBias") $aInfo[5] = DllStructGetData($tTimeZone, "DayName") $aInfo[6] = __PCinfo_dtCloneSystemTime(DllStructGetPtr($tTimeZone, "DayDate")) $aInfo[7] = DllStructGetData($tTimeZone, "DayBias") Return $aInfo EndFunc ;==>__PCinfo_dtGetTimeZoneInformation Func __PCinfo_ObjErrorFunc() ConsoleWrite("! AutoItCOM Test - We intercepted a COM Error !" & @CRLF & @CRLF & "! Error.description is: " & @TAB & $oMyError.description & @CRLF & "! Error.windescription:" & @TAB & $oMyError.windescription & @CRLF & "! Error.number is: " & @TAB & Hex($oMyError.number, 8) & @CRLF & "! Error.lastdllError is: " & @TAB & $oMyError.lastdllError & @CRLF & "! Error.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & "! Error.source is: " & @TAB & $oMyError.source & @CRLF & "! Error.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & "! Error.helpcontext is: " & @TAB & $oMyError.helpcontext & @CRLF & @CRLF) EndFunc ;==>__PCinfo_ObjErrorFunc #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=iCon.ico #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Res_Comment=Dao Van Trong - TRONG.PRO #AutoIt3Wrapper_Res_Description=Get PC Information by Dao Van Trong - TRONG.PRO #AutoIt3Wrapper_Res_Fileversion=1.0.0.0 #AutoIt3Wrapper_Res_ProductName=Get PC Information #AutoIt3Wrapper_Res_ProductVersion=1.0.0.0 #AutoIt3Wrapper_Res_CompanyName=TRONG.PRO #AutoIt3Wrapper_Res_LegalCopyright=Dao Van Trong - TRONG.PRO #AutoIt3Wrapper_Res_LegalTradeMarks=Dao Van Trong - TRONG.PRO #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Language=1066 #AutoIt3Wrapper_Res_requestedExecutionLevel=highestAvailable #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
×
×
  • Create New...