Jump to content

MattHiggs

Active Members
  • Posts

    606
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by MattHiggs

  1. Hey everybody. So, I am trying to automate some interactions with an external application's GUI, but I am running into a problem where the class for a button control I want to simulate a click for is unique each time the application is run. For example, the first time I run the application, I capture the following class using the control viewer: WindowsForms10.BUTTON.app.0.12b256f_r38_ad1 However, when I close out and run it again, I get this class for the control: WindowsForms10.BUTTON.app.0.e813a5_r38_ad1 The fact that the class for the control keeps changing is making it difficult to identify the control for the purposes of simulating a click on the control with ControlClick. Any advice as to how I can get around this?
  2. Hello everyone. Consider the following simple script: #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Change2CUI=y #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator #AutoIt3Wrapper_Add_Constants=n #include <TrayConstants.au3> Opt("TrayAutoPause", 0) Opt("TrayMenuMode", 2) $key = "0" $tray1 = TrayCreateItem('Set key') TraySetState($TRAY_ICONSTATE_SHOW) While True ConsoleWrite ( @HOUR & ":" & @MIN & ":" & @SEC & @CRLF & @CRLF ) $msg = TrayGetMsg() Switch ($msg) Case $tray1 If Not IsDeclared("sInputBoxAnswer") Then Local $sInputBoxAnswer $sInputBoxAnswer = InputBox("Input key", "Which character?") If @error = 0 Then $key = $sInputBoxAnswer EndIf EndSwitch Sleep(1000) WEnd This is a simple script that creates a single tray menu item, then creates a loop which displays the time each time the loop iterates and displays an input box to receive the user's input when the tray item is clicked. My question involves the behavior of the script after the tray menu item is clicked. Since the input box function suspends the script until it is closed, I would expect for the script to not continue the iteration of the loop until the input box is displayed and closed by the user, but that is not what I am seeing. Instead, the script continues to iterate the loop many more times until, eventually, the input box is displayed, at which point, the script is paused and waiting for input. See below: I am trying to figure out why the script is behaving this. Where is the delay occurring that would allow multiple iterations of the loop before the expected action is taken? Is it the control sending the message that is has, in fact, been clicked? Is it just taking a while for the input box to display? Anyone with some insight would be appreciated.
  3. Built-in update feature for ISN Autoit studio not working. I click "check for updates" in the main menu, the application detects there is a more up-to-date version available, the program exits to "apply the update," and I am immediately met with this: Process terminates, and re-launching ISN autoit studio shows that update has not been installed. Just a heads up.
  4. Maybe try this: #RequireAdmin RunWait ( 'msiexec.exe /i C:\epagentauto\epagent\indev\twoAgent.msi REGISTRATION_URL=https://r02-login.cybase.com INSTALLATION_KEY=YokjabsdoasJJGssd LOG_LEVEL=Debug', @SystemDir, @SW_SHOW ) Also, assuming that you didn't post the actual installation key associated with the similarly named parameter, does it contain any special characters? If so, you will need to properly escape them for the command to run successfully. Or, you could just surround each parameter in quotes like so: #RequireAdmin RunWait ( 'msiexec.exe /i "C:\epagentauto\epagent\indev\twoAgent.msi" "REGISTRATION_URL=https://r02-login.cybase.com" "INSTALLATION_KEY=YokjabsdoasJJGssd" "LOG_LEVEL=Debug"', @SystemDir, @SW_SHOW )
  5. What all have you tried? Any autoit code?
  6. Hello all. So I have a pretty simple script: Autoit launches an external executable, which is a tool which displays information about Portable Executable files, with some arguments (the path to a portable executable), and I then want autoit to capture the text of a particular control in the executable's GUI. I will attach the external executable in a zipped archive so that you have it if you need it. The script is as follows: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.15.5 (Beta) Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here $file = FileOpenDialog ( "Select executable file", @UserProfileDir & "\Downloads", "Executable files (*.exe)", 3 ) If $file = "" Then Exit EndIf If Not FileExists(@TempDir & "\peid.exe") Then FileInstall("C:\Users\temp\Desktop\peid.exe", @TempDir & "\peid.exe") EndIf Run('peid.exe -hard "' & $file & '"', @TempDir) WinWait("PEiD v0.95") Do Sleep(100) $IDString = ControlGetText("PEiD v0.95", "", "[CLASS:Edit; INSTANCE:2]") MsgBox(1, "", $IDString) Until $IDString <> "Scanning..." And $IDString <> "" WinClose("PEiD v0.95") Now, take a look at this photo: Ok, so, as you can see from the code, the control whose text I want to capture is "[CLASS:Edit; INSTANCE:2]." When I run the script and have it capture the text from that control using "GetControlText" and output the text to a message box, you can see that it correctly captures the indicated control's text. However, when I look at the properties of the control using the Autoit Window info tool that is included with autoit, as you can see, it reports that the same control does not have any text associated with it. This is odd, as the control viewer created by autoit's own @Yashied (thank you @Yashied) does successfully return the text associated with the control. This seems to be an issue with the built-in Autoit window info tool, which I would consider to be a pretty big deal. I don't know about the rest of you, but the Autoit window info tool is the primary tool that I use when analyzing GUIs, their controls, and the properties of both, and whatever it says I used to consider law: as in the tool accurately reported all the information that autoit is also able to see (so if the window info tool reports that a control has no text, it has no text, end of discussion). It was only out of sheer persistence that I decided to get this script working that I tried using a different control viewer at all, whereas I would have likely abandoned a less important project after viewing the information provided by the window info tool. Don't know if anyone else really cares, but I still felt like I should report the problem. peid.zip
  7. I realize this post is ancient, but, considering the udf is no longer available, wanted to see if somebody potentially saved the udf at the time and could re-upload it. THanks.
  8. Also.....this didn't work. I removed the "require administrator" part, and the compiled script is still not working.
  9. Well...That is a problem. I haven't gotten this far in the script yet, but I want to include functionality where, if the dropped file is an executable, the script will launch an exe with administrator privileges. As far as I am aware, the only way that an autoit script can run an external executable as an administrator is to run the autoit script itself with elevated permissions. If I am wrong, or if there is some workaround, I would appreciate a point in the right direction.
  10. Hello all. Consider the following GUI script: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.15.5 (Beta) Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstantsEx.au3> #include <Array.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 309, 221, 192, 124, BitOR($WS_MINIMIZEBOX,$WS_SYSMENU,$WS_GROUP,$DS_SETFOREGROUND), BitOR($WS_EX_ACCEPTFILES,$WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE)) $Pic1 = GUICtrlCreatePic("C:\Users\whiggs\Downloads\acutepuppy.jpg", 0, 0, 309, 221) GUICtrlSetState (-1, $GUI_DROPACCEPTED) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_DROPPED $drop = @GUI_DragFile $ext = _GetFilenameExt ( $drop ) MsgBox ( 1, "", $ext ) If $ext = "lnk" Then $short = FileGetShortcut ( $drop ) _ArrayDisplay ( $short ) Else MsgBox ( 1, "", "Not a shortcut" ) EndIf EndSwitch WEnd Func _GetFilename($sFilePath) Local $oWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & "." & "\root\cimv2") Local $oColFiles = $oWMIService.ExecQuery("Select * From CIM_Datafile Where Name = '" & StringReplace ( StringReplace ( $sFilePath, "\", "\\"), "'", "\'" ) & "'") If IsObj($oColFiles) Then For $oObjectFile In $oColFiles Return $oObjectFile.FileName Next EndIf Return SetError(1, 1, 0) EndFunc ;==>_GetFilename Func _GetFilenameExt($sFilePath) Local $oWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & "." & "\root\cimv2") Local $oColFiles = $oWMIService.ExecQuery("Select * From CIM_Datafile Where Name = '" & StringReplace ( StringReplace ( $sFilePath, "\", "\\"), "'", "\'" ) & "'") If IsObj($oColFiles) Then For $oObjectFile In $oColFiles Return $oObjectFile.Extension Next EndIf Return SetError(1, 1, 0) EndFunc ;==>_GetFilenameExt Func _GetFilenameInt($sFilePath) Local $oWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & "." & "\root\cimv2") Local $oColFiles = $oWMIService.ExecQuery("Select * From CIM_Datafile Where Name = '" & StringReplace ( StringReplace ( $sFilePath, "\", "\\"), "'", "\'" ) & "'") If IsObj($oColFiles) Then For $oObjectFile In $oColFiles Return $oObjectFile.Name Next EndIf Return SetError(1, 1, 0) EndFunc ;==>_GetFilenameInt Func _GetFilenameDrive($sFilePath) Local $oWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & "." & "\root\cimv2") Local $oColFiles = $oWMIService.ExecQuery("Select * From CIM_Datafile Where Name = '" & StringReplace ( StringReplace ( $sFilePath, "\", "\\"), "'", "\'" ) & "'") If IsObj($oColFiles) Then For $oObjectFile In $oColFiles Return StringUpper($oObjectFile.Drive) Next EndIf Return SetError(1, 1, 0) EndFunc ;==>_GetFilenameDrive Func _GetFilenamePath($sFilePath) Local $oWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & "." & "\root\cimv2") Local $oColFiles = $oWMIService.ExecQuery("Select * From CIM_Datafile Where Name = '" & StringReplace ( StringReplace ( $sFilePath, "\", "\\"), "'", "\'" ) & "'") If IsObj($oColFiles) Then For $oObjectFile In $oColFiles Return $oObjectFile.Path Next EndIf Return SetError(1, 1, 0) EndFunc ;==>_GetFilenamePath Func IsFile($sFilePath) Return Number(FileExists($sFilePath) And StringInStr(FileGetAttrib($sFilePath), "D", 2, 1) = 0) EndFunc ;==>IsFile As you can see, the script creates a simple GUI and a PIC control that covers the entirety of the GUI. The GUI and the control have been configured to detect files that are dropped on it. When I run this script within Scite (using Tools > go), the script runs exactly as I expect it would without issue. However, when I compile the script into an executable, the $GUI_EVENT_DROPPED event does not appear to trigger (as far as I can tell) when a file is dropped onto the control. Any idea why this might be happening?
  11. @argumentumThank you for taking the time to work on this. I know you probably have a million other things you could have spent your time working on, so I really appreciate you releasing an updated version of your script with the fix so quickly.
  12. Hey @argumentum. Very impressive script!!! I downloaded this from the "downloads" section of the forum, and I can think of many projects I would like to use it in. I have, however, noticed some issues. The circle surrounding the mouse pointer does not appear will appear under certain some parts of the Windows GUI, as you can see below: Is there a way to get your script to work so that the circle will appear above all other parts of the GUI? THanks.
  13. Hello all. So I am having a bit of an issue. Consider the below script: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <AutoItConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <UpDownConstants.au3> Global $Form1 = GUICreate("Form1", 530, 280, 192, 124, BitOR($GUI_SS_DEFAULT_GUI, $DS_SETFOREGROUND), BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE)) $MenuItem1 = GUICtrlCreateMenu("Actions") $MenuItem2 = GUICtrlCreateMenuItem("Auto urls", $MenuItem1) $Label1 = GUICtrlCreateLabel("Title page", 194, 8, 90, 29) GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif") $Input1 = GUICtrlCreateInput("", 16, 40, 449, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NOHIDESEL)) $Button10 = GUICtrlCreateButton("Paste", 470, 30, 55, 40, $BS_NOTIFY) $Label2 = GUICtrlCreateLabel("Some input", 167, 72, 144, 29) GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif") $input2 = GUICtrlCreateInput("", 16, 104, 449, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NOHIDESEL)) $button11 = GUICtrlCreateButton("Paste", 470, 94, 55, 40, $BS_NOTIFY) $Button5 = GUICtrlCreateButton("<", 20, 144, 105, 41, $BS_NOTIFY) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetCursor(-1, 0) $Button6 = GUICtrlCreateButton(">", 350, 144, 105, 41, $BS_NOTIFY) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetCursor(-1, 0) $Button7 = GUICtrlCreateButton("Close", 184, 144, 105, 41, $BS_NOTIFY) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetCursor(-1, 0) $Button1 = GUICtrlCreateButton("Download", 184, 210, 105, 41, $BS_NOTIFY) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetCursor(-1, 0) $button12 = GUICtrlCreateButton ( "Button12", 465, 170, 50, 50, $BS_NOTIFY ) GUICtrlSetCursor(-1, 0) $button8 = GUICtrlCreateButton("move tab left", 20, 210, 105, 41, $BS_NOTIFY) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetCursor(-1, 0) $Input3 = GUICtrlCreateInput("1", 135, 220, 40, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_RIGHT, $ES_NUMBER)) $Updown1 = GUICtrlCreateUpdown($Input3, BitOR($UDS_ALIGNRIGHT, $UDS_ARROWKEYS, $UDS_NOTHOUSANDS)) GUICtrlSetLimit(-1, 100, 1) $Input4 = GUICtrlCreateInput("1", 297, 220, 40, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_RIGHT, $ES_NUMBER)) $Updown2 = GUICtrlCreateUpdown($Input4, BitOR($UDS_ALIGNRIGHT, $UDS_ARROWKEYS, $UDS_NOTHOUSANDS)) GUICtrlSetLimit(-1, 100, 1) $button9 = GUICtrlCreateButton("move tab right", 350, 210, 105, 41, $BS_NOTIFY) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetCursor(-1, 0) GUISetState(@SW_SHOW) $cur = ClipGet () While True $new = ClipGet () If $cur <> $new Then MsgBox ( 1, "", "cur:" & @CRLF & $cur & @CRLF & "new:" & @CRLF & $new & @CRLF & "End" ) ; more code down here to run if clipboard change detected $cur = $new EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd The GUI here is irrelevant. What I am trying to do is have this script monitor the host's clipboard in the background, and perform certain actions when a change in the clipboard is detected, so the relevant code here would be: $cur = ClipGet () While True $new = ClipGet () If $cur <> $new Then MsgBox ( 1, "", "cur:" & @CRLF & $cur & @CRLF & "new:" & @CRLF & $new & @CRLF & "End" ) ; more code down here to run if clipboard change detected $cur = $new EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Right now, when the script detects a clipboard change, it shows a message box displaying what the script had stored as the previous clipboard contents and the current contents for debugging purposes, as I have been having an issue where this code is constantly being executed even when there have been no changes made to the clipboard. What I found is that clipget() is intermittently....well...I don't know if the function is failing or just returning a null value/empty string when it shouldn't, as the script will just alternate these two message boxes when left to run: And Can anyone help me figure out how I can fix this? Or maybe I am just going about the clipboard change detection all wrong? Any suggestions would be great
  14. Don't know if you were aware or not, but the automatic updater built into ISN Autoit Studio is broken. See below. Error message: Line 0 (File "C:\PROGRA~2\ISN"): Error: Error opening the file.
  15. Hey @MWIProd. can you try replacing your "fileopen" command with this instead? Local $hFile = FileOpen($g_sFilePS, 514) This modification will create the powershell script using ANSI reading and writing mode. I wrote a script once upon a time that would create powershell scripts using the contents of an edit box, but when I tried executing the script that was created, nothing would happen. Using the above code fixed that for me. Give it a shot.
  16. @Danp2I will be damned. When I went to re-compile the script, I noticed that autoit was compiling the script using the BETA version of autoit. When I re-compiled the script using the production version of autoit, the script worked as intended. Thanks for the input!!
  17. @Danp2Hmm. I will recompile the script to see if that might be the issue, but these are the versions running on my machine:
  18. Hey guys. So, I have an autoit script that I wrote which is meant to activate windows on a fresh install of the operating system. The code looks something like this: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=Beta #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Change2CUI=y #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** If @OSVersion = "WIN_10" Or @OSVersion = "WIN_2016" Then If @OSVersion = "WIN_10" Then Run ( @ComSpec & " /c " & 'slmgr.vbs -ipk <a key>' ) $one = WinWait ( "Windows Script Host", "Installed product key <a key> successfully.", 5 ) WinActivate ( $one ) WinWaitActive ( $one, "", 5 ) ControlClick ( $one, "", 2 ) Else Run ( @ComSpec & " /c " & 'slmgr.vbs -ipk <a key>' ) $one = WinWait ( "Windows Script Host", "Installed product key <a key> successfully.", 5 ) WinActivate ( $one ) WinWaitActive ( $one, "", 5 ) ControlClick ( $one, "", 2 ) EndIf ElseIf @OSVersion = "WIN_11" Or @OSVersion = "WIN_2022" Then MsgBox ( 1, "Hello", "This is windows 11 or server 2022" ) Run ( @ComSpec & " /c " & 'slmgr.vbs -ipk <os key>' ) $one = WinWait ( "Windows Script Host", "Installed product key <os key> successfully.", 5 ) WinActivate ( $one ) WinWaitActive ( $one, "", 5 ) ControlClick ( $one, "", 2 ) Else EndIf RunWait ( @ComSpec & " /c " & 'cscript //B "' & @SystemDir & '\slmgr.vbs" /ato' ) As you can see, for troubleshooting purposes, I included a messagebox in the event @OSVersion macro is Win_11 or Win_2022. I just deployed windows 11 to one of my devices this evening and attempted to use the above script to activate my machine, and not only did the message box not appear, but my device was not activated. This tells me that the @OSVersion macro does not correctly detect windows 11 or windows server 2022 machines (I also tested this on a windows server 2022 machine and ran into the same problem). The macro does work for all of the other operating system versions.
  19. Hello everyone. Consider this autoit code: $source = _INetGetSource(ClipGet ()) $reg = StringRegExp($source, 'source src=\"https://[A-Za-z0-9\.\-/_]+\.mp4\"', 3) $theurl = Null If UBound($grr) > 1 Then $theurl = findsmall ( $reg ) Else $theurl = StringTrimLeft(StringTrimRight($reg[0], 1), 12) $file = InetGetSize ( $theurl, $INET_IGNORESSL ) If $file = 0 Then $theurl = Null EndIf EndIf MsgBox ( 1, "", $theurl ) Func findsmall ( $exp ) $grr = $exp _ArrayDisplay ( $grr ) If UBound ( $exp ) = 0 Then Return Null Else $index = Null $num = Null For $t = 0 To UBound($grr) - 1 Step 1 $regnum = StringRegExp(StringTrimLeft(StringTrimRight($grr[$t], 1), 12), "\d{1,3}x\d{1,3}", 1) If $num = Null Or Number(StringTrimRight($regnum[0], 4)) < $num Then $index = $t $num = Number(StringTrimRight($regnum[0], 4)) EndIf Next $testurl = StringTrimLeft(StringTrimRight($grr[$index], 1), 12) MsgBox ( 1, "", $testurl ) $file = InetGetSize ( $testurl, $INET_IGNORESSL ) If $file = 0 Then _ArrayDelete ( $grr, $index ) findsmall ( $grr ) Else Return $testurl EndIf EndIf EndFunc In this script, I am trying to scan a web page's source html to find links to video files. In the event that multiple video files are detected, the custom function I have written, "findsmall", will run. The purpose of findsmall is to find the video file with a valid url and has the smallest resolution based on the url string. To do this, I loop through the urls, in the array and determine their size based on text pulled from the url string. After I find the video with the smallest resolution, I run Inetgetsize to verify that the link leads to a valid url. If the url does not link to a valid url, then I run "_arraydelete" to delete the index in the array which held the invalid video url and re-run the function with the new array. The script works as intended, but I am running into an issue in instances where the function is re-run because the first video link is not valid. Normally, I would expect that the function would, if it encountered an invalid url, would continue to run itself, which would also reduce the size of the array, until a valid url is found or all items in the array are deleted, and then take the value returned by the re-run function and assign that to the variable which initially called it. In other words, referencing the above code, if the function had to re-run itself due to an invalid url: findsmall ( $grr ) Then I would expect that, if that run of the function returned a valid url, that value would be assigned to the original variable which was assigned to equal the call of the original function: $theurl = findsmall ( $reg ) But that is not what is happening, oddly enough. When the embedded function re-runs itself, it is almost as if autoit thinks it is an entirely seperate function, meaning that, in order to retrieve the value returned by the re-run function, I would need to assign the re-run function as its own variable: ; this value would equal 0 if the function calls itself, as the initial run of the function didn't return any value $theurl = findsmall ( $reg ) Func findsmall ( $exp ) $grr = $exp _ArrayDisplay ( $grr ) If UBound ( $grr ) = 0 Then Return Null Else $index = Null $num = Null For $t = 0 To UBound($grr) - 1 Step 1 $regnum = StringRegExp(StringTrimLeft(StringTrimRight($grr[$t], 1), 12), "\d{1,3}x\d{1,3}", 1) If $num = Null Or Number(StringTrimRight($regnum[0], 4)) < $num Then $index = $t $num = Number(StringTrimRight($regnum[0], 4)) EndIf Next $testurl = StringTrimLeft(StringTrimRight($grr[$index], 1), 12) MsgBox ( 1, "", $testurl ) $file = InetGetSize ( $testurl, $INET_IGNORESSL ) If $file = 0 Then ; This would be the variable that would contain the value that I am looking for, but this is not where I need the value. I need the value assigned to the original variable in the main part of the script: $theurl $NEWVALUE = _ArrayDelete ( $grr, $index ) findsmall ( $grr ) Else Return $testurl EndIf EndIf EndFunc Is this by design? If so, is there a way that I can get any instances of the function calling itself to assign the value it returns to the original variable ($theurl)? Thanks in advance.
  20. Hey Dude. You are embarking on a project that I started forever ago, but never really got too far on. I am not very knowledgeable when it comes to working with C libraries and whatnot. Guess I am just stupid. I can provide to you what little I have done. Hope it helps. Maybe you can get farther than I did. ; #INDEX# ======================================================================================================================= ; Title .........: wimlib ; AutoIt Version : 3.3.8.1+ ; Language ......: English ; Description ...: Functions allow for the manipulation of wim files using wimlib rather than the Micrsoft Assessment and Deployment Toolkit ; Author(s) .....: William Higgs (whiggs) ; =============================================================================================================================== #include-once #include "C:\Users\whiggs\OneDrive\always script\wimlib_lib\wimlibconstants.au3" #include <WinAPI.au3> #include <Debug.au3> ;#include <_DLLStructDisplay.au3> Global $wimstr = 0 Global $gsWimlibDLL = "" Global $ghwimlib = 0 ; initialized by _init_WIMlib() and contains the handle to DllOpen($gsWimDLL) Global $giWIMRef = 0 ; reference var. Value is >= 1 if $gsWimlibDLL is loaded. Func _init_wimlib ($dllfile = "libwim-15.dll", $initflags = 0) $giWIMRef += 1 If $giWIMRef > 1 Then Return SetExtended($ghwimlib, 0) ; dll already loaded EndIf If Not FileExists ( $dllfile ) Then Return SetError ( 2, 0, -1 ) EndIf $gsWimlibDLL = $dllfile $ghwimlib = DllOpen ( $gsWimlibDLL ) If $ghwimlib = -1 Then $giWIMRef = 0 Return SetError ( 1, 0, -1 ) EndIf DllCall ( $ghwimlib, "int:cdecl", "wimlib_global_init", $initflags ) If @error Then Return SetError(3, 0, -1) EndIf Return SetExtended ( $ghwimlib, 0 ) EndFunc Func _quit_wimlib () If $ghwimlib = 0 Or $ghwimlib = -1 Then Return SetError ( 1, 0, False ) EndIf $giWIMRef -= 1 If $giWIMRef = 0 Then DllCall ( $ghwimlib, "none:cdecl", "wimlib_global_cleanup" ) DllClose ( $ghwimlib ) $ghwimlib = 0 EndIf EndFunc Func _open_wim ($wimfile, $openflags = 0, $callback = Null ) ;$tchar = DllStructCreate If $callback = Null Then $aReturn = DllCall( $ghwimlib, "int:cdecl", "wimlib_open_wim", "wstr", $wimfile, "int", $openflags, "ptr*", Null ) Else $aReturn = DllCall( $ghwimlib, "int:cdecl", "wimlib_open_wim_with_progress", "wstr", $wimfile, "int", $openflags, "ptr*", Null, "ptr", DllCallbackGetPtr ( $callback ), "ptr", 0 ) EndIf ;If @error Then Exit MsgBox($MB_ICONERROR, "ERROR", "wimlib_open_wim DllCall failed with @error " & @error & @CRLF & "@ewxtend: " & @extended) _DebugArrayDisplay($aReturn, "wimlib_open_wim $aReturn") ;If bad return code, then return with error If $aReturn[0] <> 0 Then Return SetError(1, $aReturn[0], 0) ;All is good, return pointer Return $aReturn[3] ;Pointer to WIMStruct structure EndFunc Func _wimlib_free($pWimStruct) ;Free winstruct resources If Not IsPtr ( $pWimStruct ) Then Return SetError ( 1, 0 ) EndIf DllCall( $ghwimlib, "none:cdecl", "wimlib_free", "ptr", $pWimStruct ) If @error Then Exit MsgBox($MB_ICONERROR, "ERROR", "wimlib_free DllCall failed with @error " & @error) ;All is good Return SetExtended( _WinAPI_GetLastError() ) EndFunc Func _wimlib_register_progress_function ( $Wimstruct, $progfunc, $progctx = Null ) $mesresult = DllCall ( $ghwimlib, "none:cdecl", "wimlib_register_progress_function", "ptr", $Wimstruct, "ptr", $progfunc, "ptr", $progctx ) EndFunc Func _wimlib_verify_wim ( $Wimstruct, $progressfunc = Null, $pvUserData = 0 ) If Not IsPtr ( $Wimstruct ) Then Return SetError ( 1, 0, Null ) EndIf ;If $withprogress Then ;$str = DllStructCreate ( $tagwimlib_progress_info_verify_image ) ;$progfun = DllCallbackRegister ( "prog", " ;Else $verresult = DllCall ( $ghwimlib, "int:cdecl", "wimlib_verify_wim", "ptr", $Wimstruct, "int", 0 ) ;EndIf If @error Then Return SetError ( 2, -1 ) EndIf _DebugArrayDisplay($verresult, "wimlib_verify_wim $verresult") Return $verresult[0] EndFunc Func _wimlib_get_image_name ( $Wimstruct, $image ) If Not IsPtr ( $Wimstruct ) Then Return SetError ( 1, 0, Null ) EndIf $imnaresult = DllCall ( $ghwimlib, "wstr:cdecl", "wimlib_get_image_name", "ptr", $Wimstruct, "int", $image ) If @error Then Return SetError ( 2, 0 ) EndIf Return $imnaresult[0] EndFunc Func _wimlib_get_xml_data ( $Wimstruct ) If Not IsPtr ( $Wimstruct ) Then Return SetError ( 1, 0, Null ) EndIf Local $aReturn[2] Local $ppvImageInfo = DllStructCreate("ptr") ; Buffer for XML Data Local $pcbImageInfo = DllStructCreate("dword") ; Size of buffer in bytes $xmlresult = DllCall ( $ghwimlib, "int:cdecl", "wimlib_get_xml_data", "ptr", $Wimstruct, "ptr", DllStructGetPtr ( $ppvImageInfo ), "ptr", DllStructGetPtr ( $pcbImageInfo ) ) If @error Then Return SetError ( 2, 0, Null ) EndIf _DebugArrayDisplay($xmlresult, "wimlib_get_xml_data $xmlresult") Local $xml = DllStructCreate("byte [" & DllStructGetData($pcbImageInfo, 1) & "]", DllStructGetData($ppvImageInfo, 1)) $aReturn[0] = $xmlresult[0] $aReturn[1] = BinaryToString(DllStructGetData($xml, 1), 2) _WinAPI_LocalFree($ppvImageInfo) _WinAPI_LocalFree($xml) Return $aReturn[1] ;Return DllStructGetData ( $ppvImageInfo, 1 ) EndFunc Func _wimlib_get_wim_info ( $Wimstruct ) If Not IsPtr ( $Wimstruct ) Then Return SetError ( 1, 0, Null ) EndIf $infostruct = DllStructCreate ( $tagwimlib_wim_info ) $wiminforesult = DllCall ( $ghwimlib, "int:cdecl", "wimlib_get_wim_info", "ptr", $Wimstruct, "ptr", DllStructGetPtr ( $infostruct ) ) If @error Then Return SetError ( 2, 0, Null ) EndIf _DebugArrayDisplay($wiminforesult, "wimlib_get_wim_info $wiminforesult") Return $wiminforesult[2] EndFunc And this is what I have for wimlibconstants: #include-once ; #INDEX# ======================================================================================================================= ; Title .........: WIMLib_Constants ; AutoIt Version : 3.3.15.0 ; Description ...: Constants for WIMlib functions. ; Author(s) .....: Higgs, William (whiggs) ; =============================================================================================================================== ; #CONSTANTS# =================================================================================================================== #region ### START $WIMLib Constants ### Global Enum $WIMLIB_ERR_SUCCESS, $WIMLIB_ERR_ALREADY_LOCKED, $WIMLIB_ERR_DECOMPRESSION, $WIMLIB_ERR_FUSE = 6, $WIMLIB_ERR_GLOB_HAD_NO_MATCHES = 8, $WIMLIB_ERR_IMAGE_COUNT = 10, $WIMLIB_ERR_IMAGE_NAME_COLLISION, $WIMLIB_ERR_INSUFFICIENT_PRIVILEGES, $WIMLIB_ERR_INTEGRITY, $WIMLIB_ERR_INVALID_CAPTURE_CONFIG, $WIMLIB_ERR_INVALID_CHUNK_SIZE, $WIMLIB_ERR_INVALID_COMPRESSION_TYPE, $WIMLIB_ERR_INVALID_HEADER, $WIMLIB_ERR_INVALID_IMAGE, $WIMLIB_ERR_INVALID_INTEGRITY_TABLE, $WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY, $WIMLIB_ERR_INVALID_METADATA_RESOURCE, $WIMLIB_ERR_INVALID_OVERLAY = 23, $WIMLIB_ERR_INVALID_PARAM, $WIMLIB_ERR_INVALID_PART_NUMBER, $WIMLIB_ERR_INVALID_PIPABLE_WIM, $WIMLIB_ERR_INVALID_REPARSE_DATA, $WIMLIB_ERR_INVALID_RESOURCE_HASH, $WIMLIB_ERR_INVALID_UTF16_STRING = 30, $WIMLIB_ERR_INVALID_UTF8_STRING, $WIMLIB_ERR_IS_DIRECTORY, $WIMLIB_ERR_IS_SPLIT_WIM, $WIMLIB_ERR_LINK = 35, $WIMLIB_ERR_METADATA_NOT_FOUND, $WIMLIB_ERR_MKDIR, $WIMLIB_ERR_MQUEUE, $WIMLIB_ERR_NOMEM, $WIMLIB_ERR_NOTDIR, $WIMLIB_ERR_NOTEMPTY, $WIMLIB_ERR_NOT_A_REGULAR_FILE, $WIMLIB_ERR_NOT_A_WIM_FILE, $WIMLIB_ERR_NOT_PIPABLE, $WIMLIB_ERR_NO_FILENAME, $WIMLIB_ERR_NTFS_3G, $WIMLIB_ERR_OPEN, $WIMLIB_ERR_OPENDIR, $WIMLIB_ERR_PATH_DOES_NOT_EXIST, $WIMLIB_ERR_READ, $WIMLIB_ERR_READLINK, $WIMLIB_ERR_RENAME, $WIMLIB_ERR_REPARSE_POINT_FIXUP_FAILED = 54, $WIMLIB_ERR_RESOURCE_NOT_FOUND, $WIMLIB_ERR_RESOURCE_ORDER, $WIMLIB_ERR_SET_ATTRIBUTES, $WIMLIB_ERR_SET_REPARSE_DATA, $WIMLIB_ERR_SET_SECURITY, $WIMLIB_ERR_SET_SHORT_NAME, $WIMLIB_ERR_SET_TIMESTAMPS, $WIMLIB_ERR_SPLIT_INVALID, $WIMLIB_ERR_STAT, $WIMLIB_ERR_UNEXPECTED_END_OF_FILE = 65, $WIMLIB_ERR_UNICODE_STRING_NOT_REPRESENTABLE, $WIMLIB_ERR_UNKNOWN_VERSION, $WIMLIB_ERR_UNSUPPORTED, $WIMLIB_ERR_UNSUPPORTED_FILE, $WIMLIB_ERR_WIM_IS_READONLY = 71, $WIMLIB_ERR_WRITE, $WIMLIB_ERR_XML, $WIMLIB_ERR_WIM_IS_ENCRYPTED, $WIMLIB_ERR_WIMBOOT, $WIMLIB_ERR_ABORTED_BY_PROGRESS, $WIMLIB_ERR_UNKNOWN_PROGRESS_STATUS, $WIMLIB_ERR_MKNOD, $WIMLIB_ERR_MOUNTED_IMAGE_IS_BUSY, $WIMLIB_ERR_NOT_A_MOUNTPOINT, $WIMLIB_ERR_NOT_PERMITTED_TO_UNMOUNT, $WIMLIB_ERR_FVE_LOCKED_VOLUME, $WIMLIB_ERR_UNABLE_TO_READ_CAPTURE_CONFIG, $WIMLIB_ERR_WIM_IS_INCOMPLETE, $WIMLIB_ERR_COMPACTION_NOT_POSSIBLE, $WIMLIB_ERR_IMAGE_HAS_MULTIPLE_REFERENCES, $WIMLIB_ERR_DUPLICATE_EXPORTED_IMAGE, $WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED, $WIMLIB_ERR_SNAPSHOT_FAILURE, $WIMLIB_ERR_INVALID_XATTR, $WIMLIB_ERR_SET_XATTR Global Enum $WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN, $WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN, $WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE = 3, $WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS, $WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN, $WIMLIB_PROGRESS_MSG_EXTRACT_METADATA, $WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END, $WIMLIB_PROGRESS_MSG_EXTRACT_TREE_END, $WIMLIB_PROGRESS_MSG_SCAN_BEGIN, $WIMLIB_PROGRESS_MSG_SCAN_DENTRY, $WIMLIB_PROGRESS_MSG_SCAN_END, $WIMLIB_PROGRESS_MSG_WRITE_STREAMS, $WIMLIB_PROGRESS_MSG_WRITE_METADATA_BEGIN, $WIMLIB_PROGRESS_MSG_WRITE_METADATA_END, $WIMLIB_PROGRESS_MSG_RENAME, $WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY, $WIMLIB_PROGRESS_MSG_CALC_INTEGRITY, $WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART = 19, $WIMLIB_PROGRESS_MSG_SPLIT_END_PART, $WIMLIB_PROGRESS_MSG_UPDATE_BEGIN_COMMAND, $WIMLIB_PROGRESS_MSG_UPDATE_END_COMMAND, $WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM, $WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE, $WIMLIB_PROGRESS_MSG_UNMOUNT_BEGIN, $WIMLIB_PROGRESS_MSG_DONE_WITH_FILE, $WIMLIB_PROGRESS_MSG_BEGIN_VERIFY_IMAGE, $WIMLIB_PROGRESS_MSG_END_VERIFY_IMAGE, $WIMLIB_PROGRESS_MSG_VERIFY_STREAMS, $WIMLIB_PROGRESS_MSG_TEST_FILE_EXCLUSION, $WIMLIB_PROGRESS_MSG_HANDLE_ERROR Global Enum $WIMLIB_PROGRESS_STATUS_CONTINUE, $WIMLIB_PROGRESS_STATUS_ABORT Global Enum $WIMLIB_UPDATE_OP_ADD, $WIMLIB_UPDATE_OP_DELETE, $WIMLIB_UPDATE_OP_RENAME Global Const $WIMLIB_ADD_FLAG_BOOT = 0x00000008 Global Const $WIMLIB_ADD_FLAG_DEREFERENCE = 0x00000002 Global Const $WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE = 0x00000080 Global Const $WIMLIB_ADD_FLAG_FILE_PATHS_UNNEEDED = 0x00010000 Global Const $WIMLIB_ADD_FLAG_NO_ACLS = 0x00000020 Global Const $WIMLIB_ADD_FLAG_NO_REPLACE = 0x00002000 Global Const $WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE = 0x00000400 Global Const $WIMLIB_ADD_FLAG_NORPFIX = 0x00000200 Global Const $WIMLIB_ADD_FLAG_NTFS = 0x00000001 Global Const $WIMLIB_ADD_FLAG_RPFIX = 0x00000100 Global Const $WIMLIB_ADD_FLAG_SNAPSHOT = 0x00008000 Global Const $WIMLIB_ADD_FLAG_STRICT_ACLS = 0x00000040 Global Const $WIMLIB_ADD_FLAG_TEST_FILE_EXCLUSION = 0x00004000 Global Const $WIMLIB_ADD_FLAG_UNIX_DATA = 0x00000010 Global Const $WIMLIB_ADD_FLAG_VERBOSE = 0x00000004 Global Const $WIMLIB_ADD_FLAG_WIMBOOT = 0x00001000 Global Const $WIMLIB_ADD_FLAG_WINCONFIG = 0x00000800 Global Const $WIMLIB_ALL_IMAGES = -1 Global Const $WIMLIB_CHANGE_BOOT_INDEX = 0x00000004 Global Const $WIMLIB_CHANGE_GUID = 0x00000002 Global Const $WIMLIB_CHANGE_READONLY_FLAG = 0x00000001 Global Const $WIMLIB_CHANGE_RPFIX_FLAG = 0x00000008 Global Const $WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE = 0x80000000 Global Const $WIMLIB_DELETE_FLAG_FORCE = 0x00000001 Global Const $WIMLIB_DELETE_FLAG_RECURSIVE = 0x00000002 Global Const $WIMLIB_EXPORT_FLAG_BOOT = 0x00000001 Global Const $WIMLIB_EXPORT_FLAG_GIFT = 0x00000008 Global Const $WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS = 0x00000004 Global Const $WIMLIB_EXPORT_FLAG_NO_NAMES = 0x00000002 Global Const $WIMLIB_EXPORT_FLAG_WIMBOOT = 0x00000010 Global Const $WIMLIB_EXTRACT_FLAG_ALL_CASE_CONFLICTS = 0x00001000 Global Const $WIMLIB_EXTRACT_FLAG_COMPACT_LZX = 0x08000000 Global Const $WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K = 0x04000000 Global Const $WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K = 0x01000000 Global Const $WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K = 0x02000000 Global Const $WIMLIB_EXTRACT_FLAG_GLOB_PATHS = 0x00040000 Global Const $WIMLIB_EXTRACT_FLAG_NO_ACLS = 0x00000040 Global Const $WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES = 0x00100000 Global Const $WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE = 0x00200000 Global Const $WIMLIB_EXTRACT_FLAG_NORPFIX = 0x00000200 Global Const $WIMLIB_EXTRACT_FLAG_NTFS = 0x00000001 Global Const $WIMLIB_EXTRACT_FLAG_REPLACE_INVALID_FILENAMES = 0x00000800 Global Const $WIMLIB_EXTRACT_FLAG_RPFIX = 0x00000100 Global Const $WIMLIB_EXTRACT_FLAG_STRICT_ACLS = 0x00000080 Global Const $WIMLIB_EXTRACT_FLAG_STRICT_GLOB = 0x00080000 Global Const $WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES = 0x00004000 Global Const $WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS = 0x00008000 Global Const $WIMLIB_EXTRACT_FLAG_STRICT_TIMESTAMPS = 0x00002000 Global Const $WIMLIB_EXTRACT_FLAG_TO_STDOUT = 0x00000400 Global Const $WIMLIB_EXTRACT_FLAG_UNIX_DATA = 0x00000020 Global Const $WIMLIB_EXTRACT_FLAG_WIMBOOT = 0x00400000 Global Const $WIMLIB_FILE_ATTRIBUTE_ARCHIVE = 0x00000020 Global Const $WIMLIB_FILE_ATTRIBUTE_COMPRESSED = 0x00000800 Global Const $WIMLIB_FILE_ATTRIBUTE_DEVICE = 0x00000040 Global Const $WIMLIB_FILE_ATTRIBUTE_DIRECTORY = 0x00000010 Global Const $WIMLIB_FILE_ATTRIBUTE_ENCRYPTED = 0x00004000 Global Const $WIMLIB_FILE_ATTRIBUTE_HIDDEN = 0x00000002 Global Const $WIMLIB_FILE_ATTRIBUTE_NORMAL = 0x00000080 Global Const $WIMLIB_FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x00002000 Global Const $WIMLIB_FILE_ATTRIBUTE_OFFLINE = 0x00001000 Global Const $WIMLIB_FILE_ATTRIBUTE_READONLY = 0x00000001 Global Const $WIMLIB_FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400 Global Const $WIMLIB_FILE_ATTRIBUTE_SPARSE_FILE = 0x00000200 Global Const $WIMLIB_FILE_ATTRIBUTE_SYSTEM = 0x00000004 Global Const $WIMLIB_FILE_ATTRIBUTE_TEMPORARY = 0x00000100 Global Const $WIMLIB_FILE_ATTRIBUTE_VIRTUAL = 0x00010000 Global Const $WIMLIB_GUID_LEN = 16 Global Const $WIMLIB_INIT_FLAG_ASSUME_UTF8 = 0x00000001 Global Const $WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE = 0x00000020 Global Const $WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE = 0x00000010 Global Const $WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES = 0x00000002 Global Const $WIMLIB_INIT_FLAG_STRICT_APPLY_PRIVILEGES = 0x00000008 Global Const $WIMLIB_INIT_FLAG_STRICT_CAPTURE_PRIVILEGES = 0x00000004 ;Global Const $WIMLIB_IS_WIM_ROOT_PATH Global Const $WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN = 0x00000002 Global Const $WIMLIB_ITERATE_DIR_TREE_FLAG_RECURSIVE = 0x00000001 Global Const $WIMLIB_ITERATE_DIR_TREE_FLAG_RESOURCES_NEEDED = 0x00000004 Global Const $WIMLIB_MAJOR_VERSION = 1 Global Const $WIMLIB_MINOR_VERSION = 2 Global Const $WIMLIB_MOUNT_FLAG_ALLOW_OTHER = 0x00000040 Global Const $WIMLIB_MOUNT_FLAG_DEBUG = 0x00000002 Global Const $WIMLIB_MOUNT_FLAG_READWRITE = 0x00000001 Global Const $WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_NONE = 0x00000004 Global Const $WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_WINDOWS = 0x00000010 Global Const $WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_XATTR = 0x00000008 Global Const $WIMLIB_MOUNT_FLAG_UNIX_DATA = 0x00000020 Global Const $WIMLIB_NO_IMAGE = 0 Global Const $WIMLIB_OPEN_FLAG_CHECK_INTEGRITY = 0x00000001 Global Const $WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT = 0x00000002 Global Const $WIMLIB_OPEN_FLAG_WRITE_ACCESS = 0x00000004 Global Const $WIMLIB_PATCH_VERSION = 5 Global Const $WIMLIB_REF_FLAG_GLOB_ENABLE = 0x00000001 Global Const $WIMLIB_REF_FLAG_GLOB_ERR_ON_NOMATCH = 0x00000002 Global Const $WIMLIB_REPARSE_TAG_DFS = 0x8000000A Global Const $WIMLIB_REPARSE_TAG_DFSR = 0x80000012 Global Const $WIMLIB_REPARSE_TAG_DRIVER_EXTENDER = 0x80000005 Global Const $WIMLIB_REPARSE_TAG_FILTER_MANAGER = 0x8000000B Global Const $WIMLIB_REPARSE_TAG_HSM = 0xC0000004 Global Const $WIMLIB_REPARSE_TAG_HSM2 = 0x80000006 Global Const $WIMLIB_REPARSE_TAG_MOUNT_POINT = 0xA0000003 Global Const $WIMLIB_REPARSE_TAG_RESERVED_ONE = 0x00000001 Global Const $WIMLIB_REPARSE_TAG_RESERVED_ZERO = 0x00000000 Global Const $WIMLIB_REPARSE_TAG_SIS = 0x80000007 Global Const $WIMLIB_REPARSE_TAG_SYMLINK = 0xA000000C Global Const $WIMLIB_REPARSE_TAG_WOF = 0x80000017 Global Const $WIMLIB_UNMOUNT_FLAG_CHECK_INTEGRITY = 0x00000001 Global Const $WIMLIB_UNMOUNT_FLAG_COMMIT = 0x00000002 Global Const $WIMLIB_UNMOUNT_FLAG_FORCE = 0x00000010 Global Const $WIMLIB_UNMOUNT_FLAG_NEW_IMAGE = 0x00000020 Global Const $WIMLIB_UNMOUNT_FLAG_REBUILD = 0x00000004 Global Const $WIMLIB_UNMOUNT_FLAG_RECOMPRESS = 0x00000008 Global Const $WIMLIB_UPDATE_FLAG_SEND_PROGRESS = 0x00000001 Global Const $WIMLIB_WIM_PATH_SEPARATOR = "\" Global Const $WIMLIB_WIM_PATH_SEPARATOR_STRING = "\" Global Const $WIMLIB_WIM_ROOT_PATH = $WIMLIB_WIM_PATH_SEPARATOR_STRING Global Const $WIMLIB_WRITE_FLAG_CHECK_INTEGRITY = 0x00000001 Global Const $WIMLIB_WRITE_FLAG_FSYNC = 0x00000020 Global Const $WIMLIB_WRITE_FLAG_IGNORE_READONLY_FLAG = 0x00000100 Global Const $WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY = 0x00000002 Global Const $WIMLIB_WRITE_FLAG_NO_SOLID_SORT = 0x00004000 Global Const $WIMLIB_WRITE_FLAG_NOT_PIPABLE = 0x00000008 Global Const $WIMLIB_WRITE_FLAG_PIPABLE = 0x00000004 Global Const $WIMLIB_WRITE_FLAG_REBUILD = 0x00000040 Global Const $WIMLIB_WRITE_FLAG_RECOMPRESS = 0x00000010 Global Const $WIMLIB_WRITE_FLAG_RETAIN_GUID = 0x00000800 Global Const $WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES = 0x00002000 Global Const $WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS = 0x00000200 Global Const $WIMLIB_WRITE_FLAG_SOFT_DELETE = 0x00000080 Global Const $WIMLIB_WRITE_FLAG_SOLID = 0x00001000 Global Const $WIMLIB_WRITE_FLAG_STREAMS_OK = 0x00000400 Global Const $WIMLIB_WRITE_FLAG_UNSAFE_COMPACT = 0x00008000 Global Const $tagwimlib_wim_info = "byte guid[" & $WIMLIB_GUID_LEN & "];dword image_count;dword boot_index;dword wim_version;dword chunk_size;word part_number;word total_parts;int compression_type;UINT64 total_bytes;DWORD has_integrity_table;DWORD opened_from_file;DWORD is_readonly;DWORD has_rpfix;DWORD is_marked_readonly;DWORD spanned;DWORD write_in_progress;DWORD metadata_only;DWORD resource_only;DWORD pipable;DWORD reserved_flags;DWORD reserved[9]" Global Const $tagwimlib_progress_info_write_streams = "UINT64 total_bytes;UINT64 total_streams;UINT64 completed_bytes;UINT64 completed_streams;UINT num_threads;UINT compression_type;UINT total_parts;UINT completed_parts" Global Const $tagwimlib_progress_info_scan = "wstr ;wstr " Global Const $tagwimlib_progress_info_done_with_file = "wstr path_to_file" Global Const $tagwimlib_progress_info_integrity = "UINT64 total_bytes;UINT64 completed_bytes;dword total_chunks;dword completed_chunks;dword chunk_size;wstr filename" Global Const $tagwimlib_progress_info_verify_image = "wstr wimfile;UINT total_images;UINT current_image"
  21. So, Turns out I did have the actual latest version of the udf. It was updated again since the last time I downloaded it. Downloaded and used latest version and issue was resolved. Sorry for the false alarm.
  22. I see you include some debug functions in the snippette. Does the debug tell you anything? The only suggestion that I can think of is to include a couple of brief "sleep" functions in between the other functions. Give the environment time to actually process the key strokes and all that.
  23. Hey all. I want to write a simple autoit script which will simply create a translucent, colored circle around the mouse cursor's current location that fades away over time whenever the mouse is clicked. I would like for both left and right clicks to have their own color. I have a feeling that the GDI plus UDF contains the functions that I would need to do this, but I have never worked with GDI before and am not sure where to start. Any input would be awesome.
  24. Hello all. So, normally when I want to pull specific sections out of a file path, I use @Guiness's awesome "_Getfilename*" functions: Func _GetFilename($sFilePath) Local $oWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & "." & "\root\cimv2") Local $oColFiles = $oWMIService.ExecQuery("Select * From CIM_Datafile Where Name = '" & StringReplace(StringReplace($sFilePath, "\", "\\"), "'", "\'") & "'") If IsObj($oColFiles) Then For $oObjectFile In $oColFiles Return $oObjectFile.FileName Next EndIf Return SetError(1, 1, 0) EndFunc ;==>_GetFilename Func _GetFilenameExt($sFilePath) Local $oWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & "." & "\root\cimv2") Local $oColFiles = $oWMIService.ExecQuery("Select * From CIM_Datafile Where Name = '" & StringReplace(StringReplace($sFilePath, "\", "\\"), "'", "\'") & "'") If IsObj($oColFiles) Then For $oObjectFile In $oColFiles Return $oObjectFile.Extension Next EndIf Return SetError(1, 1, 0) EndFunc ;==>_GetFilenameExt Func _GetFilenameInt($sFilePath) Local $oWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & "." & "\root\cimv2") Local $oColFiles = $oWMIService.ExecQuery("Select * From CIM_Datafile Where Name = '" & StringReplace(StringReplace($sFilePath, "\", "\\"), "'", "\'") & "'") If IsObj($oColFiles) Then For $oObjectFile In $oColFiles Return $oObjectFile.Name Next EndIf Return SetError(1, 1, 0) EndFunc ;==>_GetFilenameInt Func _GetFilenameDrive($sFilePath) Local $oWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & "." & "\root\cimv2") Local $oColFiles = $oWMIService.ExecQuery("Select * From CIM_Datafile Where Name = '" & StringReplace(StringReplace($sFilePath, "\", "\\"), "'", "\'") & "'") If IsObj($oColFiles) Then For $oObjectFile In $oColFiles Return StringUpper($oObjectFile.Drive) Next EndIf Return SetError(1, 1, 0) EndFunc ;==>_GetFilenameDrive Func _GetFilenamePath($sFilePath) Local $oWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & "." & "\root\cimv2") Local $oColFiles = $oWMIService.ExecQuery("Select * From CIM_Datafile Where Name = '" & StringReplace(StringReplace($sFilePath, "\", "\\"), "'", "\'") & "'") If IsObj($oColFiles) Then For $oObjectFile In $oColFiles Return $oObjectFile.Path Next EndIf Return SetError(1, 1, 0) EndFunc ;==>_GetFilenamePath However, these functions do not work when the file that is queried is stored on a remote smb share. Now, I could just split the file path string using "\" as the delimeter to obtain the same information, but I wanted to see if there was a more....appropriate I guess...method that I could use to query this information when the file is stored on a remote smb file share. Thank you in advance.
×
×
  • Create New...