-
Posts
246 -
Joined
-
Last visited
mdwerne's Achievements
-
Grab downloads from webpage...now broken.
mdwerne replied to mdwerne's topic in AutoIt General Help and Support
Thanks for the reply, @MattHiggs. This is something new to try as I have been unable to get at the files any other way. I haven't played with WGET much, but I'll give it a shot. Manually downloading a handful of different definition sets, every night, from this site: https://www.broadcom.com/support/security-center/definitions/download/detail?gid=sep14 is getting kinda old. Again, thanks for your reply, I was at an impasse. -Mike P.S. Part of the issue is also that the download files names change a few times a day...which is why I need to scrape the fully rendered Javascript (HTML) page each time. -
Grab downloads from webpage...now broken.
mdwerne replied to mdwerne's topic in AutoIt General Help and Support
Thank you for the suggestion, but unfortunately, the links to the files don't appear to be within the JavaScript...they only appear after the page is fully rendered. -
Hello, Before Broadcom took over Symantec, I was able to use the following code as the base to scrape daily definition downloads from the web. Since the pages were moved over to the Broadcom web servers, I get a page full of what I believe may be JavaScript instead of the fully rendered page that lies behind it. Does anyone have any suggestions as to how I can read the full rendered webpage using AutoIt? #include <IE.au3> $oIE_DEFS = _IECreate("https://www.broadcom.com/support/security-center/definitions/download/detail?gid=sep14", 0, 0, 1, 1) $sString_DEFS = _IEBodyReadHTML($oIE_DEFS) MsgBox(0, "https://www.broadcom.com/support/security-center/definitions/download/detail?gid=sep14", $sString_DEFS) The above code will show the JavaScript, but if you go to the URL in a browser that has JavaScript enabled, you will see the fully rendered page that I would like to access. I hope my question makes sense, and I would appreciate any suggestions to get this working again. All the best, -Mike
-
mdwerne reacted to a post in a topic: [Solved] Log file to keep track of application executions by day/month?
-
Hello, I have an AutoIt application that's run about 30-50 times a day from a server, and my management is interested in knowing exactly how many times it's run per day, and per month...mainly to see trends in usage. Without doing the work for me, can anyone offer a suggestion (method or example) as to how I would keep track of an execution count variable that is updated from multiple machines? Again, per day and per month are the metrics I'm after...I don't mind doing the per year calculation. Thanks for any suggestions, -Mike
-
mdwerne reacted to a post in a topic: [SOLVED] Drag and Drop flies including those in Directories to an edit box?
-
WOW, this looks great, thank you both, Bilgus and kaz!! I may be able to take it from here, but feel free to jump back in if you see an easy way to switch from a list control, to an edit control. I allow users to not only drop files in, but also type them in (but I may just change that). Just so you know, I would never drop a whole drive on the GUI, this utility will be used in conjunction with a CD burning program. Typical use case is the customer would drag the files/folders to be burned to a CD, and then run this utility, drag the same files to the GUI to then "log" the files that were burned. Yes, not the best process, but it's what I've been asked to work on. So if making this an edit control is pretty trivial, then I can give it a shot, otherwise I may just keep what you've done with the list control. At this point, I see no reason why they could not just drag and drop additional files, and if they make a mistake, "clear" and start over. You guys rock! -Mike
-
Hi Bilgus, Thanks for taking the time to poke at this, it's definitely closer than I was before. Unfortunately it seems to be ignoring the files at the same level as the sub directory that is being enumerated. And I don't see how to make it recurse through multiple levels of sub directories. As an example of what I'm after, dropping this folder structure from the root of C:\ File1.txt File2.txt Folder1 File3.txt File4.txt Folder2 File5.txt File6.txt Would produce this list in the edit box: C:\File1.txt C:\File2.txt C:\Folder1\File3.txt C:\Folder1\File4.txt C:\Folder1\Folder2\File5.txt C:\Folder1\Folder2\File6.txt Only the filenames with their full path are displayed...no folders. Thanks again for looking at this, way above my current skill set. -Mike
-
So here is my script thus far. I would like to enhance it by adding the ability to drag/drop, and list, not only files, but also files within folders (the folder names can be omitted). For example, if I were to drop the Windows directory on top of the edit window, all files contained within, including those in all the sub-directories, would be listed. Hopefully seeing the GUI will clarify what I'm trying to achieve. Thank for any suggestions! -Mike #include <GDIPlus.au3> #include <Misc.au3> #include <Date.au3> #include <GUIConstants.au3> ;#include <ServiceControl.au3> Opt('MustDeclareVars', 1) Opt("TrayMenuMode", 1) Global $MinimalGUI, $DTUser, $DateTime, $Group, $MediaTypeLabel, $MediaType, $MediaTypeData, $DTObserverLabel, $DTObserver, $DTObserverData, $ActionPerformedLabel, $ActionPerformed, $ActionPerformedData, $ExplanationLabel, $Explanation, $ExplanationData, $SubmitLog, $nMsg, $LogData, $FullGUI, $FilenameWextensionLabel, $FilenameWextension, $FilenameWextensionData, $Result Global $IP_Address = @IPAddress1 Global $MAC_Address = GET_MAC($IP_Address) Global $OS_Version = @OSVersion Global $UserName = @UserName ; ======================================================================= ; Command Line Interpretation ; ======================================================================= If $CmdLine[0] = 0 Then ;gui mode $FullGUI = GUICreate("DEMO GUI", 640, 500, -1, -1, -1, $WS_EX_ACCEPTFILES) Global $idFilemenu = GUICtrlCreateMenu("&File") Global $idExititem = GUICtrlCreateMenuItem("Exit", $idFilemenu) Global $idHelpmenu = GUICtrlCreateMenu("Help") Global $idUserGuide = GUICtrlCreateMenuItem("DEMO User Guide", $idHelpmenu) $DTUser = GUICtrlCreateLabel("Approved Username: " & $UserName, 25, 10, 400, 24) GUICtrlSetFont(-1, 11 * _GDIPlus_GraphicsGetDPIRatio()[0], 600, 0, "Arial") $DateTime = GUICtrlCreateLabel(_Now(), 440, 10, 175, 24, $SS_RIGHT) GUICtrlSetFont(-1, 10 * _GDIPlus_GraphicsGetDPIRatio()[0], 600, 0, "Arial") $Group = GUICtrlCreateGroup("Please complete the fields below.", 25, 40, 593, 420) GUICtrlSetFont(-1, 9 * _GDIPlus_GraphicsGetDPIRatio()[0], 600, 0, "Arial") DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group), "wstr", 0, "wstr", 0) GUICtrlSetColor(-1, 0xFF0000) GUICtrlCreateGroup("", -99, -99, 1, 1) $DTObserverLabel = GUICtrlCreateLabel("Observers Username:", 35, 66, 250, 24) GUICtrlSetFont(-1, 12 * _GDIPlus_GraphicsGetDPIRatio()[0], 400, 0, "MS Sans Serif") $DTObserver = GUICtrlCreateInput("e.g. John Doe", 35, 89, 215, 24) GUICtrlSetFont(-1, 12 * _GDIPlus_GraphicsGetDPIRatio()[0], 400, 0, "MS Sans Serif") $MediaTypeLabel = GUICtrlCreateLabel("Type of removable media:", 260, 66, 200, 24) GUICtrlSetFont(-1, 12 * _GDIPlus_GraphicsGetDPIRatio()[0], 400, 0, "MS Sans Serif") $MediaType = GUICtrlCreateInput("e.g. CD, USB, TAPE", 260, 89, 180, 24) GUICtrlSetFont(-1, 12 * _GDIPlus_GraphicsGetDPIRatio()[0], 400, 0, "MS Sans Serif") $FilenameWextensionLabel = GUICtrlCreateLabel("File name/s with extension", 35, 125, 480, 24) GUICtrlSetFont(-1, 12 * _GDIPlus_GraphicsGetDPIRatio()[0], 400, 0, "MS Sans Serif") $FilenameWextension = GUICtrlCreateEdit("", 35, 150, 575, 155, BitOR($ES_WANTRETURN, $ES_AUTOVSCROLL, $WS_VSCROLL, $ES_MULTILINE)) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlSetFont(-1, 9 * _GDIPlus_GraphicsGetDPIRatio()[0], 400, 0, "MS Sans Serif") GUICtrlSendMsg($FilenameWextension, $EM_LIMITTEXT, -1, 0) $ActionPerformedLabel = GUICtrlCreateLabel("Action Performed:", 35, 313, 250, 24) GUICtrlSetFont(-1, 12 * _GDIPlus_GraphicsGetDPIRatio()[0], 400, 0, "MS Sans Serif") $ActionPerformed = GUICtrlCreateInput("e.g. Copied project documents from C: drive to F: drive", 35, 335, 575, 24) GUICtrlSetFont(-1, 12 * _GDIPlus_GraphicsGetDPIRatio()[0], 400, 0, "MS Sans Serif") $ExplanationLabel = GUICtrlCreateLabel("Brief description of how removable media will be used:", 35, 368, 600, 24) GUICtrlSetFont(-1, 12 * _GDIPlus_GraphicsGetDPIRatio()[0], 400, 0, "MS Sans Serif") $Explanation = GUICtrlCreateEdit("e.g. To allow working on projects document from another workstation.", 35, 390, 575, 60, $ES_MULTILINE) GUICtrlSetFont(-1, 12 * _GDIPlus_GraphicsGetDPIRatio()[0], 400, 0, "MS Sans Serif") $SubmitLog = GUICtrlCreateButton("SUBMIT LOG", 460, 58, 149, 56, $BS_MULTILINE) GUICtrlSetFont(-1, 14 * _GDIPlus_GraphicsGetDPIRatio()[0], 500, 0, "Arial") ;GUICtrlSetBkColor($DTUser, 0xFFFFBF) ;For testing GUICtrlSetBkColor($DTObserver, 0xFFFFBF) GUICtrlSetBkColor($MediaType, 0xFFFFBF) GUICtrlSetBkColor($FilenameWextension, 0xFFFFBF) ;GUICtrlSetBkColor($FilenameWextensionLabel, 0xFFFFBF) GUICtrlSetBkColor($ActionPerformed, 0xFFFFBF) GUICtrlSetBkColor($Explanation, 0xFFFFBF) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $SubmitLog $DTObserverData = GUICtrlRead($DTObserver) $MediaTypeData = GUICtrlRead($MediaType) $FilenameWextensionData = GUICtrlRead($FilenameWextension) $ActionPerformedData = GUICtrlRead($ActionPerformed) $ExplanationData = GUICtrlRead($Explanation) GUISetState(@SW_HIDE) $LogData = "data_transfer_agent=" & "'" & $UserName & "'" & " " & "observer_username=" & "'" & $DTObserverData & "'" & " " & "media_type=" & "'" & $MediaTypeData & "'" & " " & "file_names_with_extension=" & "'" & $FilenameWextensionData & "'" & " " & "action_performed=" & "'" & $ActionPerformedData & "'" & " " & "explanation=" & "'" & $ExplanationData & "'" & " " & "machine_name=" & "'" & @ComputerName & "'" & " " & "ip_address=" & "'" & $IP_Address & "'" & " " & "mac_address=" & "'" & $MAC_Address & "'" & " " & "os_version=" & "'" & $OS_Version & "'" MsgBox(0, "LogData", $LogData) Exit Case $idUserGuide MsgBox(0, "Coming soon!", "The user guide is not quite ready. We will automatically upgrade your DEMO application once it's complete.") ContinueLoop Case $GUI_EVENT_CLOSE, $idExititem Exit EndSwitch WEnd Else _Terminate() EndIf ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_GraphicsGetDPIRatio ; Description ...: Get DPI Ratio ; Syntax ........: _GDIPlus_GraphicsGetDPIRatio([$iDPIDef = 96]) ; Parameters ....: $iDPIDef - [optional] An integer value. Default is 96. ; Return values .: actual DPI Ratio as Array, or set @error to non zero, also @extended may be set ; Author ........: UEZ ; Modified ......: argumentum 2015.06.05 / better error return ; Remarks .......: ; Related .......: ; Link ..........: https://www.autoitscript.com/forum/topic/166479-writing-dpi-awareness-app-workaround/ ; Example .......: yes ; =============================================================================================================================== Func _GDIPlus_GraphicsGetDPIRatio($iDPIDef = 96) Local $aResults[2] = [1, 1] _GDIPlus_Startup() Local $hGfx = _GDIPlus_GraphicsCreateFromHWND(0) If @error Then Return SetError(1, @extended, $aResults) Local $aResult #forcedef $__g_hGDIPDll, $ghGDIPDll $aResult = DllCall($__g_hGDIPDll, "int", "GdipGetDpiX", "handle", $hGfx, "float*", 0) If @error Then Return SetError(2, @error, $aResults) Local $iDPI = $aResult[2] Local $aResults[2] = [$iDPIDef / $iDPI, $iDPI / $iDPIDef] _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_Shutdown() Return $aResults EndFunc ;==>_GDIPlus_GraphicsGetDPIRatio ;Ref https://www.autoitscript.com/forum/topic/165393-get-mac-address-efficiently/ Func GET_MAC($_MACsIP) Local $_MAC, $_MACSize Local $_MACi, $_MACs, $_MACr, $_MACiIP $_MAC = DllStructCreate("byte[6]") $_MACSize = DllStructCreate("int") DllStructSetData($_MACSize, 1, 6) $_MACr = DllCall("Ws2_32.dll", "int", "inet_addr", "str", $_MACsIP) $_MACiIP = $_MACr[0] $_MACr = DllCall("iphlpapi.dll", "int", "SendARP", "int", $_MACiIP, "int", 0, "ptr", DllStructGetPtr($_MAC), "ptr", DllStructGetPtr($_MACSize)) $_MACs = "" For $_MACi = 0 To 5 If $_MACi Then $_MACs = $_MACs & ":" $_MACs = $_MACs & Hex(DllStructGetData($_MAC, 1, $_MACi + 1), 2) Next DllClose($_MAC) DllClose($_MACSize) Return $_MACs EndFunc ;==>GET_MAC Func _Terminate() Exit (0) EndFunc ;==>_Terminate
-
mdwerne changed their profile photo
-
Hi, I have a test interface that I'd like to use as the basis for a GUI I'm starting work on. **Credit to Melba23 for the starting framework below: How would I take this interface and modify it so that only files are accepted in the Drag and Drop edit box, not folders. In other words, if I drag the Windows folder on top of the edit box, nothing is displayed, but if I take the contents of the Windows directory and drop it in the edit box, all the files (including their paths) are listed, but none of the folders. Make sense? Here is "my" sample GUI: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiEdit.au3> $hGUI = GUICreate("Accept only files in this window, no folders", 500, 400, Default, Default, Default, $WS_EX_ACCEPTFILES) $hEdit = GUICtrlCreateEdit("", 10, 10, 480, 380) GUICtrlSetState(-1, $GUI_DROPACCEPTED) $hEdit_Handle = GUICtrlGetHandle(-1) GUISetState(@SW_SHOW) GUICtrlSetData($hEdit, "") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_DROPPED $file = @GUI_DragFile ConsoleWrite($file & @CRLF) Sleep(2000) ; This only here you you can see the drop has taken place _GUICtrlEdit_ReplaceSel($hEdit_Handle, "") EndSwitch WEnd Thanks for your time and suggestions, -Mike
-
How to add multiple lines of EventData to an EventLog?
mdwerne replied to mdwerne's topic in AutoIt General Help and Support
Thank you again, I will see if I can make this work.- 10 replies
-
- eventcreate
- eventlog
-
(and 1 more)
Tagged with:
-
How to add multiple lines of EventData to an EventLog?
mdwerne replied to mdwerne's topic in AutoIt General Help and Support
Sadly, this is how it shows up in the event log: - <EventData> <Data>DTALog Details: <EventData> <Data1>Data Transfer Agent: mike</Data1> <Data2>Observer Username: miguel</Data2> <Data3>File name/s with extension: 10</Data3> </EventData></Data> </EventData> While it may not be obvious from the snippet above, the $s variable came in as plain text, not actual XML data. Thanks for giving it a shot...I'll see if there is another way to go about this.- 10 replies
-
- eventcreate
- eventlog
-
(and 1 more)
Tagged with:
-
How to add multiple lines of EventData to an EventLog?
mdwerne replied to mdwerne's topic in AutoIt General Help and Support
This would work for me as well...the question is still how. Above you suggested "Or perhaps you could add multiple data entries in EventData." EventCreate does not like more than 1 of the /D switch, and I'm not sure how to use the "_EventLog__Report" function to add multiple data entries...if it's even possible. If I look through my Application Event log, I see that other apps can create entries like I'm after: - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> - <System> <Provider Name="Application Error" /> <EventID Qualifiers="0">1000</EventID> <Level>2</Level> <Task>100</Task> <Keywords>0x80000000000000</Keywords> <TimeCreated SystemTime="2017-12-04T22:02:33.393707600Z" /> <EventRecordID>10493</EventRecordID> <Channel>Application</Channel> <Computer>R123456.my.domain</Computer> <Security /> </System> - <EventData> <Data>consent.exe</Data> <Data>10.0.15063.0</Data> <Data>e0f856c4</Data> <Data>unknown</Data> <Data>0.0.0.0</Data> <Data>00000000</Data> <Data>c0000409</Data> <Data>0000000000000000</Data> <Data>f8c</Data> <Data>01d36d4b962f1993</Data> <Data>c:\windows\system32\consent.exe</Data> <Data>unknown</Data> <Data>01cbf734-c21e-46ce-8132-df9596bb70f4</Data> <Data /> <Data /> </EventData> </Event> maybe I need to jump over to C# for this project. Thanks for the suggestions nonetheless, -Mike- 10 replies
-
- eventcreate
- eventlog
-
(and 1 more)
Tagged with: