Leaderboard
Popular Content
Showing content with the highest reputation on 01/25/2023 in all areas
-
Nice job again @pixelsearch I came up with this. What do you think ? #include <Array.au3> #include <GDIPlus.au3> #include <WinAPISysWin.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) HotKeySet("{ESC}", "_Quit") ; <=================== Global $hGraphic, $hPen _Main() Func _Main() Local $hGUI = GUICreate("GDI+", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) GUISetBkColor(0x0000FF) _WinAPI_SetLayeredWindowAttributes($hGUI, 0x0000FF) Local $tPoint = DllStructCreate($tagPOINT) _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hPen = _GDIPlus_PenCreate(0xFFFF0000, 5) ; alpha channel = 0xFF (opaque), red = 0xFF0000, width = 5 (pixels) GUISetState() Local $hWnd, $hRoot, $hWnd2, $hWnd_Old = -1, $aWPos While True $tPoint = _WinAPI_GetMousePos() $hWnd = _WinAPI_WindowFromPoint($tPoint) $hWnd2 = GetRealChild($hWnd) If $hWnd2 And $hWnd <> $hWnd2 Then $hWnd = $hWnd2 If $hWnd <> $hWnd_Old Then _GDIPlus_GraphicsClear($hGraphic, 0xFF0000FF) $aWPos = WinGetPos($hWnd) _GDIPlus_GraphicsDrawRect($hGraphic, $aWPos[0], $aWPos[1], $aWPos[2], $aWPos[3], $hPen) $hWnd_Old = $hWnd EndIf Sleep(100) WEnd EndFunc ;==>_Main Func _Quit() ; Clean up resources _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Exit EndFunc ;==>_Quit Func _WinAPI_RealChildWindowFromPoint($hWnd, $tPoint) Local $aRet = DllCall('user32.dll', 'hwnd', 'RealChildWindowFromPoint', 'hwnd', $hWnd, 'struct', $tPoint) If @error Then Return SetError(@error, @extended, 0) Return $aRet[0] EndFunc ;==>_WinAPI_RealChildWindowFromPoint Func GetRealChild($hWnd) Local $tPoint, $hRoot = _WinAPI_GetAncestor($hWnd, $GA_ROOT) If $hWnd = $hRoot Then $tPoint = _WinAPI_GetMousePos(True, $hWnd) Return _WinAPI_ChildWindowFromPointEx($hWnd, $tPoint) EndIf Local $hParent = _WinAPI_GetAncestor($hWnd, $GA_PARENT) Local $aChild = _WinAPI_EnumChildWindows($hParent) If @error Then Return 0 Local $hFound For $i = 1 To $aChild[0][0] $hParent = _WinAPI_GetParent($aChild[$i][0]) $tPoint = _WinAPI_GetMousePos(True, $hParent) $hFound = _WinAPI_RealChildWindowFromPoint($hParent, $tPoint) If $hFound = $aChild[$i][0] Then Return $hFound Next Return 0 EndFunc ;==>GetRealChild2 points
-
From the help file -- So that explains where the 0 comes from. I believe I addressed your other confusion in my prior post, so maybe you could elaborate on why you are still confused.2 points
-
Collection of GitHub users (with AutoIt projects)
teodoric666 reacted to SOLVE-SMART for a topic
Hi folks ๐ , I know about several of us do have AutoIt projects on GitHub. In this hopefully growing collection I want to list forum members and their GitHub projects (AutoIt based). Why? One use case could be the contribution to some of their projects. Assume that AutoIt projects are not that wide spreaded or supported in terms of contribution (participation), as JavaScript projects for example. Wouldn't it be nice to get more contribution on your project? Wouldn't it be nice to work on bigger projects in a community? I personally would love to ๐ . Disclaimer: As the GitHub profiles (and repositories), I will list here, are public and your profiles either findable by your signature, your "About Me" page or by a simple Google or GitHub search ๐ , I see no restriction to collect these kind of information and post it here. In case you don't agree with this visualisation and you don't want to be listet here, please let me know and I will remove that entry as soon as possible ๐ค . I really hope that fits your feeling about it. Collection (in progress): @Forum username ยป GitHub username ยป Link to the GitHub projects (filtered by language=autoit) @Alan72104 ยป Alan72104 ยป Projects @alexanr1 ยป alexanr1 ยป Projects @AspirinJunkie ยป Sylvan86 ยป Projects @Centrally ยป ellysh ยป Projects @Danp2 ยป Danp2 ยป Projects @Danyfirex ยป DanysysTeam ยป Projects @DonChunior ยป DonChunior ยป Projects @ergo ยป seizu ยป Projects @genius257 ยป genius257 ยป Projects @J2TeaM ยป J2TEAM ยป Projects @James ยป jbrooksuk ยป Projects @Jefrey ยป jesobreira ยป Projects @jvanegmond ยป jvanegmond ยป Projects @kurtykurtyboy ยป KurtisLiggett ยป Projects @lamnhan066 ยป lamnhan066 ยป Projects @LinkOut ยป xLinkOut ยป Projects @LoganCH ยป loganch ยป Projects @Mat ยป MattDiesel ยป Projects @Mateocedillo ยป rmcpantoja ยป Projects @matwachich ยป matwachich ยป Projects @mLipok ยป mlipok ยป Projects @MrKm ยป MurageKabui ยป Projects @NHD ยป nomi-san ยป Projects @oHenry ยป htejera ยป Projects @OvisMaximus ยป OvisMaximus ยป Projects @philpw99 ยป philpw99 ยป Projects @rcmaehl ยป rcmaehl ยป Projects @Rurorita ยป OfficialLambdax ยป Projects @rynow ยป 4ern ยป Projects @scintilla4evr ยป scidsgn ยป Projects @seadoggie01 ยป seadoggie01 ยป Projects @seangriffin ยป seanhaydongriffin ยป Projects @smbape ยป smbape ยป Projects @SOLVE-SMART ยป Sven-Seyfert ยป Projects @Stilgar ยป THWillert ยป Projects @Surya ยป thesunRider ยป Projects @tarretarretarre ยป tarreislam ยป Projects @TheDcoder ยป TheDcoder ยป Projects @TheSaint ยป Twombs ยป Projects @trancexx ยป dragana-r ยป Projects @vietanhdev ยป vietanhdev ยป Projects ฮฃ = 41 I would love to see the list growing and I am very excited about a possibly upcoming behavior and improvement change, regarding AutoIt on GitHub ๐ . ๐ก Please help me to increase the list. Either by your GitHub link (profile) or through a link from a member you know. Best regards Sven ________________ Stay innovative!1 point -
read and write xlsx files without Excel
funkey reacted to AspirinJunkie for a topic
This UDF provides 2 functions to read data directly from xlsx files or to output data as xlsx file. Only the cell contents are considered - no cell formatting and the like. It is therefore explicitly not a full replacement for the Excel UDF, since its scope goes well beyond that. But to quickly read in data or to work with xlsx files without having Excel installed, the UDF can be quite useful. There may also be specially formatted xlsx files which I have not yet encountered during testing and which may cause problems. In this case it is best to make a message about it here and upload the file. Note: xlsx files must be unpacked for reading. To make this as fast as possible it is recommended to put a >>7za.exe<< file into the script directory, otherwise a slow alternative will be used. Otherwise an example says more than 1000 words: >>sourcecode and download on github<< Changelog:1 point -
WebDriver click on text to load content
maninternet reacted to Danp2 for a topic
Thanks Sven. We can always hope that this will rub off on some other users. ๐1 point -
WebDriver click on text to load content
SkysLastChance reacted to Danp2 for a topic
Here's my "simplified" version -- #include "wd_helper.au3" #include "wd_capabilities.au3" #include "array.au3" _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('w3c', True) _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') _WD_CapabilitiesDump(@ScriptLineNumber) Local $sCapabilities = _WD_CapabilitiesGet() _WD_Startup() $sSession = _WD_CreateSession($sCapabilities) _WD_Window($sSession,"MAXIMIZE") Local $aSymbol = 'LPF' _WD_Navigate($sSession,"https://www.set.or.th/en/market/product/stock/quote/"& $aSymbol &"/news") _WD_LoadWait($sSession) ; Accept cookies Local $sElement = _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//div[@class='align-self-md-center mb-3 mb-md-0']/button") If @error = $_WD_Error_Success Then _WD_ElementAction($sSession, $sElement, "Click") EndIf Local $sElement = _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//div[contains(@class, 'news-finance-state mb')]/div[2]/div[6]/div/span") If @error = $_WD_Error_Success Then If _WD_ElementAction($sSession, $sElement, "text") = 'more' Then ; scroll to bottom _WD_ExecuteScript($sSession, "window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })") Sleep(1000) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div[contains(@class, 'news-finance-state mb')]/div[2]/div[6]/div") _WD_ElementAction($sSession, $sElement, "Click") EndIf EndIf _WD_DeleteSession($sSession) _WD_Shutdown() Some items of note -- The cookie banner is accepted to avoid any issues due to items being covered by it Forcibly scroll to the bottom of the webpage. This avoids issue with trying to click on "more" when it hasn't fully scrolled into view1 point -
Run multiple setups from ini file
Antivoyager reacted to Trong for a topic
When I submitted the full code it was tested and it certainly worked. But anyway you can try with below code. With the simpler option 2 but I'm not sure if it will work well or not: Global $sFileSetupList = @ScriptDir & "\" & "SetupList.txt" ; Read the current script file into an array using the filepath. Global $aArrayLine = FileReadToArray($sFileSetupList) Global $iLineCount = @extended If @error Then ConsoleWrite("! Error (" & @error & ") reading the file: " & $sFileSetupList & @CRLF) MsgBox(16, @ScriptName, "There was an error reading the file. @error: " & @error & @CRLF & "File: " & $sFileSetupList) ; An error occurred reading the current script file. Else For $i = 0 To $iLineCount - 1 ; Loop through the array. UBound($aArray) can also be used. ;MsgBox(0, @ScriptName, "Installing :" & $aArray[$i]) ; Display the contents of the array. If StringStripWS($aArrayLine[$i], 8) == "" Then ConsoleWrite("! Line is Empty ! " & @CRLF) Else ConsoleWrite("- eXecute: " & $aArrayLine[$i] & @CRLF) RunWait($aArrayLine[$i], @ScriptDir) EndIf Next EndIf SetupList.txt setupname1.exe /S setupname2.exe /SILENT setupname3.exe /VERYSILENT I haven't seen any of your code or error messages, did you go through the Autoit manual?1 point -
So wouldn't this do the same thing ? : $CMD = "Net user /add xyz 123" RunWait(@ComSpec & " /c " & $CMD) $CMD = "Net localgroup administrators xyz /add" RunWait(@ComSpec & " /c " & $CMD) $CMD = "WMIC USERACCOUNT WHERE Name='xyz' SET PasswordExpires=FALSE" RunWait(@ComSpec & " /c " & $CMD) $CMD = "WMIC USERACCOUNT WHERE Name='xyz' SET Passwordchangeable=FALSE" RunWait(@ComSpec & " /c " & $CMD) $CMD = "net user xyz password /add" RunWait(@ComSpec & " /c " & $CMD) $CMD = "net user xyz 123." & @ComputerName & ".123" RunWait(@ComSpec & " /c " & $CMD)1 point
-
@ioa747Thanks I had no idea calling it would return the current state. Local $x = Opt("MouseCoordMode") works fine. I need to read the help file more carefully.1 point
-
ConsoleWrite(Opt("MouseCoordMode") & @CRLF)1 point
-
Run multiple setups from ini file
Antivoyager reacted to mikell for a topic
An ini file must look like [SectionName] Key=Value But you might use a simple txt file [run] setupname1.exe /S setupname2.exe /SILENT setupname3.exe /VERYSILENT with this $lines = FileReadToArray("setup.txt") For $i = 1 to UBound($lines)-1 Msgbox(0,"", $lines[$i]) ; here you could use RunWait Next1 point -
Run multiple setups from ini file
Antivoyager reacted to Trong for a topic
Take a look at the IniRead() function! Example script: Global $sFilePath_INI = @ScriptDir & "\" & @ScriptName & ".INI" Local $eXecute_Dir = @ScriptDir & "\" & IniRead($sFilePath_INI, "RUN", "EXECUTE_DIR", "") Local $nCount = IniRead($sFilePath_INI, "RUN", "EXE_NUM", "0") ConsoleWrite("- IniFilePath : " & $sFilePath_INI & @CRLF) ConsoleWrite("- eXecute_Dir: " & $eXecute_Dir & @CRLF) ConsoleWrite("- Count: " & $nCount & @CRLF) Local $sExe_Name, $sExe_Parameters, $sCommand If $nCount > 0 Then For $i = 1 To $nCount ConsoleWrite("+ Reading data number: " & $i & @CRLF) $sExe_Name = IniRead($sFilePath_INI, "RUN", "EXECUTE_" & $i, "") ConsoleWrite("- Exe_Name: " & $sExe_Name & @CRLF) $sExe_Parameters = IniRead($sFilePath_INI, "RUN", "EXECUTE_" & $i & "_parameters", "") ConsoleWrite("- Exe_Parameters: " & $sExe_Parameters & @CRLF) If StringStripWS($sExe_Name, 8) == "" Then ConsoleWrite("! Exe Name is Empty ! " & @CRLF) Else If FileExists($eXecute_Dir & "\" & $sExe_Name) Then If StringStripWS($sExe_Parameters, 8) == "" Then ConsoleWrite("! No have Exe Parameters ! " & @CRLF) $sCommand = '"' & $eXecute_Dir & "\" & $sExe_Name & '"' Else $sCommand = '"' & $eXecute_Dir & "\" & $sExe_Name & '" ' & $sExe_Parameters EndIf ConsoleWrite("- eXecute: " & $sCommand & @CRLF) ;Your run function is here: RunWait($sCommand, $eXecute_Dir) Else ConsoleWrite("! " & $sExe_Name & " file does not exist in " & $eXecute_Dir & @CRLF) EndIf EndIf Next ConsoleWrite("! EXIT " & @CRLF) EndIf INI eg: [RUN] EXE_NUM=3 EXECUTE_DIR = bin EXECUTE_1 = setupname1.exe EXECUTE_1_parameters = /S EXECUTE_2 = setupname2.exe EXECUTE_2_parameters = /SILENT EXECUTE_3 = setupname1.exe EXECUTE_3_parameters = /VERYSILENT With your request the script will be modified a bit: Global $eXecute_Dir = @ScriptDir Global $sFilePath_INI = $eXecute_Dir & "\" & "Setup.ini" Local $nCount = IniRead($sFilePath_INI, "RUN", "EXE_NUM", "0") ConsoleWrite("- Count: " & $nCount & @CRLF) Local $sExe_Name, $sExe_Parameters, $sCommand If $nCount > 0 Then For $i = 1 To $nCount ConsoleWrite("+ Reading data number: " & $i & @CRLF) $sExe_Name = IniRead($sFilePath_INI, "RUN", "EXECUTE_" & $i, "") ConsoleWrite("- Exe_Name: " & $sExe_Name & @CRLF) $sExe_Parameters = IniRead($sFilePath_INI, "RUN", "EXECUTE_" & $i & "_parameters", "") ConsoleWrite("- Exe_Parameters: " & $sExe_Parameters & @CRLF) If StringStripWS($sExe_Name, 8) == "" Then ConsoleWrite("! Exe Name is Empty ! " & @CRLF) Else If FileExists($eXecute_Dir & "\" & $sExe_Name) Then If StringStripWS($sExe_Parameters, 8) == "" Then ConsoleWrite("! No have Exe Parameters ! " & @CRLF) $sCommand = '"' & $eXecute_Dir & "\" & $sExe_Name & '"' Else $sCommand = '"' & $eXecute_Dir & "\" & $sExe_Name & '" ' & $sExe_Parameters EndIf ConsoleWrite("- eXecute: " & $sCommand & @CRLF) ;Your run function is here: RunWait($sCommand, $eXecute_Dir) Else ConsoleWrite("! " & $sExe_Name & " file does not exist in " & $eXecute_Dir & @CRLF) EndIf EndIf Next ConsoleWrite("! EXIT " & @CRLF) EndIf Setup.ini content: [RUN] EXE_NUM=9 EXECUTE_1 = setupname1.exe EXECUTE_1_parameters = /S EXECUTE_2 = setupname2.exe EXECUTE_2_parameters = /SILENT EXECUTE_3 = setupname3.exe EXECUTE_3_parameters = /VERYSILENT EXECUTE_4 = setupname4.exe EXECUTE_4_parameters = /CMD4 EXECUTE_5 = setupname5.exe EXECUTE_5_parameters = /CMD5 EXECUTE_6 = setupname6.exe EXECUTE_6_parameters = /CMD6 EXECUTE_7 = setupname7.exe EXECUTE_7_parameters = /CMD7 EXECUTE_8 = setupname8.exe EXECUTE_8_parameters = /CMD9 EXECUTE_9 = setupname9.exe EXECUTE_9_parameters = /CMD91 point -
The problem is in MaxCMDScanner.exe it won't quit if you don't activate the scan window! But cannot use AutoIT's function to activate that window. And you also can't close antivirus processes with taskkill or processClose because it's protected by drivers! I am quite annoyed and annoyed with this antivirus so I spent three hours researching and you can refer to the code: ;----------------------------------------------------- ;#Compiler options #RequireAdmin #NoTrayIcon ;----------------------------------------------------- ;----------------------------------------------------- ;#pragma options #pragma compile(Out, "MaxCLIScanner.exe") #pragma compile(ExecLevel, requireAdministrator) #pragma compile(Console, true) #pragma compile(LegalTrademarks, 'Dao Van Trong - TRONG.LIVE') ;----------------------------------------------------- ;----------------------------------------------------- ;#includes #include <Process.au3> #include <WinAPIProc.au3> #include <WinAPIShPath.au3> ;----------------------------------------------------- ;----------------------------------------------------- Opt("MustDeclareVars", 1) ;----------------------------------------------------- ;----------------------------------------------------- ;#Variables ;~ Global $aCmdLineRaw = @Compiled ? $CmdLineRaw : StringReplace($CmdLineRaw, '/ErrorStdOut "' & @ScriptFullPath & '"', "") & ' "' & @ScriptFullPath & '"' ; ;TEST Global $aCmdLineRaw = @Compiled ? $CmdLineRaw : StringReplace($CmdLineRaw, '/ErrorStdOut "' & @ScriptFullPath & '"', "") Global $aCmdLine = _WinAPI_CommandLineToArgv($aCmdLineRaw) Global $sPath_MaxCMDScanner = @HomeDrive & "\Program Files\Max Secure Anti Virus Plus" Global $sProcess_MaxCMDScanner = "MaxCMDScanner.exe" Global $sMaxCMDScanner = $sPath_MaxCMDScanner & "\" & $sProcess_MaxCMDScanner Global $sOption_MaxCMDScanner = "/C /V /CM /E /DRIVES:" ;----------------------------------------------------- If Not FileExists($sMaxCMDScanner) Then ConsoleWrite('! /!\ ERROR: MaxCMDScanner.exe" does not exist, please review the path or install "Max Secure Anti Virus Plus" !' & @CRLF & @CRLF) MsgBox(16, "/!\ MaxCLIScanner Error !", '"MaxCMDScanner.exe" does not exist, please review the path or install "Max Secure Anti Virus Plus" !', 5) Exit EndIf _Main() Func _Main() If Not IsArray($aCmdLine) Or ($aCmdLine[0] < 1) Then ConsoleWrite("! No command or file input! " & @CRLF & "- Usage: " & @ScriptName & " <filePath_1> <filePath_2> ... <filePath_n> " & @CRLF & @CRLF) MsgBox(48, "/!\ MaxCLIScanner Error !", "! No command or file input! " & @CRLF & "- Usage: " & @ScriptName & " <filePath_1> ... <filePath_n> " & @CRLF & @CRLF, 30) Return SetError(1, 0, 0) EndIf For $i = 1 To $aCmdLine[0] _MaxScan($aCmdLine[$i]) Next EndFunc ;==>_Main Func _MaxScan($sFilePath) _TryClosingAnotherTask() If _Is_AnotherTaskIsAlreadyRunning() Then ConsoleWrite("! Error: MaxCLIScanner is busy with another task, please waiting..." & @CRLF) ToolTip("MaxCLIScannerr: Waiting for another process to finish...", 1, 1) EndIf While _Is_AnotherTaskIsAlreadyRunning() Sleep(100) WEnd ToolTip("MaxCLIScanner - Scanning: " & $sFilePath & " - Please wait....", 1, 1) Local $sCommand = '"' & $sMaxCMDScanner & '" ' & $sOption_MaxCMDScanner & '"' & $sFilePath & '"' Local $sOutput = _RunWait($sCommand, $sPath_MaxCMDScanner) ;Processing output results here! If StringInStr($sOutput, "No Spyware Found") Then ToolTip("MaxCLIScanner - Scan done > No Spyware Found in: " & $sFilePath & " !", 1, 1) MsgBox(64, "MaxCLIScanner - Scan done !", "> No Spyware Found in: " & $sFilePath, 30) Else ToolTip("MaxCLIScanner - Scan done - Result: " & $sOutput, 1, 1) MsgBox(16, "Max CMD Scanner: " & $sFilePath, $sOutput, 30) EndIf ToolTip("") EndFunc ;==>_MaxScan Func _RunWait($sCommand, $WorkingDir = @WorkingDir) ConsoleWrite("+ Execute Command: " & $sCommand & @CRLF) ConsoleWrite("+ WorkingDir: " & $sCommand & @CRLF) Local $sOutput = '', $iPID = Run($sCommand, $WorkingDir, @SW_HIDE, 0x8) Do ;ToolTip($sOutput) If StringInStr($sOutput, 'Scan End') Or StringInStr($sOutput, 'slowing down scanning') Then _ClosingTask($iPID) $sOutput &= StdoutRead($iPID) Until @error Do ;ToolTip($sOutput) If StringInStr($sOutput, 'Scan End') Or StringInStr($sOutput, 'slowing down scanning') Then _ClosingTask($iPID) $sOutput &= StderrRead($iPID) Until @error ConsoleWrite(StringStripWS($sOutput, 7) & @CRLF) Return $sOutput EndFunc ;==>_RunWait Func _Is_AnotherTaskIsAlreadyRunning() ;If (WinExists("MaxCMDScanner") Or ProcessExists($sProcess_MaxCMDScanner)) Then Return 1 If ProcessExists($sProcess_MaxCMDScanner) Then Return 1 Return 0 EndFunc ;==>_Is_AnotherTaskIsAlreadyRunning Func _ClosingTask($iPID = @AutoItPID) Local $a_children = _WinAPI_EnumChildProcess($iPID) If IsArray($a_children) Then If $a_children[0][0] > 0 Then For $i = 1 To $a_children[0][0] ;ConsoleWrite($a_children[$i][0] & @CRLF) ;ConsoleWrite($a_children[$i][1] & @CRLF) Local $sProcessName = _ProcessGetName($a_children[$i][0]) If $sProcessName = 'conhost.exe' Then ProcessClose($a_children[$i][0]) Next EndIf EndIf Local $a_children = _WinAPI_EnumChildProcess(ProcessExists($sProcess_MaxCMDScanner)) If IsArray($a_children) Then If $a_children[0][0] > 0 Then For $i = 1 To $a_children[0][0] ;ConsoleWrite($a_children[$i][0] & @CRLF) ;ConsoleWrite($a_children[$i][1] & @CRLF) Local $sProcessName = _ProcessGetName($a_children[$i][0]) If $sProcessName = 'conhost.exe' Then ProcessClose($a_children[$i][0]) Next EndIf EndIf Local $a_children = _WinAPI_EnumChildProcess(@AutoItPID) If IsArray($a_children) Then If $a_children[0][0] > 0 Then For $i = 1 To $a_children[0][0] ;ConsoleWrite($a_children[$i][0] & @CRLF) ;ConsoleWrite($a_children[$i][1] & @CRLF) Local $sProcessName = _ProcessGetName($a_children[$i][0]) If $sProcessName = 'conhost.exe' Then ProcessClose($a_children[$i][0]) Next EndIf EndIf EndFunc ;==>_ClosingTask Func _TryClosingAnotherTask() ;For $i = 1 To 100 ; ProcessClose("conhost.exe") ;Next Local $icout = 99 If WinExists("MaxCMDScanner") Then While WinExists("MaxCMDScanner") ControlClick("MaxCMDScanner", "", '[CLASS:Button; INSTANCE:1]') ControlClick("MaxCMDScanner", "Command Line Scanner is already Running", '[CLASS:Button; INSTANCE:1]') WinClose("MaxCMDScanner") $icout -= 1 If $icout < 1 Then ExitLoop WEnd EndIf Local $icout = 99 If WinExists($sMaxCMDScanner) Then While WinExists($sMaxCMDScanner) WinActive($sMaxCMDScanner) WinClose($sMaxCMDScanner) WinClose("MaxCMDScanner") $icout -= 1 If $icout < 1 Then ExitLoop WEnd EndIf EndFunc ;==>_TryClosingAnotherTask1 point
-
Sign your exe with a Digital Signature / Signtool.exe
TheSaint reacted to Tankbuster for a topic
If someone gets offended by this, because he knows already 200 posts about it. Do not reply. Yes, some wrote already here some words what to do. Yes, you are right I created nothing new. But I want this summed up for forum searchers, that maybe find this posting useful in spending less time to find an answer in one place. I don't want to re-animate very old postings. So forgive me if I try to help other idiots like myself. ==================== First I need to give credits to: For summing it up in a nearly complete way. ==================== There is a nice Gui existing that wrapps it up: Digital Sign Tool Below you also find some instructions how to add it to the compiler. ==================== I tested this on a Windows 7 (x64) - but all codes used is x86 (32bit) - for 64bit I need to create another package (or make the script smarter). So here is the sequence in general: general purpose: I created several EXE files of the years, and I do not want to use the SIGNUI to click each file. So I want a command line version. Create a folder - I named it x:cert4me Download from : http://www.kastaban.de/cert4me/MAKE_MY_CERT_FILE.zip The zip: Contains: 1999-04-15 17:10:28 PVKIMPRT.EXE 2003-03-24 23:03:00 makecert.exe 2005-09-23 07:56:00 cert2spc.exe 2006-03-03 23:22:44 signtool.exe 2007-04-11 11:11:20 capicom.dll 2007-09-27 14:17:44 pvk2pfx.exe 2013-03-13 15:24:27 MAKE_MY_CERT_FILE.CMD 2013-03-13 15:31:52 SIGN_FILE.CMD Extract the files in : X:Cert4me now open a cmd in the created folder with the extracted files (the script will also work from other folder but so you are closer to the result...) cd /D x:\cert4me Now you either watch this little video with a sample of the signing process (a little bit fast - but you are to pause it if you like, and sorry for the German screen texts) http://www.kastaban.de/cert4me/CERT4ME/CERT4ME.html or First start : MAKE_MY_CERT_FILE.CMD myNewCertificate secret01 MAKE_MY_CERT_FILE.CMD needs two arguments 1=the name of the certificate 2=your password Sign now the EXE with: SIGN_FILE.CMD "d:\1work\mit space\TFTP_HELPER.exe" keys\myNewCertificate_cert.pfx secret01 SIGN_FILE.CMD needs three arguments 1=the file path of your executable 2=the filepath to the pfx folder (created before !) 3=your password Done. in case you want to sign more than one EXE repeat the "Sign now" step with the other EXE. ================= I packed the files from the original post and added additional files to offer a complete package. this was tested on Windows 7 (64bit) but all tools and my EXE are 32bit . Keep this in mind. For 64bit the similar tools of 64bit are maybe needed (not sure). Maybe someone could start to convert this to a AU3.....because some fields are still left open. Like the End DATE, email field, timestamps URL..... And "if" someone got additional stuff to add here (for other idio.....mmmh......searchers), do it. And most important , in case I wrote something wrong or it does not work for you please comment. ======================================================================== //edit: 16.03.2013 - Thx Emiel - as always I face problems with the NOT and Or :-)1 point