MihailProgramming Posted August 1, 2015 Share Posted August 1, 2015 The code is:expandcollapse popup@echo off set m2ver=Alpha 1.0.1 set m2=%~dp0 if not exist %~dp0\lib\nul ( set b=%cd% cd %m2% md lib cd %b% ) set lib=%~dp0\lib set me=%~1 if not exist "%me%" goto end for /f "eol=/ delims=" %%i in (%me%) do call :executer %%i :executer if "%~1"=="" goto end if "%~1"=="#define" goto define if "%~1"=="#include" goto include if "%~1"=="#goto" goto goto if "%~1"=="#execute" goto execute if "%~1"=="#call" goto call if "%~1"=="#if" goto if if "%~1"=="#ifnot" goto ifnot if "%~1"=="#while" goto while if "%~1"=="#ver" goto ver goto out-commands :ver echo Official M2 Installed echo Version: %m2ver% goto end :while :wst if %~2 ( call :executer %~3 call :executer %~4 call :executer %~5 goto wst ) goto end :call if exist "%~2" for /f "eol=/ delims=" %%i in (%~2) do call :executer %%i goto end :execute if exist "%~2" call %~2 %~3 goto end :ifnot if not %~2 call :executer %3 %4 %5 %6 %7 %8 %9 goto end :if if %~2 call :executer %3 %4 %5 %6 %7 %8 %9 goto end :restart for /f "eol=/ delims=" %%i in (%me%) do call :executer %%i goto end :goto set i=%~2 set /a lines=%i%-1 if "%i%"=="0" goto restart if "%lines%"=="0" goto restart for /f "skip=%lines% eol=/ delims=" %%i in (%me%) do call :executer %%i goto end :define if "%~2"=="" goto end if "%~3"=="" goto end set %~2=%~3 goto end :include if not exist %lib%\%~2\nul goto end path %path%;%lib%\%~2 goto end :out-commands if not exist "%lib%\%~1\%~2.bat" goto end call %~2.bat %3 %4 %5 %6 %7 %8 %9 goto end :endThank you for helping me! Link to comment Share on other sites More sharing options...
TheDcoder Posted August 2, 2015 Share Posted August 2, 2015 Welcome to AutoIt forums Mihail! , What are you trying to do with that batch script? Since its beyond my scope to convert it to AutoIt script, you can try these resources to get down the basics of AutoIt, TD EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
guinness Posted August 2, 2015 Share Posted August 2, 2015 Super trivial to convert, you need (not in this order)FileExists, If...EndIf, Local/Global, While, Calling functions, For...Next. // THERE IS NO GOTO IN AutoIt UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
water Posted August 2, 2015 Share Posted August 2, 2015 Welcome to Autoit and the forum!As we do not spoon feed users here, can you please show us what you have tried so far? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Exit Posted August 2, 2015 Share Posted August 2, 2015 Please show us a sample Input file, so we can better understand your BAT script.BTW. Why you want to convert it to AU3 ? Never change a running system. App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Skysnake Posted August 14, 2015 Share Posted August 14, 2015 Hi MihailProgramming, I think what you need to know is that you can write a AU3 script that looks and works much like a bat. Thats where I started, basic batch, just on steroids...However, using AutoIts GUI capabilities you can either just put a simple GUI on it, to hide what your script is doing, or you can actually create a full GUI where everything uses all of AutoIT. Perhaps start with just basics - make a very simple au3 script that jsut does exactly the same with no GUI components. Once you get the hang of it, the rest will come easily. Good luck Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now