Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/15/2019 in all areas

  1. except that this (.*?){1,2} is somewhat inconsistent ( 0 or more chars, lazy, 1 or 2 times ?!? ) Hint : if the translation of the regex in "usual" language makes no sense, this probably means that the regex makes no sense too
    3 points
  2. Function IsMap() requires AutoIt version 3.3.15.0 or 3.3.15.1 beta
    1 point
  3. I'm sorry to plug my program here but I must, for there is something this hobbyist may have gleamed from its vast reserves if he had known in advance, and therefore not ask this question. Which wastes all our time! That's important! If you look at what I did there, $aRegExSFile, it perfectly matches this situation. (((.*)(?=\\)\N)|(\\))(.*?)\z The only difference is change \z to $, add stripped_v and .au3, and put the .*? in between them. (((.*)(?=\\)\N)|(\\))(stripped_v)(.*?)(.au3)$ https://www.debuggex.com/r/AwbaT9ONYtDiqO7W
    1 point
  4. Yes. It was not explicit in the OPs requirements but I assumed that what was to be matched was a version number with a correct syntax
    1 point
  5. Right. It should be : 'stripped_v\d+(?:\.\d+)*\.au3$' ( trailing $ added) You perfectly showed that regex is not as simple as it seems this one matches "stripped_vademecum#;;lol-.au3" ....
    1 point
  6. That wouldn't work with "stripped_v5.au3.txt". But this simple "^stripped_v.+\.au3$" is working, no ?
    1 point
  7. Consistent ? yes. Efficient ? no. Just test it on this Global $Fileversion[6] = ["asdasfasfasd", _ "stripped_v5.au3", _ "stripped_v......au3", _ "stripped_v.....5.au3", _ "stripped_v15.12.10.10.au3", _ "stripped_v5....au3"] Here is the clean way $RegExp = StringRegExp($Fileversion[$i], 'stripped_v\d+(?:\.\d+)*\.au3', 3)
    1 point
  8. @youtuber You shouldn't even escape the dot in the character class, since it's automatically taken as literal character; you should instead escape the one outside the character class, before the file extension: stripped_v[\d.]\.au3 stripped_v[0-9.]\.au3
    1 point
  9. they are all regex, and either can be built to accomodate large buckets of edge cases. I dont know that there is anywhere to find a preference that isnt pedantic af.
    1 point
  10. @Subz link is important. Why?. Well, structuring your code will save you trouble in the future when you get more creative as you know more and your code ends up too big for a single file. You will end up writing UDFs to simplify the maintenance of the code as you add more stuff to it. So, yes, do declare what you know will be global and what you know will be local. Do it for your mental health
    1 point
  11. So the software should appear in either 32bit or 64bit key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall You should be able to use the InstallPath (not always set) or UninstallString to get the path of your file,
    1 point
  12. Lecdev

    MailSlot

    I know this is pretty old now but i was trying to get comms accross local system, admin and limited users for months in windows 10 and was just not having any luck with anything at all. ended up finding this solution, CreateFileW kernel32 dll call to create the handle to write the message in mailslot.au3 had to be changed because it still worked between admin and another limited user as it was, but not from local system to any other user. had to change the file attributes to normal instead of the original flag $SECURITY_ANONYMOUS. see below only after this would the security attributes pointer used to create the mailslot actually take affect on the system account. Func _MailSlotWrite($sMailSlotName, $vData, $iMode = 0) Local $aCall = DllCall("kernel32.dll", "ptr", "CreateFileW", _ "wstr", $sMailSlotName, _ "dword", 0x40000000, _ ; GENERIC_WRITE "dword", 1, _ ; FILE_SHARE_READ "ptr", 0, _ ; lp security attributes (ignored on open existing) "dword", 3, _ ; OPEN_EXISTING "dword", 128, _ ; 0, _ ; SECURITY_ANONYMOUS replaced with file attribute normal 128 "ptr", 0) ; ......... above now works when creating the mailslot with a security pointer which i have used permissions.au3 udf to create, shown below. #include "MailSlot.au3" #include <Permissions.au3> Global Const $sMailSlotName = "\\.\mailslot\SampleCrossSessonMailslot" Global $ptrSecurityDescriptor = _ConvertStringSecurityDescriptorToSecurityDescriptor("O:BAD:(A;OICI;GRGW;;;AU)(A;OICI;GA;;;BA)(A;OICI;GA;;;SY)") If @error Then Global $aError = DllCall("kernel32.dll", "dword", "GetLastError") if not @Compiled Then ConsoleWrite("err: " & $aError[0] & @CR) EndIf Global $tSecurityAttributes = DllStructCreate("dword Length;ptr Descriptor;bool InheritHandle") DllStructSetData($tSecurityAttributes, 1, DllStructGetSize($tSecurityAttributes)) DllStructSetData($tSecurityAttributes, 2, DllStructGetPtr($ptrSecurityDescriptor)) DllStructSetData($tSecurityAttributes, 3, 0) ; InheritHandle = FALSE Global $hMailSlot = _MailSlotCreate($sMailSlotName,0,0,$tSecurityAttributes) hopefully this saves someone else from banging their head against the wall.
    1 point
×
×
  • Create New...