apollo13 Posted October 17, 2012 Posted October 17, 2012 Hi i'm looking for include into my AutoIT script a test to a file that tell me when my XP VirtualMachineis ready (WinLogon)I must create a loop WHILE...WEND until ERROLEVEL is "1" and exit loop when is not "1".But how i can include test to DOS errorlevel ??I have searched on WEB and i have found and readed this informations:- Function _ProcessExitCode() downloaded but running it --> tell me nothing on the state of file.- Exit[return code]- @exitCode ..... but i haven't found informaion how use it- @exitMethod ... similar previou, i haven't found information how use itFor this moment i have realized a Mix of Batch and Au3 doing a loop in file BATCH, that verify if exist a file in VirtualMachine (not possible use AutoIT function "fileexists" --file is not in any folder-- but i must use a command of VirtualBox that do this)The command answers with a DOS code of ErrorLevel="1" if file doesn't exists.Now i have compiled the batch file to EXE file and then i have included it in AU3 scriptin this mode:============ WinLogonTest.BAT that i compiled into WinLogonTest.EXE ==========@echo off:CheckWinLogon app64\vboxmanage --nologo guestcontrol "WinXP" stat "C:\Windows\Win.ini" --username "MyName" REM If errorlevel is "1" the file Win.INI in Virtual Machine doesn't exist therefore Windows is not ready If errorlevel==1 Goto CheckWinLogon REM Now Windows is Ready "WinLogon it's done" and exit LoopExit=================================================================================####### Start.Au3 ##########Run("WinLogonTest.exe") ; Batch Compiled that test WinLogonRun("VirtualMachine....")While processexists("WinLogonTest.exe") sleep(250)WendMsgbox(0, "", "Virtual Machine Ready, Script resume)..........##############################Please give me some suggestions or links to learn ho can use only AutoIT script.Thanks
water Posted October 17, 2012 Posted October 17, 2012 DOS errorlevel is return code of the last called program. In AutoIt you can use RunWait to start a program, wait until the program ends and get the return code. Example: $iReturnCode = RunWait(@WindowsDir & "notepad.exe", @WindowsDir, @SW_MAXIMIZE) My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted October 18, 2012 Posted October 18, 2012 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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