Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/31/2025 in Posts

  1. Released v1.0.14 today! Changed Node package update. Sets editor.minimap.showRegionSectionHeaders to false for AutoIt scripts. Optimized editor command registrations. Enhancements to syntax definition file. Fixed Usage of wrong Au3Check encoding for the file path string. View and Rate on VSCode Marketplace View and Rate on OpenVSX Star, Submit Issues, and Contribute on GitHub
    3 points
  2. I’ve identified the root cause of the issue with $colNetAdapter.Count failing when querying Win32_NetworkAdapter via WMI. The problem arises from using the wbemFlagForwardOnly flag (0x20) in the ExecQuery method. This flag creates a forward-only cursor for the SWbemObjectSet collection, which optimizes performance for large datasets by allowing only sequential, one-time access to objects. However, this cursor type does not support the .Count property, resulting in the error: "The requested action with this object has failed."To resolve this, you should use only the wbemFlagReturnImmediately flag (0x10) or no flags at all, as this ensures the resulting SWbemObjectSet collection supports .Count #include <Array.au3> #include <MsgBoxConstants.au3> Local $objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2") If Not IsObj($objWMIService) Then MsgBox($MB_ICONERROR, "Error", "Unable to connect to WMI service. Check privileges or WMI service status.") Exit 1 EndIf Local $sQueryNetAdapter = 'SELECT * FROM Win32_NetworkAdapter' Local $colNetAdapter = $objWMIService.ExecQuery($sQueryNetAdapter, "WQL", 0x10) ; wbemFlagReturnImmediately If Not IsObj($colNetAdapter) Then MsgBox($MB_ICONERROR, "Error", "WMI query failed. Check query syntax or access to Win32_NetworkAdapter class.") Exit 2 EndIf ; Get the number of items in the collection Local $num = $colNetAdapter.Count If @error Then MsgBox($MB_ICONERROR, "Error", "Unable to access .Count property. Error code: " & @error) Exit 3 EndIf MsgBox($MB_OK, "Number of Adapters", "Number of network adapters: " & $num) ; Create an array to store the data Local $storearray[$num][2] Local $ind = 0 For $netadapt In $colNetAdapter If IsObj($netadapt) Then $storearray[$ind][0] = Not $netadapt.Manufacturer ? "N/A" : $netadapt.Manufacturer $storearray[$ind][1] = Not $netadapt.ProductName ? "N/A" : $netadapt.ProductName $ind += 1 EndIf Next ; Display the results (for verification) For $i = 0 To $num - 1 MsgBox($MB_OK, "Adapter " & $i, "Manufacturer: " & $storearray[$i][0] & @CRLF & "Product: " & $storearray[$i][1]) Next
    2 points
  3. I cannot see, that adding content or renaming a file by means of the windows OS is messing up the creation timestamp: PS C:\temp> "test" | out-file "test.txt" PS C:\temp> gci .\test.txt Verzeichnis: C:\temp Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 31.07.2025 16:48 14 test.txt PS C:\temp> gci .\test.txt | ft creationtime,lastwritetime,length,name CreationTime LastWriteTime Length Name ------------ ------------- ------ ---- 16.12.2020 14:10:46 31.07.2025 16:48:35 14 test.txt PS C:\temp> $file=gci .\test.txt PS C:\temp> $file.CreationTime = $(Get-Date).date PS C:\temp> gci .\test.txt | ft creationtime,lastwritetime,length,name CreationTime LastWriteTime Length Name ------------ ------------- ------ ---- 31.07.2025 00:00:00 31.07.2025 16:48:35 14 test.txt PS C:\temp> "line2" | out-file "test.txt" -Append PS C:\temp> gci .\test.txt | ft creationtime,lastwritetime,length,name CreationTime LastWriteTime Length Name ------------ ------------- ------ ---- 31.07.2025 00:00:00 31.07.2025 16:50:50 28 test.txt PS C:\temp> PS C:\temp> $TS=$(get-date -format "yyyy-MM-dd_hh-mm_LOG") PS C:\temp> $ts 2025-07-31_04-57_LOG PS C:\temp> $newname = $file.name + "_" + $TS + ".backup" PS C:\temp> move .\test.txt $newname PS C:\temp> gci $newname | ft creationtime,lastwritetime,length,name CreationTime LastWriteTime Length Name ------------ ------------- ------ ---- 31.07.2025 00:00:00 31.07.2025 16:50:50 28 test.txt_2025-07-31_04-57_LOG.backup
    1 point
  4. ... ; ---------------------------------------------------------------------- ; Get Initial Startup Entries ; ---------------------------------------------------------------------- Global $g_oldEntries = _GetAllStartupEntries_Map() ... It would be good to save those entries to an organized file and load from there because, if you run this sporadically or something changes between your script running and something else, on reboot or whatnot, then you'll be able to see that there was a changed. Mostly if you're looking for sneaky things like Edge
    1 point
  5. You can simply do: #include <MsgBoxConstants.au3> ; Connect to the WMI service Local $wmiService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2") If Not IsObj($wmiService) Then MsgBox($MB_ICONERROR, "Error", "Unable to connect to WMI service. Check privileges or service status.") Exit 1 EndIf ; Retrieve the collection of Win32_NetworkAdapter instances Local $networkAdapterCol = $wmiService.InstancesOf('Win32_NetworkAdapter') If Not IsObj($networkAdapterCol) Then MsgBox($MB_ICONERROR, "Error", "Failed to retrieve Win32_NetworkAdapter collection.") Exit 2 EndIf ; Get the number of items in the collection Local $count = $networkAdapterCol.Count MsgBox($MB_OK, "Number of Adapters", "Number of network adapters: " & $count)
    1 point
  6. there will be two options, you can use the Autoit client (similar to the concept I made last year) which is also GUI or use the mIRC script which will have game features and basic GUI features built into their mIRC clients. I've already seen your bot base and used it as reference to make my own for an Autoit IRC client and have also made a Autoit duckhunt bot that is available here on the forum. Autoit can't egg drop or run bots on linux servers Python runs on lots of things It is Autoit being windows only as to why I'm making the bot with python (so that it can be a universal bot software) and then users will have the choice of two eventual windows based clients (Autoit version, and mIRC version) while also still being able to have basic game experience thru a regular IRC client. The Autoit script will be similar to previous concept I made to the first Autoit RPGenerator, a GUI with some animation, but also an IRC chat.
    1 point
  7. New version - 17 Jun 23 ======================= Added: Added 24hr unpadded H mask. New UDF in zip below. Changelog: Changelog.txt Here is my version of a UDF to transform date/time formats. It is entirely self-contained and although it defaults to English for the month/day names, you can set any other language very simply, even having different ones for the input and output. You need to provide a date/time string, a mask to tell the UDF what is in the string, and a second mask to format the output - the masks use the standard "yMdhmsT" characters. This is an example script showing some of the features: #include <Constants.au3> ; Only required for MsgBox constants #include "DTC.au3" Global $sIn_Date, $sOut_Date ; Basic format $sIn_Date = "13/08/02 18:30:15" $sOut_Date = _Date_Time_Convert($sIn_Date, "yy/MM/dd HH:mm:ss", "dddd, d MMMM yyyy at h:mm TT") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Note how day name is corrected $sIn_Date = "2013082 Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "yyyyMMd ddd hh:mm:ss TT", "dddd, dd MMM yy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Note use of $i19_20 parameter to change century $sIn_Date = "13/08/02 18:30:15" $sOut_Date = _Date_Time_Convert($sIn_Date, "yy/MM/dd HH:mm:ss", "dddd, d MMMM yyyy at h:mm TT", 10) MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) $sIn_Date = "18:30:15 13/08/02" $sOut_Date = _Date_Time_Convert($sIn_Date, "HH:mm:ss yy/MM/dd", "h:mm TT on ddd d MMM yyyy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Just to show it works both ways $sIn_Date = "Friday, 2 August 2013 at 6:30 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "dddd, d MMMM yyyy at h:mm TT", "dd/MM/yy HH:mm") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) $sIn_Date = $sOut_Date $sOut_Date = _Date_Time_Convert($sIn_Date, "dd/MM/yy HH:mm", "dddd, d MMMM yyyy at h:mm TT") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Note false returns for non-specified elements $sIn_Date = "6:15 P" $sOut_Date = _Date_Time_Convert($sIn_Date, "h:m T", "yy/MM/dd HH:mm:ss") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Note use of "x" in place of actual spacing/punctuation $sIn_Date = "Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "dddxhhxmmxssxTT", "dddd HH:mm") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Output month/day strings changed to French _Date_Time_Convert_Set("smo", "jan,fév,mar,avr,mai,juin,juil,août,sept,oct,nov,déc") _Date_Time_Convert_Set("ldo", "dimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi") _Date_Time_Convert_Set("SDO", 3) ; Each short name is first 3 chars of equivalent long name ; Note as only the short day names are required, they could have been set directly: ; _Date_Time_Convert_Set("sdo", "dim,lun,mar,mer,jeu,ven,sam") $sIn_Date = "20130716 Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "yyyyMMd ddd hh:mm:ss TT", "ddd, d MMM yy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Output month/day strings changed to German _Date_Time_Convert_Set("smo", "Jan.,Feb.,März,Apr.,Mai,Juni,Juli,Aug.,Sept.,Okt.,Nov.,Dez.") _Date_Time_Convert_Set("ldo", "Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag") $sIn_Date = "20130716 Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "yyyyMMd ddd hh:mm:ss TT", "dddd, d MMM yy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; All strings reconverted to default English _Date_Time_Convert_Set() ; As shown here $sIn_Date = "20130716 Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "yyyyMMd ddd hh:mm:ss TT", "ddd, d MMM yy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) And here is the UDF and example in zip format: DTC.zip As always, happy for any comments. M23
    1 point
×
×
  • Create New...