Jump to content

weaponx

MVPs
  • Posts

    5,295
  • Joined

  • Last visited

  • Days Won

    1

weaponx last won the day on February 12 2017

weaponx had the most liked content!

3 Followers

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

Universalist (7/7)

17

Reputation

  1. 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
  2. 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.
  3. 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
  4. 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.
  5. You can't copy and paste AutoIt code because it puts it all on one line, you have to click Popup then copy it.
  6. $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
  7. 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.
  8. So the files can be renamed. They would need to be blocked by a hash.
  9. What good is this if the files can be copied from the removable device and executed?
  10. 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?
  11. 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)
  12. #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 ()
  13. Why can't you install silently using command line switches?
  14. How can we test this without adequate details? A search for "MCP_EnumPrinter" finds nothing on Google.
×
×
  • Create New...