Jump to content
  1. Skysnake

    Skysnake

  2. meoit

    meoit

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Exit
      Au3toCmd  ---  Avoid false positives
      Since many virus scanners sometimes prevent a "compiled autoit EXE" from being executed as "false positive", the "*.A3X" format is a suitable format to avoid this problem.
      In order to simplify this procedure, I wrote the Au3toCmd script. Here a *.Cmd file is generated from a *.Au3 file. The necessary files Autoit3.exe and *.A3x are added to the "*.Cmd" file as "alternate data streams".
      Now the Autoit Script can be called by clicking on the cmd file and the anti-virus scanners do not recognize the "false positive".
      If the short-term flashing of the CMD window bothers you, you can create a link that runs in a minimized window.
      Unfortunately, because of the "alternate data streams", this CMD file cannot be distributed via FTP or email.
      Only a USB stick or removable disk formatted with NTFS can be used.
      To solve this problem, Au3toCmd can be used to create a ZIP file that is email and FTP compatible.  Only possible on Win10 due to Powershell 5.0
      Expand this ZIP file on the target system and execute the "*.ADS.Run-me-first.cmd" script. The original CMD file is created again and the auxiliary files are deleted.
      Edit;
      The new version also accepts A3X and EXE files. This means that A3X and EXE files that have been compiled with special options can be used.
      As a side effect, other EXE files can also be included in the CMD file and therefore not detectable by virus scanners.
       
      Here the source of Au3toCmd.au3 
      ;============================================================================================================== ; Script Name: Au3toCmd.au3 ; Description: Creates a CMD file from any AU3/A3X/EXE file. ; The CMD file will contain the compiled version (A3X) of the AU3 input file ; and the AUTOIT3.EXE file as alternate data streams. ; Alternativly it will contain any EXE file. ; This avoids the problem with the false positives of the virus scanners. ; If the short-term flashing of the CMD window bothers you, ; create the shortcut on the desktop that runs in a minimized window. ; ; Syntax: Au3toCmd (input-file) ; Default: none ; Parameter: Name of an AU3/A3X/EXE file (optional) ; Requirement(s): When using Zip feature: Powershell 5.0 or higher (Windows 10 is ok) ; Example: Au3toCmd testfile.au3 ; ; Author: Exit ( http://www.autoitscript.com/forum/user/45639-exit ) ; SourceCode: http://www.autoitscript.com/forum/index.php?showtopic=201562 Version: 2020.07.08 ; COPYLEFT: © 2020 Freeware by "Exit" ; ALL WRONGS RESERVED ;============================================================================================================== #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <File.au3> Global $rc, $sSourcepath, $sTargetpath, $sA3Dir, $aPathSplit, $sDrive, $sDir, $sFileName, $sExtension, $sIconPath, $iIconNumber = 0 Exit _Main() Func _Main() $sA3Dir = RegRead("HKLM\SOFTWARE\AutoIt V3\AutoIt", "InstallDir") If Not (FileExists($sA3Dir & "\autoit3.exe") And FileExists($sA3Dir & "\au3check.exe") And FileExists($sA3Dir & "\Aut2Exe\Aut2exe.exe")) Then Exit MsgBox(16 + 262144, Default, "Error: Autoit not installed on this system.", 0) _Sourcepath() $sTargetpath = $sDrive & $sDir & $sFileName & ".cmd" FileDelete($sTargetpath) FileDelete($sTargetpath & ".ADS.*") FileDelete($sTargetpath & ".ADS") If Not FileWriteLine($sTargetpath, _ "@echo off & cls" & @CRLF & _ "rem @echo on & dir /R %~nx0 & pause" & @CRLF & _ "for /f ""delims="" %%F in ('dir /R %~nx0 ^| find /C ""$DATA"" ') do set mycount=%%F" & @CRLF & _ "if .%mycount% == .0 echo Invalid copy of %~nx0. No ADS found. & pause & goto :eof " & @CRLF & _ "if .%mycount% == .1 wmic process call create ""%~f0:prog %*"" " & @CRLF & _ "if .%mycount% == .2 wmic process call create ""%~f0:prog %~f0:a3x %*"" " & @CRLF & _ "rem End of script" & @CRLF) Then _ Return MsgBox(16 + 262144, Default, "Error: Cannot write to output file '" & $sTargetpath & "'", 0) Switch $sExtension Case ".au3" If ShellExecuteWait($sA3Dir & "\au3check.exe", ' -q "' & $sSourcepath & '"') Then _ Exit MsgBox(16 + 262144, Default, "Error: Input file """ & $sSourcepath & """ has Errors.", 0) ShellExecuteWait($sA3Dir & "\Aut2Exe\Aut2exe.exe", "/In " & $sSourcepath & " /out " & $sTargetpath & ":a3x") FileCopy($sA3Dir & "\Autoit3.exe", $sTargetpath & ":prog") Case ".a3x" FileCopy($sSourcepath, $sTargetpath & ":a3x") FileCopy($sA3Dir & "\Autoit3.exe", $sTargetpath & ":prog") Case ".exe" FileCopy($sSourcepath, $sTargetpath & ":prog") EndSwitch If MsgBox(4 + 32 + 256 + 262144, Default, $sTargetpath & " created." & @LF & @LF & "Create a shortcut on the desktop?", 0) = 6 Then FileCreateShortcut($sTargetpath, @DesktopDir & "\" & $sFileName & ".lnk", $sDrive & $sDir, "", "", $sIconPath, "", $iIconNumber, 7) If MsgBox(4 + 32 + 256 + 262144, Default, $sTargetpath & " created." & @LF & @LF & "Create a portable ZIP file ?" & @LF & $sTargetpath & ".ADS.zip", 0) = 6 Then _CreateZip($sTargetpath) If MsgBox(4 + 32 + 256 + 262144, Default, "Run " & $sTargetpath & " ?", 0) = 6 Then ShellExecute($sTargetpath) EndFunc ;==>_Main Func _CreateZip($sTargetpath) If RunWait(@ComSpec & " /c " & 'powershell Compress-Archive -?', "", @SW_HIDE) Then Return MsgBox(64 + 262144, Default, "Zip file cannot be created because the software ""Powershell 5.0"" is not available." & @CRLF & "Install Powershell 5.0 or higher and try again.", 0) Local $sRem = (StringRight($sSourcepath, 4) = ".exe") ? "rem " : "" FileDelete($sTargetpath & ".ADS.*") FileWriteLine($sTargetpath & ".ADS.Run-me-first.cmd", _ "%~d0 & cd %~dp0" & @CRLF & _ "set name1=%~n0" & @CRLF & _ "set name1=%name1:~0,-21%" & @CRLF & _ "set compare1=%cd% " & @CRLF & _ "set compare2=%compare1:AppData\Local\Temp=other% " & @CRLF & _ "if .%compare1%==.%compare2% goto :skip" & @CRLF & _ "echo off & cls " & @CRLF & _ "echo Please extract ALL files from ZIP file first and then run this CMD again. " & @CRLF & _ "Pause & goto :eof" & @CRLF & _ ":skip " & @CRLF & _ "ren %name1%.cmd.ADS.cmd %name1%.cmd" & @CRLF & _ $sRem & "type %name1%.cmd.ADS.a3x > %name1%.cmd:a3x" & @CRLF & _ $sRem & "del %name1%.cmd.ADS.a3x" & @CRLF & _ "type %name1%.cmd.ADS.prog > %name1%.cmd:prog" & @CRLF & _ "del %name1%.cmd.ADS.prog" & @CRLF & _ "move /Y %name1%.cmd .." & @CRLF & _ "cd .. " & @CRLF & _ "echo off & cls " & @CRLF & _ "echo ""%cd%\%name1%.cmd"" created. " & @CRLF & _ "pause " & @CRLF & _ "del .\%name1%.cmd.ADS.zip" & @CRLF & _ "rd /S /Q %name1%.cmd.ADS " & @CRLF & _ "rem End of script" & @CRLF) If Not $sRem Then FileWrite($sTargetpath & ".ADS.a3x", FileRead($sTargetpath & ":a3x")) FileWrite($sTargetpath & ".ADS.cmd", FileRead($sTargetpath)) FileWrite($sTargetpath & ".ADS.prog", FileRead($sTargetpath & ":prog")) ShellExecuteWait("Powershell", "Compress-Archive -Path " & $sTargetpath & ".ADS.* -Update -DestinationPath " & $sTargetpath & ".ADS.zip") If Not FileExists($sTargetpath & ".ADS.zip") Then MsgBox(64 + 262144, Default, "Zip file cannot be created because authorisation problems.", 0) FileDelete($sTargetpath & ".ADS.a3x") FileDelete($sTargetpath & ".ADS.cmd") FileDelete($sTargetpath & ".ADS.prog") FileDelete($sTargetpath & ".ADS.Run-me-first.cmd") EndFunc ;==>_CreateZip Func _Sourcepath() If $cmdline[0] > 0 Then $sSourcepath = $cmdline[1] Select Case FileExists($sSourcepath) Case FileExists($sSourcepath & ".au3") $sSourcepath = $sSourcepath & ".au3" Case FileExists($sSourcepath & ".a3x") $sSourcepath = $sSourcepath & ".a3x" Case FileExists($sSourcepath & ".exe") $sSourcepath = $sSourcepath & ".exe" Case Else $sSourcepath = FileOpenDialog("Enter AU3/A3X/EXE Inputfile ", "", "Autoit Files(*.au3;*.a3x;*.exe)", 3) If @error Then Exit MsgBox(16 + 262144, Default, "Error: No Inputfile given", 0) EndSelect $sSourcepath = _PathFull($sSourcepath) $aPathSplit = _PathSplit($sSourcepath, $sDrive, $sDir, $sFileName, $sExtension) If DriveGetFileSystem($sDrive) <> "NTFS" Then Exit MsgBox(16 + 262144, Default, "Sorry: Input filesystem must be 'NTFS'", 0) If StringInStr($sSourcepath, " ") Then Exit MsgBox(16 + 262144, Default, "Sorry: Pathnames with embedded blanks not yet supported.", 0) If FileExists($sDrive & $sDir & $sFileName & ".exe") Then $sIconPath = $sDrive & $sDir & $sFileName & ".exe" If FileExists($sDrive & $sDir & $sFileName & ".ico") Then $sIconPath = $sDrive & $sDir & $sFileName & ".ico" EndFunc ;==>_Sourcepath ; End of Au3toCmd.au3 script The script can be called with a file name of an AU3 script as a parameter.
      If no name is entered, a query is made.
      Suggestions for improvement and bug reports are welcome.
    • By jitendriya
      Hi every one .
      I want to read a pdf file and write into a excel using autoit , so how can i do this with out using third party server please tell me .
      Thank you..
    • By NHD
      Hi,
      I'm developing CefAu3 project, it embed Chromium browser to your AutoIt program.
      I'm busy and can stop it. If you want to contribute, you can fork my project and build it yourself.
       


      Some Features:
      - Easy create CEF window
      - Multi-message loop
      - Interaction between AutoIt and JavaScript
      - Supports AutoIt binding
      - Supports user events...

      Github: https://github.com/wy3/cefau3
      MiniBrowser: https://github.com/small-autoit/mb
      CEF project: https://bitbucket.org/chromiumembedded/cef
      Learn more: http://magpcss.org/ceforum/
    • By TheDcoder
      Hello everyone,
      I encountered this strange issue while working on a freelance project, I cannot give you the webpage/website on which this is happening because it is an internal site which is inaccessible externally. I am attempting to create a GUI with an IE control embedded in it, but when I navigate to the desired address, it shows a blank white page.
      The webpage does load if I use a different browser or normal (non-embedded) IE instance.
      I managed to get my hands on the source of the blank page:
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="res://ieframe.dll/ErrorPageTemplate.css" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Navigationen blev annulleret</title> <script src="res://ieframe.dll/errorPageStrings.js" language="javascript" type="text/javascript"> </script> <script src="res://ieframe.dll/httpErrorPagesScripts.js" language="javascript" type="text/javascript"> </script> </head> <body onLoad="javascript:navCancelInit(); "> <table width="730" cellpadding="0" cellspacing="0" border="0"> <!-- Error title --> <tr> <td id="infoIconAlign" width="60" align="left" valign="top" rowspan="2"> <img src="res://ieframe.dll/info_48.png" id="infoIcon" alt="Oplysningsikon"> </td> <td id="mainTitleAlign" valign="middle" align="left" width="*"> <h1 id="mainTitle">Navigationen til websiden blev annulleret</h1> </td> </tr> <tr> <!-- This row is for HTTP status code, as well as the divider--> <td id="errorCodeAlign" class="errorCodeAndDivider" align="right">&nbsp; <div class="divider"></div> </td> </tr> <!-- Error Body --> <!-- What you can do --> <tr> <td> &nbsp; </td> <td id="whatToTryAlign" valign="top" align="left"> <h2 id="whatToTry">Prøv at:</h2> </td> </tr> <!-- refresh page --> <tr> <td > &nbsp; </td> <td id="refreshPageAlign" align="left" valign="middle"> <h4> <table> <tr> <td valign="top"> <img src="res://ieframe.dll/bullet.png" border="0" alt="" class="actionIcon"> </td> <td valign="top"> <span id="navCancelContainer"></span><noscript id="refreshPage">Opdatere siden.</noscript> </td> </tr> </table> </h4> </td> </tr> </table> </body> </html> The ieframe.dll resources are a point of interest. I am not sure how the server is able to detect the embedded instance of IE ...
      Any suggestions? Here is a basic outline of the script:
      #include <IE.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Main() While True Sleep(1000) WEnd Func Main() ; Create GUI $hGUI = GUICreate("", $GUI_WIDTH, $GUI_HEIGHT, $iLeft, $iTop, $WS_POPUP) $oIE = _IECreateEmbedded() ;$oIE = _IECreate() ; This works, but it is not embedded in the GUI GUICtrlCreateObj($oIE, 0, 0, $GUI_WIDTH, $GUI_HEIGHT) GUISetState() ; Navigate to the URL and authenticate _IENavigate($oIE, $URL) EndFunc Thank you for the advice in advance!
    • By Pike
      Hey Everyone, I haven't been here in a while and recently picked up my old project. Still an FNG!
      To the point: I want to be able to push the button and either play an mp3, open a file, or open an exe program (all with the same button). The problem is that I don't know how to code for that at "case 1"
              Case 1                                                                                                                                             
                  Local $sRead = IniRead("config.ini", "Config", "One", "Default")                                
                  SoundPlay($sRead, @HotKeyPressed)                                                                     <-------------------------------
                  Run($sRead, @HotKeyPressed)                                                                                 <------------------------------- This 'Run' doesn't work even by itself!
      See code below for layout. If you need more information I will attach more code or answer any questions. Any help is greatly appreciated.
       
      Much Respect,
      Pike
       
      Func _HandleButton() $iClickCount += 1 $iTimer = TimerInit() AdlibRegister("CheckButtonPress", $CheckTime) EndFunc Func CheckButtonPress() If TimerDiff($iTimer) < $CheckTime Or $iTimer = 0 Then Return Switch $iClickCount Case 1 Local $sRead = IniRead("config.ini", "Config", "One", "Default") SoundPlay($sRead, @HotKeyPressed) Run($sRead, @HotKeyPressed) Case 2 MsgBox(0, "INFORMATION:", "Choose the file you want designated to this button") Local $sFileOpenDialog = FileOpenDialog(0, @ScriptDir & "\", "All (*.*)", $FD_FILEMUSTEXIST + $FD_MULTISELECT) If @error Then MsgBox($MB_SYSTEMMODAL, "", "No file(s) were selected.") EndIf Local $sFileName = InputBox("INFORMATION:", "Please Name Your File?" & @CRLF _ & @CRLF _ & "6 Characters or Less", "") IniWrite(@ScriptDir & "\config.ini", "Config", "One", $sFileOpenDialog) IniWrite(@ScriptDir & "\config.ini", "Config", "NameOne", $sFileName) EndSwitch $iClickCount = 0 AdlibUnRegister() EndFunc  

×
×
  • Create New...