Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/06/2017 in all areas

  1. Looks like the string max length is 4096 and you are trying to send 6511 characters. Max scriptline length is 4095, so simple cut it in 2 lines. Jos
    1 point
  2. spudw2k

    Drive Mapping Issue

    Good find. I've always worked around this issue, but it is useful to know that Windows has a "feature" to address it. My computer security mindset is a little twitchy, but I think I'd be mostly concerned about mapping a drive with elevated perms and accessing it with a non-elevated account versus the other way around. Thanks for sharing.
    1 point
  3. spudw2k

    First Autoit script

    Firstly, welcome to the forums and well done learning and borrowing from examples. That is how I started (looking at examples and tweaking them to see what impacts/results would happen). I have a couple of suggestions/critiques for ya. For one thing, I see you trigger the next part of your script (inputbox) after selecting a radio button. In your select statement, to evaluate the result from GUIGetMsg, I notice you check which control and the state of the control. Checking the state is pretty erroneous in my opinion; just Case = $idRadio# would be sufficient. Now, if you want to reduce user error, you might want to consider another button (OK, Apply, what-have-you) which then checks to see which radio button is checked... Secondly, this is more of an efficient code writing practice...you build a function for each radio button case. There is a lot of redundant code, particularly in the messages and structure. I do see that there is slight variation on the calculations which is probably the most important part to you. I would recommend trying to make a single function which parameters to alter the input and msg specifications as necessary. This style of coding is dubbed modular. The intent is to eleiminate as much redundant code as feasible and adapt it to work with the necessary use cases. Here is a post I made to describe modular coding; might be worth a quick read. My recommendation would be create a function to handle the input, but depending on which control "activates/calls" it, set a parameter that will determine the messages and calculations appropriate. Keep up the scripting.
    1 point
  4. Echbiahn

    Drive Mapping Issue

    For those who are curious, I found my solution from this article: http://woshub.com/how-to-access-mapped-network-drives-from-the-elevated-apps/ I discovered from testing that the script would not map the network drive with #RequireAdmin line in the code. Using the article above I added the missing registry key and rebooted. All testing after that worked 100% with and without #RequireAdmin.
    1 point
  5. djchaney3, Welcome to the AutoIt forum and thanks for the compliment. What you are doing is an excellent way to learn - and never be afraid to ask questions about bits of code from other members that you do not understand. Sensible forum members will not bite if asked sensible questions - and if the author of the code is not sensible then you will not be learning much anyway ! M23
    1 point
  6. RegWrite is an Autoit function and takes parameters like e.g. RegWrite(KeyName, ValueName, Type, Value) see https://www.autoitscript.com/autoit3/docs/functions/RegWrite.htm C:\Windows\System32\Reg.exe needs to be run, for example Run(@Comspec & ' /c Reg Add HKLM\system\currentcontrolset\services\tcpip\parameters /v "SearchList" /d "domain1.com,domain2.com" /f') To view C:\Windows\System32\Reg.exe commandline syntax at a command prompt type: REG /? or REG ADD /?: C:\WINDOWS\system32>REG ADD /? REG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/f] [/reg:32 | /reg:64] KeyName [\\Machine\]FullKey Machine Name of remote machine - omitting defaults to the current machine. Only HKLM and HKU are available on remote machines. FullKey ROOTKEY\SubKey ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ] SubKey The full name of a registry key under the selected ROOTKEY. /v The value name, under the selected Key, to add. /ve adds an empty value name (Default) for the key. /t RegKey data types [ REG_SZ | REG_MULTI_SZ | REG_EXPAND_SZ | REG_DWORD | REG_QWORD | REG_BINARY | REG_NONE ] If omitted, REG_SZ is assumed. /s Specify one character that you use as the separator in your data string for REG_MULTI_SZ. If omitted, use "\0" as the separator. /d The data to assign to the registry ValueName being added. /f Force overwriting the existing registry entry without prompt. /reg:32 Specifies the key should be accessed using the 32-bit registry view. /reg:64 Specifies the key should be accessed using the 64-bit registry view. Examples: REG ADD \\ABC\HKLM\Software\MyCo Adds a key HKLM\Software\MyCo on remote machine ABC REG ADD HKLM\Software\MyCo /v Data /t REG_BINARY /d fe340ead Adds a value (name: Data, type: REG_BINARY, data: fe340ead) REG ADD HKLM\Software\MyCo /v MRU /t REG_MULTI_SZ /d fax\0mail Adds a value (name: MRU, type: REG_MULTI_SZ, data: fax\0mail\0\0) REG ADD HKLM\Software\MyCo /v Path /t REG_EXPAND_SZ /d ^%systemroot^% Adds a value (name: Path, type: REG_EXPAND_SZ, data: %systemroot%) Notice: Use the caret symbol ( ^ ) inside the expand string
    1 point
  7. Try this: #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include "GUIScrollbars_Ex.au3" Opt("GUIOnEventMode", 1) Const $STM_SETIMAGE = 0x0172 $hGUI = GUICreate("", 220, 200) $GraphicCtrl = GUICtrlCreatePic("", 10, 50, 180, 180) ;GUICtrlCreateGraphic(10, 50, 180, 180) _GUIScrollbars_Generate($hGUI, 0, 400, 0, 0) GUISetState() _GDIPlus_Startup() $Bitmap = _GDIPlus_BitmapCreateFromScan0(180, 180) $Buffer = _GDIPlus_ImageGetGraphicsContext($Bitmap) _GDIPlus_GraphicsSetSmoothingMode($Buffer, 2) _GDIPlus_GraphicsClear($Buffer, 0xFFFFFFFF) _GDIPlus_GraphicsFillPie($Buffer, 10, 10, 160, 160, 0, 360) $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($Bitmap) _WinAPI_DeleteObject(GUICtrlSendMsg($GraphicCtrl, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap)) GUISetOnEvent($GUI_EVENT_CLOSE, "ExitAll") While 1 Sleep(50) WEnd Func ExitAll() _GDIPlus_BitmapDispose($Bitmap) _GDIPlus_GraphicsDispose($Buffer) _WinAPI_DeleteObject($hHBitmap) _GDIPlus_Shutdown() Exit EndFunc ;==>ExitAll @Melba23 you see it works with your UDF.
    1 point
  8. So far we have successfully been able to implement the following: Load the Common Language Runtime (CLR) into the AutoIt process (post 25 by Danyfirex) Examples in the following posts by Danyfirex, junkew and ptrex From the code in post 25 it was possible to create the _AppDomain object (post 56) From there we've managed to translate two AutoHotkey examples. The first example in post 62 loads a XPTable.dll assembly, creates a listview with checkboxes and buttons, and displays the listview in an AutoIt GUI. The second example in post 65 compiles and executes C#-code on the fly. Danyfirex has collected all code and examples in the zip file in post 68 At this point we can load .Net assemblies (DLL-files), compile and execute C#/VB-code on the fly and create simple Windows.Forms GUIs. Example code by ptrex and junkew in posts 80 - 98 shows some issues with .Net Windows.Forms code related to collections of controls. Examples in posts 102 - 110 demonstrates how to handle events. Two event handlers are translated from AutoHotkey code in post 102. trancexx has shown an event handler with reduced code in post 110. (If $aObjects[] is replaced with a dictionary object, the array loop in bottom of the event handler function can be avoided and replaced by a dictionary lookup.) With these event handlers we can handle events from Windows.Forms controls, .Net assemblies and C#/VB-code We've been able to implement all this without too overwhelming effort. Personally I'm happy with what we've achieved and that means I'll scale down my own efforts significantly. It should be possible to create up to several interesting UDFs based on the code in previous posts. Of course the code has to be completed and cleaned up but that should not be too hard. I'll not go into this. Maybe I'll create a few UDFs for my own purposes. But it'll not be soon. It has been fun. Regards Lars.
    1 point
  9. @KickStarter15 AutoIt– Self Extracting Archive (for those who don’t like/want an installer)(includes x86 and x64 components and Aut2Exe and AutoItX) From the official download section Edit: SciTE4AutoIt3_Portable.zip SciTE aswell
    1 point
  10. TheDcoder

    PHP Installer

    @232showtime You can find the windows builds for PHP here (make sure that you get a zip and not a Debug Pack). I would recommend using Thread Safe download with your computer's architecture and your preferred version of PHP, If I were to download PHP I would download PHP 7.1 x64 Thread Safe. PHP 5.x is the older version and most of the PHP apps you would find online are written with PHP 5.x in mind. PHP 7.x is the latest and faster version with a slightly different syntax. If you are looking to run a web server rather than requiring only PHP, then you can try the XAMPP stack. It is a webserver software bundle with a nice control panel, just install and run the web server . It comes with Apache (the HTTP server), PHP (addon for Apache which processes PHP scripts), Maria DB (database server, drop-in replacement for MySQL, but better) and some other software like FileZilla FTP server .
    1 point
  11. JLogan3o13

    PHP Installer

    @232showtime What you have in post #3 would have been much more helpful in your initial post, rather than just a vague "where do I download the language?". I would have responded just the same as TheDcoder given your OP. Perhaps consider giving more information in the future so others aren't offering suggestions which you have already tried
    1 point
  12. SmOke_N

    FTP_Screen

    It'd be pretty obvious via the code if it worked with your wishlist... And from what I've read.. no.. it does exactly what it says it does
    1 point
  13. Your version probably doesn't include _FileListToArrayRec. Do you have _FileListToArray()? Here's a simple function to either search Word and write the paragraph where the text is found or based upon an paragraph index. PS: Sorry about the header, I'm useless when it comes to documentation #include <File.au3> Local $sTextFile = @ScriptDir & "\TextFile.txt" Local $hTextFile = FileOpen($sTextFile, 1) Local $aWordFiles = _FileListToArrayRec(@ScriptDir, "*.docx", 1, 0, 0, 2) Global $oWord = ObjCreate("Word.Application") _WordSearch("The", 1, 1) ;~ Writes the first paragraph instance with the word "The" _WordSearch("Title", 1, 0) ;~ Writes all paragraphs with the word "Title" in it _WordSearch("", 7) ;~ Writes the seventh paragraph FileClose($hTextFile) ; #FUNCTION# ==================================================================================================================== ; Name ..........: _WordSearch ; Description ...: ; Syntax ........: _WordSearch([$sSearch = ""[, $iParagraph = 1[, $iReturn = 1]]]) ; Parameters ....: $sSearch - [optional] Search Text value. Default is "". ; $iParagraph - [optional] Paragraph Index. Default is 1. ; $iReturn - [optional] Paragraph Result. Default is 1. ; Return values .: None ; Author ........: Subz ; Modified ......: ; Remarks .......: If $sSearch is not defined the function will write the paragraph based upon Index ($iParagraph) ; ...............: If the $iParagraph is less than the number of paragraphs in the document returns "". ; ...............: If $sSearch is defined and $iReturn = 0 then will write all paragraphs with the defined "Search Text" ; ...............: within the paragraph. If $iReturn = 1 will retun first instance. ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _WordSearch($sSearch = "", $iParagraph = 1, $iReturn = 1) Local $oWordDoc For $i = 1 To $aWordFiles[0] $oWordDoc = $oWord.Documents.Open($aWordFiles[$i]) If $sSearch = "" Then If $oWordDoc.Paragraphs.Count > $iParagraph Then $vStartRange = $oWordDoc.Paragraphs($iParagraph).Range.Start $vEndRange = $oWordDoc.Paragraphs($iParagraph).Range.End $tRange = $oWordDoc.Range($vStartRange, $vEndRange) $tString = $tRange.Text If $tString <> "" Then FileWrite($hTextFile, $tString & @CRLF) EndIf Else For $j = 1 To $oWordDoc.Paragraphs.Count $iStartRange = $oWordDoc.Paragraphs($j).Range.Start $iEndRange = $oWordDoc.Paragraphs($j).Range.End $tRange = $oWordDoc.Range($iStartRange, $iEndRange) $tString = $tRange.Text $tRange.Find.Text = $sSearch $tRange.Find.Execute If $tRange.Find.Found Then FileWrite($hTextFile, $tString & @CRLF) If $iReturn = 1 Then ExitLoop Next EndIf $oWordDoc.Close() Next Return EndFunc
    1 point
  14. If Word is installed on your computer you could use the Word UDF that comes with AutoIt. Use _Word_DocRangeSet to set the start and end of the paragraph and then use the Copy method to copy the paragraph to the clipboard: https://msdn.microsoft.com/en-us/library/ff837718(v=office.14).aspx
    1 point
  15. Info, Let me google that for you. M23
    1 point
  16. Mat

    winhttp POST method

    Try this: I'm not sure what your problem is, and I haven't worked with the winhttp include before, but I know the method above has worked for me before.
    1 point
×
×
  • Create New...