Hey, I have a problem I tried to look for it but it didn't solve the problem, I can't add an icon to the exe, I already know there were such topics I tried to all add exclusion C: \ Users \ Marcin \ AppData \ Local \ AutoIt v3 \ aut472.tm.exe to antivirus but after compilation, the name of the file changes, I uninstalled the anti-virus, but it didn't works, except that when I add the example icons from AutoIT it works, I downloaded icons using Firefox Developer Edition also don't works, just the downloaded graphics don't works also. Is there any solution to this problem?
I'm quite new to AutoIT and I have a very big batch file that I'm trying to completely re-write in Autoit, so far it's been going well but I got stuck with a certain part, hope someone can help.
Here's the part of the batch script I'm currently stuck re-creating in AutoIT:
:BeginLangMenu if "%OptNum%" gtr "0" goto ShowLangMenu ::Next Section code based on code supplied by Aacini from stackoverflow.com :DefineLangMenu for /L %%D in (1,1,99) do ( if exist Common\Settings\Data%%D.ini for /F "eol=# tokens=1,2 delims==" %%a in (Common\Settings\Data%%D.ini) do ( set line=%%a if "!line:~2,5!" neq "clude" ( REM Define "normal" variables, i.e. Compressor, Method, etc. set %%a= ) else if "!line:~7!" neq "" ( REM Define the base array elements, i.e. D1IncludeAR=%%b, D1ExcludeAR=%%b, ... set D%%D%%a=%%b REM Set Show?? array elements with value equal 1, i.e. ShowAR=1, ... REM when anyone of DiInclude?? or DiExclude?? corresponding elements was given if defined D%%D%%a set Show!line:~7!=1 ) ) ) REM Define a list of language abbreviations, i.e. "langs=AR CZ DE ..." REM and the corresponding language names array, i.e. lang[AR]=Arabic, ... REM At same time, calculate original OptNum for %%a in ("AR=Arabic" "CZ=Czech" "DE=German" "EN=English" "ES=Spanish" "ESMX=Spanish(Mexico)" "FR=French" "HU=Hungarian" "IT=Italian" "JP=Japanese" "KR=Korean" "PL=Polish" "PR=Portuguese" "PRBR=Portuguese(Brazil)" "RU=Russian" "ZH=Chinese") do ( for /F "tokens=1,2 delims==" %%b in (%%a) do ( set "langs=!langs! %%b" set "lang[%%b]=%%c" set /A "OptNum+=Show%%b" ) ) ::NEXT 2 SECTIONS DISPLAYS THE LANGUAGE SELECTION MENU IF APPLICABLE :ShowLangMenu set /a step=%step%+1 :LangMenu if "%OptNum%"=="0" Goto checksplit echo %TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2% - Showing Language Selection Menu >> "%workdir%Conversion.log" REM Show the language menu set #=0 for %%a in (%langs%) do ( if defined Show%%a ( set /A #+=1 rem echo [!#!] !lang[%%a]! echo !lang[%%a]! >> %b2eincfilepath%\Lang.txt set "option[!#!]=%%a" ) ) %MYFILES1%\DROPDOWNBOX.exe /F:"%b2eincfilepath%\Lang.txt" "Choose Which Language to Compress" "STEP %step%: Language Selection" /W:280 /RI /C:13 >nul > %b2eincfilepath%\LangAnswer.txt if %ERRORLEVEL% EQU 0 del %b2eincfilepath%\LangAnswer.txt if exist %b2eincfilepath%\LangAnswer.txt set /p "SelectLang="<%b2eincfilepath%\LangAnswer.txt if not defined SelectLang goto LangError if %SelectLang%==Arabic Set LangOpt=AR if %SelectLang%==Czech set LangOpt=CZ if %SelectLang%==German set LangOpt=DE if %SelectLang%==English set LangOpt=EN if %SelectLang%==Spanish set LangOpt=ES if %SelectLang%==Spanish(Mexico) set LangOpt=ESMX if %SelectLang%==French set LangOpt=FR if %SelectLang%==Hungarian set LangOpt=HU if %SelectLang%==Italian set LangOpt=IT if %SelectLang%==Japanese set LangOpt=JP if %SelectLang%==Korean set LangOpt=KR if %SelectLang%==Polish set LangOpt=PL if %SelectLang%==Portuguese set LangOpt=PR if %SelectLang%==Portuguese(Brazil) set LangOpt=PRBR if %SelectLang%==Russian set LangOpt=RU if %SelectLang%==Chinese set LangOpt=ZH if defined SelectLang Goto LangSet ::SETS THE LANGUAGE SELECTION ACCORDING TO USER INPUT IN LANGUAGE MENU :LangSet set "LangIs=%LangOpt%"
Basically, here's what I need to do:
Read from specific section of INI file but ONLY the Keys that have a Value. OR: A way to remove the keys without the values from the Array created by IniReadSection. A way to then take these stored values, and create a list of Languages based last 2-4 characters of the Key names. At this point, that said list is shown to user in DropDown box, after user make selection I need a way to move the Value of the Key related to the selected Language to a Variable, and ONLY the value for that specific Language. That's it basically, the rest is more or less Variable manipulation which isn't a problem.
A little Example:
My INI file have a Section like this:
[LangInclude] IncludeAR=a IncludeCZ= IncludeDE=b IncludeEN= IncludeES=c IncludeESMX= IncludeFR= IncludeHU=d IncludeIT= IncludeJP= IncludeKR=e IncludePL= IncludePR= IncludePRBR= IncludeRU= IncludeZH= I need to get Only the keys that are set, in this case: IncludeAR, IncludeDE, IncludeES, IncludeHU & IncludeKR.
I then need to convert these to a list of languages, in this example it will be (Arabic, German, Spanish, Hungarian, Korean).
That list will be turned to DropDown selection, that I can do easily once I get the list correctly.
After the user Selected, let us say for the example purpose Spanish, I need the Value of IncludeES to be moved into a Variable, like this: $Var=c
I hope somebody can help me because I'm stuck after Importing the INI section with IniReadSection, everything I tried so far failed, the best I managed to do is Sort the array to have all the keys with values either at the first rows or last rows.
I need some ideas.
TeraCopy Timer - A program of mine, front end really, that I have been working on (on & off) for some time, but not shared here before, that I recall. Third party program TeraCopy is required.
Many of you will be familiar with TeraCopy, and it has been discussed here at AF on several occasions, in various sub forums, including Chat.
BE ADVISED - I still use an older version of TeraCopy (v2.27), a goody but an oldy, so have only tested my program with that. It may work with the newer v3.xx, or may be easily adjusted to do so, but I have not yet gone that route. Likewise, I only use it with Win 7 and Win XP, but I don't imagine there should be any issues with newer Windows. Add to that, my program being devised and created in AutoIt v188.8.131.52.
So what is TeraCopy Timer and why might you need it?
Those familiar with TeraCopy use, know you can run multiple copy or move jobs either simultaneously or concurrently (one immediately after another has finished). With the free version at least, you have no control over precise order or timing, and no way to deal (without manual interaction) with the pesky Thumbs.db files in Win XP. TeraCopy Timer allows you to do all those things, and in a batch fashion.
Some screenshots and brief explanation
This new WAIT feature is the simplest and best way to use the program generally (in my view) ... but check out the following, as it is not always the case.
Advanced Delay Window
WARNING - It should go without saying, that you take all the usual precautions. For instance, don't use move with the only copy you have of precious files. BACKUP BACKUP BACKUP! Don't hold me liable for anything, except for being a nice guy who likes to share.
TeraCopy Timer v2.8.zip (see detail at Post #34)
P.S. I am not affiliated in any way with those who created and provide the excellent third party program - TeraCopy.
script read path to pst files from registry and write this informations to txt file. Unfortunately there are stored not needed lines: path to ost file, other line has string IndexAvailableBodyand first line is blank. How can i remove anything from txt file exept path to pst files ?
Thanks in advance!
#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <DateTimeConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <array.au3> #include <IE.au3> #include <WinAPIFiles.au3> #include <FileConstants.au3> #include <File.au3> #include <GUIListBox.au3> #include <Date.au3> $Form2 = GUICreate("Form1", 405, 294, 633, 264) $Button1 = GUICtrlCreateButton("Button1", 72, 48, 113, 33) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _searchPSTFiles() EndSwitch WEnd FUNC _searchPSTFiles() Global $aLines ;$sFileName = @ScriptDir & "\Pst.txt" $sFileNameTMP = @ScriptDir & "\Psttmp.txt" ;IF FileExists ($sFileName) then FileDelete ($sFileName) IF FileExists ($sFileNameTMP) then FileDelete ($sFileNameTMP) ;$logpathpst = FileOpen($sFileName, $FO_OVERWRITE) $logpathpsttmp = FileOpen($sFileNameTMP, $FO_OVERWRITE) Local $Outlookpst For $i = 1 To 30 $Outlookpst[$i] = RegEnumVal("HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Search\", $i) If @error <> 0 Then ExitLoop If $Outlookpst = "" Then ContinueLoop EndIf FileWrite($logpathpstTMP, @CRLF & $Outlookpst[$i]) Next ;FileClose ($sFileName) FileClose ($sFileNameTMP) EndFunc
I have learned how to use TraySetIcon icon and toggle between icons that I added as resources using
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files (x86)\AutoIt3\Icons\au3.ico My current work around is
Doit() Func Doit() Local $TestIcon = @ScriptDir&"\Test.ico" Local $ProdIcon = @ScriptDir&"\Prod.ico" Local $Test = "Test" Local $Prod = "Prod" Local $Current = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\My Program","Location") If $Current = $Prod Then FileCreateShortcut($Test,@DesktopCommonDir&"\TestLink.lnky",Default,Default,"Test Link",$TestIcon) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\My Program",$Test) Else FileCreateShortcut($Test,@DesktopCommonDir&"\TestLink.lnky",Default,Default,"Test Link",$ProdIcon) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\My Program",$Prod) EndIf EndFunc I did a bit of quick cutting, from my working program. Basically it creates an link on the desktop, and then deletes it and creates a new one each time it is run. If you where wondering, I made it a .lnky file so that I could add a custom right click menu for it.
This example came from a something I am using to switch between prod and test environments, so the actual link created does not launch the script. You can right-click on the link and run the script to change environments. The icon lets me know at a glance which environment I am currently set for.
What I am trying to figure out is if there is a way to change the icon of the executable of the script only using the resources compiled within that script. What would be nice would be to have a ScriptSetIcon function.