-
Posts
5,295 -
Joined
-
Last visited
-
Days Won
1
weaponx last won the day on February 12 2017
weaponx had the most liked content!
About weaponx
Profile Information
-
Member Title
I'm coming for blood, no code of conduct, no law.
-
Location
Ohio
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
weaponx's Achievements
Universalist (7/7)
17
Reputation
-
Leendert-Jan reacted to a post in a topic: Progress Bar
-
maniootek reacted to a post in a topic: string split escape/ignore quoted delimiters
-
JoeBar reacted to a post in a topic: Progress Bar
-
vitor_akr reacted to a post in a topic: Convert Date Formats From String [Solved]
-
hugomito reacted to a post in a topic: Script to locate shares and show mappings.
-
tempman reacted to a post in a topic: Getting full name @username?
-
Xandy reacted to a post in a topic: XML Namespace?
-
ahmeddzcom reacted to a post in a topic: odd or even?
-
weaponx reacted to a post in a topic: Remove empty rows in 2D array...
-
AnonymousX reacted to a post in a topic: Remove empty rows in 2D array...
-
Does anyone use RecursiveFileSearch by weaponx?
weaponx replied to jaja714's topic in AutoIt General Help and Support
This will search within the folder "Base" for any folders beginning with "Dir" only. $array = RecursiveFileSearch("Base", "", "^(Dir)", 2) For $X = 0 to $array[0] ConsoleWrite('['&$X&']: ' & $array[$X] & @CRLF) ;ConsoleWrite(StringTrimLeft($array[$X], 9) & @CRLF) Next #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.10.0 Author: WeaponX Updated: 2/21/08 Script Function: Recursive file search 2/21/08 - Added pattern for folder matching, flag for return type 1/24/08 - Recursion is now optional Parameters: RFSstartdir: Path to starting folder RFSFilepattern: RegEx pattern to match ".(mp3)" - Find all mp3 files - case sensitive (by default) "(?i).(mp3)" - Find all mp3 files - case insensitive "(?-i).(mp3|txt)" - Find all mp3 and txt files - case sensitive RFSFolderpattern: "(Music|Movies)" - Only match folders named Music or Movies - case sensitive (by default) "(?i)(Music|Movies)" - Only match folders named Music or Movies - case insensitive "(?!(Music|Movies)b)bw+" - Match folders NOT named Music or Movies - case sensitive (by default) RFSFlag: Specifies what is returned in the array 0 - Files and folders 1 - Files only 2 - Folders only RFSrecurse: TRUE = Recursive, FALSE = Non-recursive RFSdepth: Internal use only #ce ---------------------------------------------------------------------------- Func RecursiveFileSearch($RFSstartDir, $RFSFilepattern = ".", $RFSFolderpattern = ".", $RFSFlag = 0, $RFSrecurse = true, $RFSdepth = 0) ;Ensure starting folder has a trailing slash If StringRight($RFSstartDir, 1) <> "" Then $RFSstartDir &= "" If $RFSdepth = 0 Then ;Get count of all files in subfolders for initial array definition $RFSfilecount = DirGetSize($RFSstartDir, 1) ;File count + folder count (will be resized when the function returns) Global $RFSarray[$RFSfilecount[1] + $RFSfilecount[2] + 1] EndIf $RFSsearch = FileFindFirstFile($RFSstartDir & "*.*") If @error Then Return ;Search through all files and folders in directory While 1 $RFSnext = FileFindNextFile($RFSsearch) If @error Then ExitLoop ;ConsoleWrite($RFSnext & @CRLF) ;If folder and recurse flag is set and regex matches If StringInStr(FileGetAttrib($RFSstartDir & $RFSnext), "D") Then If $RFSrecurse Then RecursiveFileSearch($RFSstartDir & $RFSnext, $RFSFilepattern, $RFSFolderpattern, $RFSFlag, $RFSrecurse, $RFSdepth + 1) If $RFSFlag <> 1 AND StringRegExp($RFSnext, $RFSFolderpattern, 0)Then ;Append folder name to array $RFSarray[$RFSarray[0] + 1] = $RFSstartDir & $RFSnext $RFSarray[0] += 1 EndIf EndIf ElseIf StringRegExp($RFSnext, $RFSFilepattern, 0) AND $RFSFlag <> 2 Then ;Append file name to array $RFSarray[$RFSarray[0] + 1] = $RFSstartDir & $RFSnext $RFSarray[0] += 1 EndIf WEnd FileClose($RFSsearch) If $RFSdepth = 0 Then Redim $RFSarray[$RFSarray[0] + 1] Return $RFSarray EndIf EndFunc ;==>RecursiveFileSearch -
I'll see what I can do. As of right now the UDF only retrieves information. I intended it to do everything Devcon can but testing it is very tricky if I want to avoid hosing my system.
-
Magnify alternatively 2 desktop area
weaponx replied to myspacee's topic in AutoIt General Help and Support
Are you using gdi for this? Sounds a little insane when Windows 7 comes with a magnification tool. http://windows.microsoft.com/en-US/windows7/Make-items-on-the-screen-appear-bigger-Magnifier -
pulling up a similar but wrong field
weaponx replied to gcue's topic in AutoIt General Help and Support
The only problem I have with this is it leaves the carriage return at the end of the match, and it I can't get it to ignore it. -
pulling up a similar but wrong field
weaponx replied to gcue's topic in AutoIt General Help and Support
You can't copy and paste AutoIt code because it puts it all on one line, you have to click Popup then copy it. -
pulling up a similar but wrong field
weaponx replied to gcue's topic in AutoIt General Help and Support
$string = _ 'Last Login Time: 07:22:03 pm 03/10/10' & @CRLF & _ 'Account Locked: False' & @CRLF & _ 'Account Disabled: False' & @CRLF & _ 'Grace Logins Allowed: 3' & @CRLF & _ 'Remaining Grace Logins: 3' & @CRLF & _ 'Last Intruder Address:' & @CRLF & _ 'TCP/IP Network Address' & @CRLF & _ 'IP Address: 30.20.222.74' & @CRLF & _ 'Maximum Connections: 6' & @CRLF & _ 'Login Script:' & @CRLF & _ 'map k:=lao-nws_user_server\users2:' & @CRLF & _ '' & @CRLF & _ '@NET USE x: \\loap01\teams' & @CRLF & _ 'Login Time: 05:09:48 am 03/11/10' & @CRLF & _ 'modifiersName: CN=CGNDSDR' $result = StringRegExp($string, "(?m)^Login Time: (.+)",1) If @ERROR Then MsgBox(0,"",@ERROR) For $X = 0 to Ubound($result)-1 ConsoleWrite($result[$X] & @CRLF) Next -
reconstructing data from html table
weaponx replied to gcue's topic in AutoIt General Help and Support
Have you tried _IETableWriteToArray ? -
Using the XML UDF you can indent an XML file using one line... _XMLTransform("", "", "") This calls a default stylesheet and applies it to the loaded file.
-
Prevent Process creation from usb stick
weaponx replied to mary's topic in AutoIt General Help and Support
So the files can be renamed. They would need to be blocked by a hash. -
Prevent Process creation from usb stick
weaponx replied to mary's topic in AutoIt General Help and Support
What good is this if the files can be copied from the removable device and executed? -
Huh? Nobody uses ftp for local network file sharing. If you have admin rights on these systems you can just use named pipes. Fyzzle can you provide any code?
-
passing operators to imagemagick
weaponx replied to RasmusN's topic in AutoIt General Help and Support
Rather than passing the options individually, why can't you just pass it as one string? Global $img = ObjCreate("ImageMagickObject.MagickImage.1") $options = '' $options &= "source.JPG " $options &= "-gravity " $options &= "south " $options &= "-background " $options &= "#afbc22 " $options &= "-splice " $options &= "0x60 " $options &= "-font " $options &= "OCR-A-Extended " $options &= "-pointsize " $options &= "12 " $options &= "-annotate " $options &= "+0+0 " $options &= "filename goes here " $options &= "testoutput.jpg" $NewImage = $img.Convert($options) -
How to add details in a picture(gif)
weaponx replied to iamsandeep's topic in AutoIt General Help and Support
#include <GuiConstantsEx.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> ; Initialize GDI+ library _GDIPlus_Startup () ; Capture full screen $hBitmap = _ScreenCapture_Capture() ;Capture window ;$hWin = WinGetHandle ("SciTE") ;$hBitmap = _ScreenCapture_CaptureWnd('', $hWin) $hImage = _GDIPlus_BitmapCreateFromHBITMAP ($hBitmap) $hGraphic = _GDIPlus_ImageGetGraphicsContext ($hImage) ;Get dimensions $iWidth = _GDIPlus_ImageGetWidth($hImage) $iHeight = _GDIPlus_ImageGetHeight($hImage) $sCLSID = _GDIPlus_EncodersGetCLSID ("JPG") ;Draw semi transparent rectangle along bottom $hBrush1 = _GDIPlus_BrushCreateSolid(0x7F000000) _GDIPlus_GraphicsFillRect($hGraphic, 0, $iHeight-40,$iWidth,40,$hBrush1) ;Define font $hBrush2 = _GDIPlus_BrushCreateSolid (0xFFFFFFFF) ;Text color (white) $hFormat = _GDIPlus_StringFormatCreate() _GDIPlus_StringFormatSetAlign($hFormat,1) ;Center text horizontally $hFamily = _GDIPlus_FontFamilyCreate ("Arial") ;Typeface $hFont = _GDIPlus_FontCreate ($hFamily, 20, 1) ;Font style (20pt, bold) $tLayout = _GDIPlus_RectFCreate (0, $iHeight-40,$iWidth,40) ;Draw text along bottom _GDIPlus_GraphicsDrawStringEx ($hGraphic, "Hello world", $hFont, $tLayout, $hFormat, $hBrush2) ; Save resultant image (high quality) $tParams = _GDIPlus_ParamInit (1) $tData = DllStructCreate("int Quality") DllStructSetData($tData, "Quality", 100) ;quality 0-100 $pData = DllStructGetPtr($tData) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) $pParams = DllStructGetPtr($tParams) _GDIPlus_ImageSaveToFileEx($hImage, @MyDocumentsDir & "\GDIPlus_Image.jpg", $sCLSID, $pParams) ; Save resultant image (low quality) ;_GDIPlus_ImageSaveToFile ($hImage, @MyDocumentsDir & "\GDIPlus_Image.jpg") ; Clean up resources _GDIPlus_ImageDispose ($hImage) _GDIPlus_GraphicsDispose($hGraphic) _WinAPI_DeleteObject ($hBitmap) _GDIPlus_BrushDispose($hBrush1) _GDIPlus_BrushDispose($hBrush2) ; Shut down GDI+ library _GDIPlus_ShutDown () -
Winexists checks hidden windows?
weaponx replied to Jerther's topic in AutoIt General Help and Support
Why can't you install silently using command line switches? -
How can we test this without adequate details? A search for "MCP_EnumPrinter" finds nothing on Google.